NovacoinLibrary.git
8 years agoDon't check proof-of-stake signature twice.
CryptoManiac [Thu, 10 Sep 2015 19:08:11 +0000]
Don't check proof-of-stake signature twice.

8 years agoCheckProofOfWork should be static.
CryptoManiac [Thu, 10 Sep 2015 17:34:43 +0000]
CheckProofOfWork should be static.

8 years agoMinor cleanup
CryptoManiac [Thu, 10 Sep 2015 17:26:13 +0000]
Minor cleanup

8 years agoUse GetProofOfStakeHash
CryptoManiac [Thu, 10 Sep 2015 00:32:18 +0000]
Use GetProofOfStakeHash

8 years agoSave proof-of-stake kernel hash.
CryptoManiac [Wed, 9 Sep 2015 23:55:07 +0000]
Save proof-of-stake kernel hash.

8 years agoReplace ref with out in the stake modifier calculation method.
CryptoManiac [Wed, 9 Sep 2015 23:10:45 +0000]
Replace ref with out in the stake modifier calculation method.

8 years agoFix multiplication bug.
CryptoManiac [Wed, 9 Sep 2015 23:09:15 +0000]
Fix multiplication bug.

8 years agoFlush cursor item directrly to resolve syncronization issues. Not so fast, but at...
CryptoManiac [Wed, 9 Sep 2015 21:36:28 +0000]
Flush cursor item directrly to resolve syncronization issues. Not so fast, but at least it works well.

TODO: A proper delayed item update implementation.

8 years agoFix txpos calculation issue and use out instead of ref for stake hash and target...
CryptoManiac [Wed, 9 Sep 2015 20:27:15 +0000]
Fix txpos calculation issue and use out instead of ref for stake hash and target values.

8 years agoAdd vtx.Length value to output.
CryptoManiac [Wed, 9 Sep 2015 20:20:16 +0000]
Add vtx.Length value to output.

8 years agoYet another bugfix. :)
CryptoManiac [Wed, 9 Sep 2015 19:41:01 +0000]
Yet another bugfix. :)

8 years agoFix issue with connecting same-block-confirmed inputs.
CryptoManiac [Wed, 9 Sep 2015 11:30:04 +0000]
Fix issue with connecting same-block-confirmed inputs.

TODO: Ensure that neither coinbase nor coinstake outputs are
   available for spending in the generation block.

8 years agoUse BigNum for rewards calculation.
CryptoManiac [Wed, 9 Sep 2015 08:48:38 +0000]
Use BigNum for rewards calculation.

8 years agoIEquatable, IComparable implementation.
CryptoManiac [Wed, 9 Sep 2015 08:48:04 +0000]
IEquatable, IComparable implementation.

8 years agoAdd wrapper for BouncyCastle's BigInteger.
CryptoManiac [Wed, 9 Sep 2015 08:23:56 +0000]
Add wrapper for BouncyCastle's BigInteger.

8 years agoAdd incompatibility notice.
CryptoManiac [Tue, 8 Sep 2015 23:07:48 +0000]
Add incompatibility notice.

System.Numerics based implementation of GetProofOfWorkReward function produces incorrect reward values.

OpenSSL:

```
bnUpperBound=100000000, bnLowerBound=50005000, bnMidValue=50005000
bnUpperBound=75002500, bnLowerBound=50005000, bnMidValue=75002500
bnUpperBound=62503750, bnLowerBound=50005000, bnMidValue=62503750
bnUpperBound=56254375, bnLowerBound=50005000, bnMidValue=56254375
bnUpperBound=56254375, bnLowerBound=53129687, bnMidValue=53129687
bnUpperBound=54692031, bnLowerBound=53129687, bnMidValue=54692031
bnUpperBound=54692031, bnLowerBound=53910859, bnMidValue=53910859
bnUpperBound=54301445, bnLowerBound=53910859, bnMidValue=54301445
bnUpperBound=54301445, bnLowerBound=54106152, bnMidValue=54106152
bnUpperBound=54301445, bnLowerBound=54203798, bnMidValue=54203798
bnUpperBound=54301445, bnLowerBound=54252621, bnMidValue=54252621
bnUpperBound=54301445, bnLowerBound=54277033, bnMidValue=54277033
bnUpperBound=54301445, bnLowerBound=54289239, bnMidValue=54289239
bnUpperBound=54295342, bnLowerBound=54289239, bnMidValue=54295342
```

