Commit graph

584 commits

Author SHA1 Message Date
Andrew Chow
cf870ed8d0 rpc: Implement decodepsbt for issuance needs blinded flag 2022-09-06 11:41:02 -04:00
Andrew Chow
4bacc852e9 rpc: Add input explicit value, asset, and proofs to decodepsbt 2022-09-06 11:38:01 -04:00
Jon Griffiths
e319fe0a9a
PSET: Add a parsepsbt RPC command to parse and dump a given PSBT
I found this useful for for creating test cases and checking validity.
In the event that alternative implementations do not aim for exact
serilization compatibility, this RPC can be used to validate and
re-serialize their output for testing.
2022-08-09 09:36:02 +12:00
Glenn Willen
c2aaa7cada Merge 9cc56b87fb into merged_master (Elements PR ElementsProject/elements#1070) 2022-04-20 20:08:44 -07:00
Glenn Willen
e72544da90 Mark pegin-related args to createrawtransaction as optional. 2021-11-17 17:02:14 -08:00
Andrew Poelstra
daa471ddd2 Merge 4c7dc0620a into merged_master (Elements PR ElementsProject/elements#1046) 2021-09-22 02:26:13 +00:00
Andrew Poelstra
03b835c887 PSET: output warnings in decodepsbt and analyzepsbt about blinding status 2021-09-21 21:59:16 +00:00
Andrew Poelstra
edac5081f4 Merge 1240172eaa into merged_master (Elements PR ElementsProject/elements#1038)
Surprisingly the only conflicts were converting nullopts
2021-09-18 02:10:36 +00:00
Andrew Poelstra
7ba9f416d7 Merge e88f0b7045 into merged_master (Elements PR ElementsProject/elements#1034) 2021-09-18 00:04:33 +00:00
Andrew Chow
3ac7e78a84 pset, rpc: Better error messages for imbalance failure conditions
Instead of not failing and silently allowing bad PSETs to be created,
provide error messages that explain why the operation the user did was
wrong. Specifically for combining PSETs such that they would become
fully blinded but have imbalanced values and blinders, and for blinding
a PSET when the wallet has a blind input but no outputs to blind (would
result in an imbalance).
2021-09-13 18:36:38 -04:00
Andrew Chow
f9f084f785 pset: Add missing fields to merging and fix combinepsbt
* Add some fields that were missing in PSBTInput::Merge and PSBTOutput::Merge
* Remove incorrect check that explicit values and assets aren't present
  when blinded
* Fix bug in combinepsbt where the condition was inverted
2021-09-11 20:58:40 -04:00
Andrew Chow
59f65a3f73 rpc, pset: Include blinded value and asset proofs in decodepsbt 2021-09-11 20:58:40 -04:00
Andrew Poelstra
88edb9f9ff rpc: correct type in calculateasset 2021-09-05 22:53:31 +00:00
Andrew Poelstra
b4369c06a2 rpc: change walletprocesspsbt help text to match upstream 2021-09-05 22:52:16 +00:00
Andrew Poelstra
36e5e2a7f1 Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900)
Surprisingly easy to do. Almost all of the diff resolution was mechanically
  * replacing boost::variant with std::variant
  * replacing Optional with std::optional
     * then replacing `nullopt` with `std::nullopt`
  * updating the RPC functions for the new RPCArg::Default type
  * update the tests/ directory to make new (since 22) tests use arrays for
    createrawtransaction outputs
  * other ad-hoc changes to function parameters etc (not too many of these)

I had to "really" change the code in PrecomputePSBTData, which was introduced
in 22.0 and affected by PSET, but this function was like 8 lines long so it
was easy.

Reviewing the diff may be a bit difficult because of the mix of mechanical
changes and ad-hoc things. Probably the most straightforward thing to do
is to redo the merge, `sed -i` to fix the boost::variant and Optional stuff,
then diff the remaining conflicts against this commit.

TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
in documentation and help text even though it was deleted. Need to fix this
in 0.21 in a separate PR.
2021-09-04 19:34:14 +00:00
Andrew Poelstra
6fe7938521 Merge 839f5d06d6 into merged_master (Bitcoin PR bitcoin/bitcoin#22432) 2021-07-31 20:32:02 +00:00
Andrew Poelstra
0afcb6d978 Merge 5c2e2afe99 into merged_master (Bitcoin PR bitcoin/bitcoin#21365)
This introduces Taproot wallet support. I fixed all the merge conflicts
and ensured that the tests pass, but this is still using the old sighash
(before Russell/Sanket/I redid it) so is not actually production ready.
Will be fixed when we bring Elements #1002 in.
2021-08-03 20:43:53 +00:00
Andrew Poelstra
34da23bd1a Merge a55904a80c into merged_master (Bitcoin PR bitcoin/bitcoin#21866)
Paying the piper for some lazy use of globals, including ones I added
in 8e770d3f21

Had to add another couple methods to interfaces::Chain
2021-07-29 13:18:11 +00:00
Andrew Poelstra
b413362d11 Merge ef8f2966ac into merged_master (Bitcoin PR bitcoin/bitcoin#22084) 2021-07-24 01:43:31 +00:00
Andrew Poelstra
8a669eccfb Merge 7257e50dba into merged_master (Bitcoin PR bitcoin/bitcoin#20833) 2021-07-18 18:11:25 +00:00
glozow
9169be09f4 fix incorrect testmempoolaccept doc 2021-07-12 10:57:52 +01:00
Andrew Poelstra
a9a2cc0c10 Merge ea8b2e8e12 into merged_master (Bitcoin PR bitcoin/bitcoin#21913) 2021-07-11 16:14:30 +00:00
Andrew Poelstra
3402d0aa23 Merge 94f83534e4 into merged_master (Bitcoin PR bitcoin/bitcoin#21752) 2021-07-09 03:24:22 +00:00
Andrew Poelstra
c40a9ecf0f Merge 2a22d903f3 into merged_master (Bitcoin PR bitcoin/bitcoin#21897) 2021-07-08 00:27:49 +00:00
Andrew Poelstra
b9a6573841 Merge d4300a10dd into merged_master (Bitcoin PR #21679) 2021-06-30 20:52:10 +00:00
Andrew Poelstra
13aa8af68b Merge 0dd7b23489 into merged_master (Bitcoin PR #21391) 2021-06-30 19:20:29 +00:00
Andrew Poelstra
a9ef79acbc Merge 1f14130cb0 into merged_master (Bitcoin PR #21575) 2021-06-30 03:43:01 +00:00
Andrew Poelstra
d39d57c704 Merge 1c7be9ab90 into merged_master (Bitcoin PR #20286)
I hate this PR.
2021-06-28 21:30:17 +00:00
Andrew Poelstra
26fd4eb181 Merge a9d1b40d53 into merged_master (Bitcoin PR #21415) 2021-06-27 15:02:35 +00:00
Andrew Poelstra
4268df69bc Merge 828bb776d2 into merged_master (Bitcoin PR #20750) 2021-06-24 17:22:15 +00:00
Andrew Poelstra
f250da483b Merge 8e1913ae02 into merged_master (Bitcoin PR #21062) 2021-06-22 22:39:50 +00:00
Andrew Chow
f8553c571b Disable joinpsbts
It doesn't work, disable for now.
2021-06-22 14:42:38 -04:00
Andrew Chow
5425da4278 Enable converttopsbt for PSET 2021-06-22 14:42:38 -04:00
Andrew Chow
9fe6401d59 Allow specifying SIGHASH_RANGEPROOF 2021-06-22 14:42:38 -04:00
Andrew Chow
64b30bfc3d Enable analyzepsbt 2021-06-22 14:42:38 -04:00
Andrew Chow
46ccf611c4 Only allow psbt_version 2 2021-06-22 14:42:38 -04:00
Andrew Chow
b1ebc813ea Remove walletsignpsbt, blindpsbt, walletblindpsbt, and
walletfillpsbtdata

These are all done by walletprocesspsbt
2021-06-22 14:42:38 -04:00
Andrew Chow
e9bfff25db Allow empty scriptPubKeys 2021-06-22 14:42:19 -04:00
Andrew Chow
5391095205 Output PSBTOutputs with aux info from ConstructTransaction
Output PSBTOutputs with blinding pubkey and index info from
ConstructTransaction so that these can be added to PSBTs later.
2021-06-22 14:42:19 -04:00
Andrew Chow
ea2c3dfb20 Remove output_assets and have asset field in outputs
Instead of having an output_assets argument to createpsbt,
createrawtransaction, and walletcreatefundedpsbt, move the asset
specification into the outputs array itself. This also removes the
backwards compatibility of using a dict for outputs in createrawtransaction.
2021-06-22 14:42:19 -04:00
Andrew Chow
1dbc3b270c Implement updatepsbtpegin RPC 2021-06-22 14:42:18 -04:00
Andrew Chow
bdfcb436b7 Add calculateasset RPC 2021-06-22 14:41:44 -04:00
Andrew Chow
79c4a9901b pset: add issuance things
The asset issuance details are added to createpsbt and
walletcreatefundedpsbt.
2021-06-22 13:54:50 -04:00
Andrew Chow
6890461bfe Implement blinded combiner stuff 2021-06-22 13:54:50 -04:00
Andrew Chow
e37439775a Implement and enable decodepsbt for PSET 2021-06-22 13:54:50 -04:00
Andrew Chow
f4bca18784 Restrict joinpsbts to PSBTv0 only 2021-06-22 13:54:50 -04:00
Andrew Chow
ebc49e3111 Allow createpsbt and walletcreatefundedpsbt to take psbt version 2021-06-22 13:54:50 -04:00
Andrew Chow
2c1fe5841f Allow and create PSBTv2 in RPCs 2021-06-22 13:54:50 -04:00
Andrew Chow
bedc1e0fec Implement PSBTv2 in decodepsbt 2021-06-22 13:54:50 -04:00
Andrew Chow
9c8330024a Update RPCs for PSBTv2 2021-06-22 13:54:50 -04:00