0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-10 15:46:48 -04:00
bitcoin-core/src/script
Wladimir J. van der Laan b654723461
Merge #13557: BIP 174 PSBT Serializations and RPCs
020628e3a4 Tests for PSBT (Andrew Chow)
a4b06fb42e Create wallet RPCs for PSBT (Andrew Chow)
c27fe419ef Create utility RPCs for PSBT (Andrew Chow)
8b5ef27937 SignPSBTInput wrapper function (Andrew Chow)
58a8e28918 Refactor transaction creation and transaction funding logic (Andrew Chow)
e9d86a43ad Methods for interacting with PSBT structs (Andrew Chow)
12bcc64f27 Add pubkeys and whether input was witness to SignatureData (Andrew Chow)
41c607f09b Implement PSBT Structures and un/serialization methods per BIP 174 (Andrew Chow)

Pull request description:

  This Pull Request fully implements the [updated](https://github.com/bitcoin/bips/pull/694) BIP 174 specification. It is based upon #13425 which implements the majority of the signing logic.

  BIP 174 specifies a binary transaction format which contains the information necessary for a signer to produce signatures for the transaction and holds the signatures for an input while the input does not have a complete set of signatures.

  This PR contains structs for PSBT, serialization, and deserialzation code. Some changes to `SignatureData` have been made to support detection of UTXO type and storing public keys.

  ***

  Many RPCs have been added to handle PSBTs.

  `walletprocesspsbt` takes a PSBT format transaction, updates the PSBT with any inputs related to this wallet, signs, and finalizes the transaction. There is also an option to not sign and just update.

  `walletcreatefundedpsbt` creates a PSBT from user provided data in the same form as createrawtransaction. It also funds the transaction and takes an options argument in the same form as `fundrawtransaction`. The resulting PSBT is blank with no input or output data filled in. It is analogous to a combination of `createrawtransaction` and `fundrawtransaction`

  `decodepsbt` takes a PSBT and decodes it to JSON. It is analogous to `decoderawtransaction`

  `combinepsbt` takes multiple PSBTs for the same tx and combines them. It is analogous to `combinerawtransaction`

  `finalizepsbt` takes a PSBT and finalizes the inputs. If all inputs are final, it extracts the network serialized transaction and returns that instead of a PSBT unless instructed otherwise.

  `createpsbt` is like `createrawtransaction` but for PSBTs instead of raw transactions.

  `convertpsbt` takes a network serialized transaction and converts it into a psbt. The resulting psbt will lose all signature data and an explicit flag must be set to allow transactions with signature data to be converted.

  ***

  This supersedes #12136

Tree-SHA512: 1ac7a79e5bc669933f0a6fcc93ded55263fdde9e8c144a30266b13ef9f62aacf43edd4cbca1ffbe003090b067e9643c9298c79be69d7c1b10231b32acafb6338
2018-07-18 20:25:44 +02:00
..
bitcoinconsensus.cpp bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes 2018-07-13 22:13:10 +01:00
bitcoinconsensus.h Fix missing or inconsistent include guards 2018-03-22 16:23:04 +01:00
interpreter.cpp Generic TransactionSignatureCreator works with both CTransaction and CMutableTransaction 2018-05-30 16:01:36 +02:00
interpreter.h Generic TransactionSignatureCreator works with both CTransaction and CMutableTransaction 2018-05-30 16:01:36 +02:00
ismine.cpp Do not expose invalidity from IsMine 2018-06-17 16:28:04 -07:00
ismine.h Do not expose invalidity from IsMine 2018-06-17 16:28:04 -07:00
script.cpp Remove template matching and pseudo opcodes 2018-05-29 14:40:18 -07:00
script.h Remove template matching and pseudo opcodes 2018-05-29 14:40:18 -07:00
script_error.cpp Add constant scriptCode policy in non-segwit scripts 2018-05-05 04:26:12 +08:00
script_error.h Add constant scriptCode policy in non-segwit scripts 2018-05-05 04:26:12 +08:00
sigcache.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sigcache.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sign.cpp Create wallet RPCs for PSBT 2018-07-16 16:08:24 -07:00
sign.h Create wallet RPCs for PSBT 2018-07-16 16:08:24 -07:00
standard.cpp Add P2WSH destination helper and use it instead of manual hashing 2018-06-17 19:44:50 -07:00
standard.h Add P2WSH destination helper and use it instead of manual hashing 2018-06-17 19:44:50 -07:00