System.Numerics:

```
bnUpperBound=100000000 bnLowerBound=50005000 bnMidValue=50005000
bnUpperBound=75002500 bnLowerBound=50005000 bnMidValue=75002500
bnUpperBound=62503750 bnLowerBound=50005000 bnMidValue=62503750
bnUpperBound=56254375 bnLowerBound=50005000 bnMidValue=56254375
bnUpperBound=56254375 bnLowerBound=53129687 bnMidValue=53129687
bnUpperBound=54692031 bnLowerBound=53129687 bnMidValue=54692031
bnUpperBound=54692031 bnLowerBound=53910859 bnMidValue=53910859
bnUpperBound=54301445 bnLowerBound=53910859 bnMidValue=54301445
bnUpperBound=54301445 bnLowerBound=54106152 bnMidValue=54106152
bnUpperBound=54301445 bnLowerBound=54203798 bnMidValue=54203798
bnUpperBound=54301445 bnLowerBound=54252621 bnMidValue=54252621
bnUpperBound=54301445 bnLowerBound=54277033 bnMidValue=54277033
bnUpperBound=54301445 bnLowerBound=54289239 bnMidValue=54289239
bnUpperBound=54301445 bnLowerBound=54295342 bnMidValue=54295342
```

8 years agogetTxOutItem()
CryptoManiac [Tue, 8 Sep 2015 20:06:08 +0000]
getTxOutItem()

8 years agoIssue to be dealt with in the near future.
CryptoManiac [Mon, 7 Sep 2015 22:33:16 +0000]
Issue to be dealt with in the near future.

8 years agoFix merkleNode exceptions.
CryptoManiac [Mon, 7 Sep 2015 22:04:32 +0000]
Fix merkleNode exceptions.

8 years agoGetCoinAge
CryptoManiac [Mon, 7 Sep 2015 21:47:13 +0000]
GetCoinAge

8 years agoGetMinTxFee & use unsigned int for sizes.
CryptoManiac [Mon, 7 Sep 2015 21:30:19 +0000]
GetMinTxFee & use unsigned int for sizes.

8 years agoGetProofOfStakeReward
CryptoManiac [Mon, 7 Sep 2015 21:05:50 +0000]
GetProofOfStakeReward

8 years agoConnectInputs + stubs for GetCoinAge, GetMinFee and GetProofOfStakeReward.
CryptoManiac [Mon, 7 Sep 2015 17:27:36 +0000]
ConnectInputs + stubs for GetCoinAge, GetMinFee and GetProofOfStakeReward.

8 years agoRun block addition database operations in single transaction.
CryptoManiac [Mon, 7 Sep 2015 15:57:14 +0000]
Run block addition database operations in single transaction.

8 years agoCalculation of ValueIn and nSigops, implementation of IEqualityComparer<COutPoint>
CryptoManiac [Mon, 7 Sep 2015 14:49:52 +0000]
Calculation of ValueIn and nSigops, implementation of IEqualityComparer<COutPoint>

8 years agoRemove interfaces, split database objects into new file.
CryptoManiac [Mon, 7 Sep 2015 13:46:03 +0000]
Remove interfaces, split database objects into new file.

8 years agoSave best height, best hash and best trust.
CryptoManiac [Mon, 7 Sep 2015 12:06:46 +0000]
Save best height, best hash and best trust.

8 years agoAdd checkpoints file.
CryptoManiac [Mon, 7 Sep 2015 09:40:49 +0000]
Add checkpoints file.

8 years agoCheckpoints valudation, PoW reward calculation and continue working on block index.
CryptoManiac [Sun, 6 Sep 2015 22:24:14 +0000]
Checkpoints valudation, PoW reward calculation and continue working on block index.

8 years agoWorking on Reorganize implementation.
CryptoManiac [Sun, 6 Sep 2015 14:12:18 +0000]
Working on Reorganize implementation.

8 years agoFetchInputs
CryptoManiac [Sun, 6 Sep 2015 10:58:28 +0000]
FetchInputs

8 years agoBeginning of FetchInputs implementation.
CryptoManiac [Sun, 6 Sep 2015 00:49:33 +0000]
Beginning of FetchInputs implementation.

