Commit graph

9412 commits

Author SHA1 Message Date
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
Steven Roose
621b52f80b Check parent RPC version on startup 2018-09-15 13:25:34 -07:00
Gregory Sanders
7bfb1001df expose CBlockIndex::nTx in getblock(header) 2018-09-15 13:25:20 -07:00
Jorge Timón
60efe08d94
Doc: RPC: Fix named arguments' documentation for importprivkey 2018-09-07 00:21:59 +02:00
Jorge Timón
cd1a9e2e89
Merge #362: 2WP: Allow other elements chains as parent chains for pegs
3f62b32 QA: Test 2wp using the test framework (Jorge Timón)
2de5765 2WP: QA: Introduce -con_parent_chain_signblockscript (Jorge Timón)
781953b QA: Optionally allow other chains (Jorge Timón)
2018-09-07 00:16:19 +02:00
Jorge Timón
2de576525b
2WP: QA: Introduce -con_parent_chain_signblockscript
This allows other elements chains as parent chains for pegs, for testing purposes

for now it also assumes that the parent chain has CT/CA tx format,
which is orthogonal to the parent chain having pow or signed blocks

It would be nice to also test bitcoin-like chains with signed blocks
instead of pow by adding another parameter -con_parent_chain_has_CT or
similar and decouple the logic

Introduce -con_parent_pegged_asset option to check the asset in the
peg-in txs from the parent chains.

CT: Introduce GetAmountFromParentChainPegin for CT txs
RPC: Adapt rpcwallet to initial -con_parent_chain_has_pow
Introduce CheckProofGeneric
Introduce pow::CheckProofParent
2018-08-16 19:29:23 +02:00
Gregory Sanders
bc2918d20a give hint on chain argument for -cli usage 2018-08-16 11:28:04 -04:00
Gregory Sanders
5a40e7d144 mainchainrpc* description fixes 2018-08-16 10:59:41 -04:00
Jorge Timón
a3b6ab088c
Merge #394: Explicit option for disabling 2wp
38dc2e7 Chainparams: Introduce -con_has_parent_chain option (Jorge Timón)
2018-07-22 07:50:12 +02:00
Jorge Timón
38dc2e71b6
Chainparams: Introduce -con_has_parent_chain option 2018-07-21 22:53:15 +02:00
wintercooled
10b9350334 Remove use of 'bitcoin' as hard coded default asset for sendtoaddress and sendmany. 2018-07-19 10:41:27 +01:00
wintercooled
82afeed34b Add ability to use listissuance with label as param. Plus tests. (amended for grammar) 2018-07-16 17:43:02 +01:00
wintercooled
92e3136336 Allow initial reissuance token count to be set via param 2018-07-12 18:52:23 +01:00
wintercooled
dd39cc4f80 Allow default asset name to be set via param 2018-07-12 18:51:49 +01:00
Jorge Timón
fb0494a577
RPC: Named arguments for signblock 2018-07-11 20:44:28 +02:00
Gregory Sanders
826621375d
Merge #391: subtract fee from reissuance token if token is fee asset during reiss…
72a7dd0 subtract fee from reissuance token if token is fee asset during reissuance (Gregory Sanders)
2018-07-11 13:50:18 -04:00
Gregory Sanders
72a7dd0704 subtract fee from reissuance token if token is fee asset during reissuance 2018-07-11 11:43:07 -04:00
Gregory Sanders
19b24da39d
Merge #386: NO-HF: Move block.proof.challenge to Consensus::Params::signblockscript
710df6d NO-HF: Move block.proof.challenge to Consensus::Params::signblockscript (Jorge Timón)
2018-07-11 10:48:20 -04:00
Gregory Sanders
13dda38880
Merge #388: Remove unused line giving a warning
8682dde Remove unused line giving a warning (Jorge Timón)
2018-07-11 09:32:35 -04:00
Jorge Timón
46263a11a0
RPC: Named arguments for combineblocksigs 2018-07-11 03:18:19 +02:00
Jorge Timón
8682ddec8e
Remove unused line giving a warning 2018-07-11 01:25:16 +02:00
Jorge Timón
710df6d4e8
NO-HF: Move block.proof.challenge to Consensus::Params::signblockscript
Since the scriptPubKey for signing blocks never changes, there's no
point reading repeating it from every block header.
2018-07-10 03:51:43 +02:00
Gregory Sanders
146a95724e
Merge #370: Refactor: Validation: Make parts of IsValidPeginWitness templated
a20986b 2WP: Refactor out GetAmountFromParentChainPegin (Jorge Timón)
2be9cae Refactor: Validation: Make parts of IsValidPeginWitness templated (Jorge Timón)
2018-06-25 20:28:34 -04:00
Gregory Sanders
b745444a19
Merge #355: Change initial issuance output to 1
1136ad3 Change initial issuance output to 1 (nkostoulas)
2018-06-25 09:22:41 -04:00
Mike
9bcfdd8c5c Port tweakfedpegscript from liquid
Port tweakfedpegscript from liquid
2018-06-21 13:11:12 -07:00
Jorge Timón
a20986b40d
2WP: Refactor out GetAmountFromParentChainPegin 2018-06-14 19:27:29 +02:00
Jorge Timón
2be9cae539
Refactor: Validation: Make parts of IsValidPeginWitness templated
this should not change behavior
2018-06-14 19:27:25 +02:00
nkostoulas
1136ad3a96 Change initial issuance output to 1 2018-06-14 09:46:10 +01:00
Jorge Timón
b857c43ce9
RPC: Signblock: Support signblock on rpc/blockchain
QA: Adapt rpc_blockchain tests to signed blocks
2018-06-13 04:31:17 +02:00
Jorge Timón
cdb79e9596
RPC: Stop providing useless fake pow data
QA: Adapt rpc_blockchain tests to not having pow
2018-06-13 04:31:12 +02:00
Gregory Sanders
e73265e202
Merge #367: allow all other base58 prefix things to be set by conf file
e8d416c allow all other base58 prefix things to be set by conf file (Gregory Sanders)
2018-06-06 09:59:23 -07:00
Gregory Sanders
e8d416c9c0 allow all other base58 prefix things to be set by conf file 2018-06-05 13:19:58 -07:00
Tim Ruffing
6f80bcedfe Remove redundant checks of size of range proof and surjection proof
The checks are redudant because too large range proofs and surjection
proofs will be rejected by libsecp256k1. Furthermore, the checks are not
precise, and they are anyway not present in other similar code locations.
2018-06-03 15:57:24 +02:00
Tim Ruffing
7ad4d950a4 Reject issuances with explicit values but non-empty range proofs 2018-06-03 15:57:24 +02:00
Gregory Sanders
3832e4ab79 allow setting parent chain address prefix in configuration file 2018-06-01 09:40:33 -04:00
Gregory Sanders
c5c6497967
Merge #350: Make block solutions more strictly validated
1348313 add basic functional tests for signed block rpcs and validation (Gregory Sanders)
c07b0af Add signature checking flag for when no sighash byte is expected (Gregory Sanders)
8f92b21 remove block (multi)signature malleability vectors (Gregory Sanders)
2018-05-30 10:36:31 -04:00
Gregory Sanders
884005be37
Merge #335: Fix range/surjection proof caching
4815bc6 simplify and speedup surjection proof caching (Gregory Sanders)
9572165 simplify rangeproof validation caching (Gregory Sanders)
92871c6 Actually cache range and surjection proofs (Gregory Sanders)
2018-05-30 10:35:12 -04:00
Gregory Sanders
1381c68e1b
Merge #359: Rework control flow in VerifyAmount()
05602ed Improve comments for VerifyAmount() (Tim Ruffing)
42b62ac Ensure that input witness is present before accessing range proofs (Tim Ruffing)
670229e Use new helper function to verify issuance of re-issuance tokens (Tim Ruffing)
d7abf18 Extract helper function from VerifyAmount() (Tim Ruffing)
e183868 Forbid explicit issuance of 0 asset units (Tim Ruffing)
bef2760 Assert return value of secp256k1_pedersen_commit() for issuances (Tim Ruffing)
46f2416 Remove old testing code (Tim Ruffing)
2018-05-29 13:19:23 -04:00
Tim Ruffing
b2a729c4a5 Remove overflow checks for explicit input amounts
This removes checks from the pre-asset era that reject amounts on the
input side of a transaction if these amounts overflow. The checks are
superficial because VerifyAmounts() already rejects input amounts that
could potentially overflow.

