Commit graph

140 commits

Author SHA1 Message Date
Gregory Sanders
61c54913c9 fix undefined behavior in confidential commitment serialization 2018-09-25 19:57:36 -04:00
Steven Roose
85eb5026de 2WP: Verify number of transactions in SPV proof
Use the getblockheader RPC from Bitcoin Core to verify if the number of
transactions mentioned in the SPV proof matches the number for the
block known by the Core daemon.

Inspired by 6b9dc8ceae
2018-09-15 13:25:41 -07:00
Tim Ruffing
46f2416234 Remove old testing code 2018-05-24 22:09:31 +02:00
Gregory Sanders
16973cd1d2 add pegin_witness to witness inputs 2017-11-06 10:13:28 -05:00
Gregory Sanders
36b3ab1a22 add serialization flag support for peg-in inputs 2017-11-06 09:51:53 -05:00
Gregory Sanders
65ed777e6e remove legacy peg-in/withdrawlocks 2017-11-06 09:51:45 -05:00
tdudz
d3a48d59e3 changed elements serialization to new style with no marker 0x00 byte and witness data at the end 2017-10-08 11:36:05 -04:00
Arvid Norberg
3c21411c67 work towards bringing mininode.py up to date with the main node and towards re-enabling rpc tests 2017-09-19 12:19:12 +02:00
Tom Dudzik
e0df838f7f remove unnecessary code in IsFee() method 2017-08-24 11:17:56 +02:00
tdudz
15f31cfcac fix SetToAsset() bug where vchCommitment wasn't cleared before writing 2017-08-11 15:12:34 -07:00
Gregory Sanders
0723e05119 Change dust to policyAsset instead of BITCOINID 2017-06-16 12:02:35 -04:00
Gregory Sanders
7e12ebe802 Fees can never be dust 2017-06-16 12:02:35 -04:00
Gregory Sanders
28e1565796 assetBlindingNonce is never a blinding key, but blinding factor 2017-06-16 12:02:35 -04:00
Gregory Sanders
034273a9a9 Issuances are IsNull if both nAmount and nInflationKeys are 2017-06-16 12:02:35 -04:00
Gregory Sanders
7d45e74d47 Fix issuance serialization to disk 2017-06-16 12:02:35 -04:00
Mark Friedenbach
ced0decc8d CA: In debug log, make display of both CAssetIssuance::nAmount and CAssetIssuance::nInflationKeys optional and by keyword, as either one can be specified independent of the other 2017-06-16 12:02:35 -04:00
Mark Friedenbach
8ea5bedc29 CT/CA: Switch from "UNKNOWN" to "CONFIDENTIAL" in the debug logs, for clarity 2017-06-16 12:02:35 -04:00
Mark Friedenbach
60d53ca169 CA: Fix code comments 2017-06-16 12:02:35 -04:00
Mark Friedenbach
4c8f785185 [Hard-Fork] CT/CA: Put the asset surjection proof, value range proof, and issuance rangeproofs under the witness commitment 2017-06-16 12:02:34 -04:00
Mark Friedenbach
b7704f1717 Segwit: Rename CTransaction::GetWitnessHash() -> CTransaction::GetHashWithWitness() 2017-06-16 12:02:34 -04:00
Mark Friedenbach
6053519cea [Hard-Fork] CT: Move nNonce from the witness to the transaction format proper, so as to put it under the signature 2017-06-16 12:02:34 -04:00
Mark Friedenbach
5ced151f4b CA: Remove TODO note that has already been done 2017-06-16 12:02:34 -04:00
Mark Friedenbach
58c21ae15c CT: Turn CTxOut::vchNonceCommitment into a CConfidentialCommitment subclass
Note: This changes the serialization of the nonce commitment, from an arbitrary length vector to an either 1 (null) or 33 (commitment) byte fixed format.
2017-06-16 12:02:34 -04:00
Mark Friedenbach
a2c0f11f8e CT/CA: Unify CTxOutAsset and CTxOutValue into a single templated abstract base class 2017-06-16 12:02:34 -04:00
Mark Friedenbach
9ebe6371a1 CT: Move CTxOutValue::vchNonceCommitment into CTxOut 2017-06-16 12:02:34 -04:00
Mark Friedenbach
515bed6331 CT: Move CTxOutValue::vchRangeproof into CTxOut 2017-06-16 12:02:34 -04:00
Mark Friedenbach
2103355a30 CA: Move CTxOutAsset::vchSurjectionproof into CTxOut 2017-06-16 12:02:34 -04:00
Mark Friedenbach
690a403a6d CT: CTxOutValue::IsAmount() -> CTxOutValue::IsExplicit() 2017-06-16 12:02:34 -04:00
Mark Friedenbach
6d3406185f CA: CTxOutAsset::vchAssetTag -> CTxOutAsset::vchCommitment 2017-06-16 12:02:34 -04:00
Mark Friedenbach
37230ccc1b CA: CTxOutAsset::IsAsset() -> CTxOutAsset::IsExplicit() 2017-06-16 12:02:34 -04:00
Mark Friedenbach
b1d487d3e7 CA: CTxOutAsset::IsAssetCommitment() -> CTXOutAsset::IsCommitment() 2017-06-16 12:02:33 -04:00
Mark Friedenbach
fbee09383d CA: Remove unnecessary return statment after exception throw 2017-06-16 12:02:33 -04:00
Mark Friedenbach
21ecd834d7 CT: Remove residual code using the Elements alpha serialization prefixes 2017-06-16 12:02:33 -04:00
Mark Friedenbach
8e288cbb66 CA: Standardize prefixes so that value and asset commitments use the same constant values for null/empty and explicit values. 2017-06-16 12:02:33 -04:00
Mark Friedenbach
ba3926500f CA: Remove CAsset::ToString() as it is exactly identical in implementation to CAsset::GetHex(), and GetHex() more clearly matches up with the actual semantics. 2017-06-16 12:02:33 -04:00
Mark Friedenbach
8b2cb06617 CA: Switch CTxOutAsset::GetAssetID() to return a constant reference to the stored asset ID rather than perform unnecessary memory reallocation. 2017-06-16 12:02:33 -04:00
Mark Friedenbach
081b83229e CA: hashAssetIdentifier -> assetEntropy 2017-06-16 12:02:33 -04:00
Mark Friedenbach
a25f6c6e08 CA: CAssetID -> CAsset 2017-06-16 12:02:33 -04:00
Mark Friedenbach
892cb984ae CA: uint256 -> CAssetID 2017-06-16 12:02:33 -04:00
Mark Friedenbach
6a23fa3950 2WP: Remove residual traces of bitcoin serialization from src/primitives/transaction* 2017-06-16 12:02:33 -04:00
Mark Friedenbach
28c7d34f77 2WP: Separate mainchain and sidechain data structures into different classes, with the bitcoin data structures living in the src/primitives/bitcoin subdirectory. 2017-06-16 12:02:32 -04:00
Mark Friedenbach
fcfcfa7d09 CA: Handle serialization of CAssetIssuance on coinbases correctly. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
a26a684371 CA: Add constructor for CAssetIssuance. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
a6e610307e CA: Switch to inflation-only issuance, unifying CAssetGeneration and CAssetReissuance in the process, and making serialization simpler overall. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
17075960bc CA: Remove the issuance/reissuance vectors from CTransaction which are no longer used with the new serialization scheme. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
a6e9b224a5 CA: Add CAssetGeneration and CAssetReissuance fields with serialization 2017-06-16 12:02:17 -04:00
Mark Friedenbach
0061285e0f [Move Only] Move the output definitions before the input definitions, since the asset stuff in the inputs is going to reference some of the output declarations. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
bdc49c987f [Move Only] Put the asset definitions after COutPoint 2017-06-16 12:02:17 -04:00
Mark Friedenbach
f45ad32e01 [Move Only] Move CAssetGeneration and CAssetReissuance up above CTxIn because that is where they are going to be used. 2017-06-16 12:02:17 -04:00
Mark Friedenbach
0331fc28ec [Move Only] Move CTxOutValue to the top of the file since it will be used by the asset generation and reissuance classes. 2017-06-16 12:02:17 -04:00