8 years agoBugfix
CryptoManiac [Sat, 5 Sep 2015 22:07:00 +0000]
Bugfix

8 years agoNewtonsoft.Json assembly reference.
CryptoManiac [Sat, 5 Sep 2015 17:17:10 +0000]
Newtonsoft.Json assembly reference.

8 years agoFew new structures to be used in the near future.
CryptoManiac [Sat, 5 Sep 2015 17:11:43 +0000]
Few new structures to be used in the near future.

8 years agoValueOut property.
CryptoManiac [Sat, 5 Sep 2015 13:42:24 +0000]
ValueOut property.

8 years agoStatic methods for output array serialization/deserialization.
CryptoManiac [Sat, 5 Sep 2015 13:39:32 +0000]
Static methods for output array serialization/deserialization.

8 years agoStatic methods for output array serialization and deserialization.
CryptoManiac [Sat, 5 Sep 2015 13:37:32 +0000]
Static methods for output array serialization and deserialization.

8 years agoFix integer overflow issue.
CryptoManiac [Fri, 4 Sep 2015 13:20:10 +0000]
Fix integer overflow issue.

8 years agoInitial implementation of stake modifier calculation.
CryptoManiac [Thu, 3 Sep 2015 22:06:46 +0000]
Initial implementation of stake modifier calculation.

Note that this functionality doesn't work properly yet.

8 years agoChain trust score computation.
CryptoManiac [Thu, 3 Sep 2015 19:59:58 +0000]
Chain trust score computation.

8 years agoStakeModifier: remove BigInteger dependency
CryptoManiac [Thu, 3 Sep 2015 18:41:01 +0000]
StakeModifier: remove BigInteger dependency

8 years agouint -> ulong
CryptoManiac [Thu, 3 Sep 2015 18:27:30 +0000]
uint -> ulong

8 years agoMultiplication operator for uint160/uint256.
CryptoManiac [Thu, 3 Sep 2015 18:18:56 +0000]
Multiplication operator for uint160/uint256.

8 years agouint160 and uint256 division operations.
CryptoManiac [Thu, 3 Sep 2015 17:03:14 +0000]
uint160 and uint256 division operations.

8 years agonChainChecksSwitchTime comstant.
CryptoManiac [Thu, 3 Sep 2015 15:52:30 +0000]
nChainChecksSwitchTime comstant.

8 years agouint256 division stub
CryptoManiac [Thu, 3 Sep 2015 14:58:07 +0000]
uint256 division stub

8 years agoImplementation of operator* for uint160 and uint256.
CryptoManiac [Thu, 3 Sep 2015 12:56:38 +0000]
Implementation of operator* for uint160 and uint256.

8 years agoAdd operator% for uint160 and uint256.
CryptoManiac [Thu, 3 Sep 2015 12:02:02 +0000]
Add operator% for uint160 and uint256.

8 years agooperator/ for uint160 and uint256
CryptoManiac [Thu, 3 Sep 2015 10:48:41 +0000]
operator/ for uint160 and uint256

8 years agoIsInMainChain property
CryptoManiac [Wed, 2 Sep 2015 22:49:35 +0000]
IsInMainChain property

8 years agoStakeModifier class.
CryptoManiac [Wed, 2 Sep 2015 22:38:02 +0000]
StakeModifier class.

Extremely experimental and not tested yet.

8 years agoFix
CryptoManiac [Wed, 2 Sep 2015 21:04:15 +0000]
Fix

8 years agoAdd new block cursor helper properties, start implementation of StakeModifier calcula...
CryptoManiac [Wed, 2 Sep 2015 20:39:08 +0000]
Add new block cursor helper properties, start implementation of StakeModifier calculation.

8 years agoAdd stake entropy bit generation.
CryptoManiac [Wed, 2 Sep 2015 17:40:26 +0000]
Add stake entropy bit generation.

8 years agoVerification of claimed Proof-of-Work.
CryptoManiac [Wed, 2 Sep 2015 16:47:59 +0000]
Verification of claimed Proof-of-Work.

8 years agoTypo.
CryptoManiac [Wed, 2 Sep 2015 16:21:46 +0000]
Typo.