One of the removed checks is wrong because it rejects legitimate
transactions that spend more than MAX_MONEY asset units altogether,
even if those units belong to different assets. For example, a
transaction spending MAX_MONEY units of an asset "apple" and MAX_MONEY
units of an asset "orange" was previously rejected because the code
literally added apples and oranges in this case.
2018-05-25 18:51:48 +02:00
Tim Ruffing
05602edf6f Improve comments for VerifyAmount() 2018-05-24 22:17:51 +02:00
Tim Ruffing
42b62ac285 Ensure that input witness is present before accessing range proofs 2018-05-24 22:17:51 +02:00
Tim Ruffing
670229e060 Use new helper function to verify issuance of re-issuance tokens
This forbids the explicit issuance of 0 re-issuance tokens (like for the issuance of
normal assets. The proper way to issue no re-issuance tokens is to use a
null commitment for the amount.
2018-05-24 22:17:51 +02:00
Tim Ruffing
d7abf1870a Extract helper function from VerifyAmount() 2018-05-24 22:17:51 +02:00
Tim Ruffing
e183868516 Forbid explicit issuance of 0 asset units
The proper way to issue 0 units of an asset is a null commitment but not
an explicit commitment to 0.

This commit eliminates the issue that some checks in the verification of
the issuance of re-issuance tokes were skipped when issuing 0 asset units
explicitly. This commit also simplifies the control flow of the relevant
code locations.
2018-05-24 22:17:51 +02:00
Tim Ruffing
bef2760352 Assert return value of secp256k1_pedersen_commit() for issuances
secp256k1_pedersen_commit() is expected to succeed because the value and
the blinding factor are both 0.
2018-05-24 22:09:41 +02:00
Tim Ruffing
46f2416234 Remove old testing code 2018-05-24 22:09:31 +02:00
Andrew Poelstra
d8c8ac3200 update libsecp256k1-zkp to f1c601ed9d6c990a164305bf1b552952d16547da 2018-05-23 17:02:50 +00:00
Jorge Timón
bcb509cf0f
RPC: Introduce getblockstats 2018-05-16 00:52:17 +02:00
Jorge Timón
938b5090a0
Refactor: RPC: Separate GetBlockChecked() from getblock()
This does not change functionality
2018-05-16 00:52:16 +02:00
Gregory Sanders
b1fcfa341e don't allow anyonecanspends at gen to exist without wallet seeing 2018-05-11 10:30:08 -04:00