Commit graph

29954 commits

Author SHA1 Message Date
Andrew Chow
b65a00f095 Add PSBTOutput::GetTxOut()
Helper function for getting a CTxOut for a PSBTOutput
2021-06-22 14:42:38 -04:00
Andrew Chow
80ff739c7a Default to adding bip32 derivs 2021-06-22 14:42:38 -04:00
Andrew Chow
1889554e2c Remove unnecessary psbt blinding test
This test is for a condition that no longer matters. Prior to CA, there
was only the single value blinder for a transaction that sent unconf to
conf. This would necessitate setting that single blinding factor to 0,
which would make the single output not actually blinded. But with CA,
because each output has an additional blinding factor for the asset,
this issue no longer exists.
2021-06-22 14:42:38 -04:00
Andrew Chow
afd795010b Update rpc_psbt.py for PSET 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
d8fa5c1458 Use createtx array outputs 2021-06-22 14:42:19 -04:00
Andrew Chow
0e2f1ff441 Make m_peg_in_witness during SignPSBTInput 2021-06-22 14:42:19 -04:00
Andrew Chow
bd97836767 Update FinalizeAndExtract for PSEt 2021-06-22 14:42:19 -04:00
Andrew Chow
c0cb623acc Allow value commitments instead of explicit value
It is not invalid to have a value commitment and no explicit value. It
is only invalid to have neither for an output.
2021-06-22 14:42:19 -04:00
Andrew Chow
2c0cee5a20 Update GetUnsignedTx for PSET 2021-06-22 14:42:19 -04:00
Andrew Chow
25df8aa12b Fixes to FillPSBT 2021-06-22 14:42:19 -04:00
Andrew Chow
e9bfff25db Allow empty scriptPubKeys 2021-06-22 14:42:19 -04:00
Andrew Chow
eeb6cf76e4 Mark PSET as being implemented 2021-06-22 14:42:19 -04:00
Andrew Chow
3db2622e70 Only sign blinded PSBTs in walletprocesspsbt 2021-06-22 14:42:19 -04:00
Andrew Chow
a8a6f4c999 Add IsBlinded and IsFullyBlinded helpers for PSBT 2021-06-22 14:42:19 -04:00
Andrew Chow
124efa2668 Return better errors for BlindingStatus 2021-06-22 14:42:19 -04:00
Andrew Chow
f686e0fa54 Remove walletfillpsbtdata RPC 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
e6cc0fd693 Have walletprocesspsbt blind before signing 2021-06-22 14:42:19 -04:00
Andrew Chow
bad1876e03 Re-enable and fix PSBT signing 2021-06-22 14:42:19 -04:00
Andrew Chow
9a450ecc19 Set blinder_index to self in walletcreatefundedpsbt 2021-06-22 14:42:19 -04:00
Andrew Chow
3f6c8bfda1 Add walletblindpsbt rpc 2021-06-22 14:42:19 -04:00
Andrew Chow
e7dd046b03 Implement BlindPSBT 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
2220d844ef Return peg-in UTXO with GetUTXO
Peg-ins don't have a typical UTXO. Instead we can get a "UTXO" using the
peg-in data.
2021-06-22 13:54:50 -04:00
Andrew Chow
33c694f822 Helper functions to determine whether a PSBTOutput is blinded 2021-06-22 13:54:50 -04:00
Andrew Chow
ee28be3018 Extract elements fields for tx into psbt 2021-06-22 13:54:50 -04:00
Andrew Chow
f84a927a71 Add DecomposePeginWitness 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
b372430f70 Implement PSET fields and their de/ser 2021-06-22 13:54:50 -04:00
Andrew Chow
ecaf5ea1cf Use GetUnsignedTx when serializing in PSBTv0
If we are asked to make a PSBTv0, we may not necessarily have made an
unsigned transaction. So instead use GetUnsignedTx which will either
fetch one that already exists, or construct a new one from the stored
data. Internally we may be storing a PSBTv0 like a PSBTv2, but still
want to serialize those as v0.
2021-06-22 13:54:50 -04:00
Andrew Chow
e860cd0f42 Add a PSBT constructor for providing the version 2021-06-22 13:54:50 -04:00
Andrew Chow
0ca0b7e040 Update rpc_psbt.py to test PSBTv0 explicitly in some places 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
e467ec68ad Update PSBT::UpdatePSBTOutput to use GetUnsignedTx 2021-06-22 13:54:50 -04:00
Andrew Chow
a34474e25a Allow specifying PSBT version in constructor 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
139ac3613e Implement PSBTv2 AddInput and AddOutput 2021-06-22 13:54:50 -04:00
Andrew Chow
16395c15e9 Update wallet for PSBTv2 2021-06-22 13:54:50 -04:00
Andrew Chow
9c8330024a Update RPCs for PSBTv2 2021-06-22 13:54:50 -04:00
Andrew Chow
c9c23cad6b Update PSBT Operations Dialog for v2 2021-06-22 13:54:50 -04:00
Andrew Chow
500554acbe Update AnalyzePSBT for PSBTv2 2021-06-22 13:54:50 -04:00
Andrew Chow
f269d1170c Update FinalizeAndExtract for v2 2021-06-22 13:54:50 -04:00