8 years agoRemove Hash, Hash256, Hash160 and ScryptHash256 classes.
CryptoManiac [Wed, 2 Sep 2015 14:01:29 +0000]
Remove Hash, Hash256, Hash160 and ScryptHash256 classes.

8 years agoRemove RIPEMD160, SHA1 and SHA256 classes.
CryptoManiac [Wed, 2 Sep 2015 10:18:49 +0000]
Remove RIPEMD160, SHA1 and SHA256 classes.

8 years agoImprove CryptoUtils with wrappers for managed implementations of standard hashing...
CryptoManiac [Wed, 2 Sep 2015 10:16:29 +0000]
Improve CryptoUtils with wrappers for managed implementations of standard hashing functions.

8 years agoImplementation of IEquatable<base_uint> and IEqualityComparer<base_uint>, derive...
CryptoManiac [Wed, 2 Sep 2015 08:32:45 +0000]
Implementation of IEquatable<base_uint> and IEqualityComparer<base_uint>, derive KeyID and ScriptID form uint160.

8 years agoRedefine uint160.nWidth, uint160.pn, uint256.nWidth and uint256.pn as protected prope...
CryptoManiac [Wed, 2 Sep 2015 07:16:53 +0000]
Redefine uint160.nWidth, uint160.pn, uint256.nWidth and uint256.pn as protected properties to make the derivals easier.

8 years agoDescription fix.
CryptoManiac [Wed, 2 Sep 2015 06:03:43 +0000]
Description fix.

8 years agoAdd Compact property to uint256.
CryptoManiac [Tue, 1 Sep 2015 21:04:04 +0000]
Add Compact property to uint256.

8 years agoHACK: initialize base.nWidth to resolve comparison issues.
CryptoManiac [Tue, 1 Sep 2015 19:06:48 +0000]
HACK: initialize base.nWidth to resolve comparison issues.

8 years agoComplete implementation of uint256 and uint160 classes.
CryptoManiac [Tue, 1 Sep 2015 18:52:39 +0000]
Complete implementation of uint256 and uint160 classes.

8 years agoOverride Equals(object)
CryptoManiac [Tue, 1 Sep 2015 17:46:04 +0000]
Override Equals(object)

8 years agoOverload basic operations with base_uint class.
CryptoManiac [Tue, 1 Sep 2015 17:10:23 +0000]
Overload basic operations with base_uint class.

8 years agostubs for uint256/uint160
CryptoManiac [Tue, 1 Sep 2015 15:09:47 +0000]
stubs for uint256/uint160

8 years agoPreliminary block checkings.
CryptoManiac [Tue, 1 Sep 2015 10:27:06 +0000]
Preliminary block checkings.

8 years agonMaxSigOps constant.
CryptoManiac [Tue, 1 Sep 2015 08:48:13 +0000]
nMaxSigOps constant.

8 years agoYet another cosmetic change.
CryptoManiac [Tue, 1 Sep 2015 07:20:41 +0000]
Yet another cosmetic change.

8 years agoCosmetic changes.
CryptoManiac [Tue, 1 Sep 2015 07:12:42 +0000]
Cosmetic changes.

8 years agoReplace ByteQueue with its simplified version, InstructionQueue, since it's used...
CryptoManiac [Mon, 31 Aug 2015 23:00:37 +0000]
Replace ByteQueue with its simplified version, InstructionQueue, since it's used for scripts only.

Add new internal constructor for block header class.

8 years agoReplace CTransaction constructor with MemoryStream based implementation.
CryptoManiac [Mon, 31 Aug 2015 22:08:51 +0000]
Replace CTransaction constructor with MemoryStream based implementation.

8 years agoReadTxInList, ReadTxOutList and ReadTxList are internal now.
CryptoManiac [Mon, 31 Aug 2015 20:52:23 +0000]
ReadTxInList, ReadTxOutList and ReadTxList are internal now.

8 years agoCBlock: serialization
CryptoManiac [Mon, 31 Aug 2015 18:29:23 +0000]
CBlock: serialization

8 years agoFix serialization issue.
CryptoManiac [Mon, 31 Aug 2015 16:33:37 +0000]
Fix serialization issue.

8 years agoMerge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary
CryptoManiac [Mon, 31 Aug 2015 16:27:38 +0000]
Merge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary

Conflicts:
Novacoin/CBlockStore.cs

8 years agoTurn ByteQueue into MemoryStream wrapper, use MemoryStream for serialization of COutP...
CryptoManiac [Mon, 31 Aug 2015 16:24:53 +0000]
Turn ByteQueue into MemoryStream wrapper, use MemoryStream for serialization of COutPoint/CTxIn/CTxOut/CTransaction objects.

8 years agoDispose writable stream properly.
CryptoManiac [Mon, 31 Aug 2015 10:41:07 +0000]
Dispose writable stream properly.

8 years agoBlock serialization + copile error fixes.
CryptoManiac [Mon, 31 Aug 2015 09:02:40 +0000]
Block serialization + copile error fixes.

8 years agoBlock and transaction verifications
CryptoManiac [Mon, 31 Aug 2015 03:49:55 +0000]
Block and transaction verifications

There are still a lot of things labeled with TODO tag, though.

8 years agoCopy&paste typo fix
CryptoManiac [Sun, 30 Aug 2015 17:43:46 +0000]
Copy&paste typo fix

8 years agoMerge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary
CryptoManiac [Sun, 30 Aug 2015 17:42:00 +0000]
Merge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary

Conflicts:
Novacoin/CTransaction.cs

8 years agoTransaction script verification, unserealize exceptions
CryptoManiac [Sun, 30 Aug 2015 17:35:43 +0000]
Transaction script verification, unserealize exceptions

Also, very simple and ugly blockfile reader. Only consequent reading is supported for now.

8 years agoToInt64 -> ToUInt64
CryptoManiac [Sun, 30 Aug 2015 05:29:16 +0000]
ToInt64 -> ToUInt64

8 years agoUse ulong type for output value.
CryptoManiac [Sun, 30 Aug 2015 05:24:01 +0000]
Use ulong type for output value.

8 years agoBugfix: incorrect TxOffset calculation.
CryptoManiac [Sat, 29 Aug 2015 20:17:19 +0000]
Bugfix: incorrect TxOffset calculation.

8 years agoReplace if - throw checkings with contracts.
CryptoManiac [Sat, 29 Aug 2015 18:25:53 +0000]
Replace if - throw checkings with contracts.

Also, use TryGet() to get push data in GetOP().

8 years agoTryGet, TryGetCurrent
CryptoManiac [Sat, 29 Aug 2015 18:16:49 +0000]
TryGet, TryGetCurrent

8 years agoHash and CTransaction: remove pre-initialization of properties.
CryptoManiac [Sat, 29 Aug 2015 16:49:42 +0000]
Hash and CTransaction: remove pre-initialization of properties.

8 years agoScriptCode: fix stack depth precondition and add preproccessor directive checking...
CryptoManiac [Sat, 29 Aug 2015 16:46:46 +0000]
ScriptCode: fix stack depth precondition and add preproccessor directive checking to prevent such issues in the future.

8 years agoAdd SQLiteNetExtensions and its dependencies.
CryptoManiac [Fri, 28 Aug 2015 22:31:25 +0000]
Add SQLiteNetExtensions and its dependencies.

8 years agoImplementation of new Size property for CScript, CTxIn, CTxOut, CTransaction and...
CryptoManiac [Fri, 28 Aug 2015 22:28:26 +0000]
Implementation of new Size property for CScript, CTxIn, CTxOut, CTransaction and CBlock.

8 years agoVarInt: new GetEncodedSize() method
CryptoManiac [Fri, 28 Aug 2015 22:26:12 +0000]
VarInt: new GetEncodedSize() method

8 years agoCBlock: Fix null reference in copy constructor
CryptoManiac [Fri, 28 Aug 2015 17:31:35 +0000]
CBlock: Fix null reference in copy constructor

8 years agoRemove contracts from Hash.Equals, Hash.CompareTo and Hash.!=.
CryptoManiac [Fri, 28 Aug 2015 16:37:40 +0000]
Remove contracts from Hash.Equals, Hash.CompareTo and Hash.!=.

8 years agoDuplicate checking.
CryptoManiac [Fri, 28 Aug 2015 14:55:39 +0000]
Duplicate checking.

8 years agoHash:GetHashCode()
CryptoManiac [Fri, 28 Aug 2015 14:06:33 +0000]
Hash:GetHashCode()

Now it's necessary because we want to use hash as key for dictionary.