Bitcoin Core  22.99.0
P2P Digital Currency
psbt.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <psbt.h>
6 
7 #include <util/check.h>
8 #include <util/strencodings.h>
9 
10 
12 {
13  inputs.resize(tx.vin.size());
14  outputs.resize(tx.vout.size());
15 }
16 
18 {
19  return !tx && inputs.empty() && outputs.empty() && unknown.empty();
20 }
21 
23 {
24  // Prohibited to merge two PSBTs over different transactions
25  if (tx->GetHash() != psbt.tx->GetHash()) {
26  return false;
27  }
28 
29  for (unsigned int i = 0; i < inputs.size(); ++i) {
30  inputs[i].Merge(psbt.inputs[i]);
31  }
32  for (unsigned int i = 0; i < outputs.size(); ++i) {
33  outputs[i].Merge(psbt.outputs[i]);
34  }
35  unknown.insert(psbt.unknown.begin(), psbt.unknown.end());
36 
37  return true;
38 }
39 
41 {
42  if (std::find(tx->vin.begin(), tx->vin.end(), txin) != tx->vin.end()) {
43  return false;
44  }
45  tx->vin.push_back(txin);
46  psbtin.partial_sigs.clear();
47  psbtin.final_script_sig.clear();
49  inputs.push_back(psbtin);
50  return true;
51 }
52 
53 bool PartiallySignedTransaction::AddOutput(const CTxOut& txout, const PSBTOutput& psbtout)
54 {
55  tx->vout.push_back(txout);
56  outputs.push_back(psbtout);
57  return true;
58 }
59 
60 bool PartiallySignedTransaction::GetInputUTXO(CTxOut& utxo, int input_index) const
61 {
62  const PSBTInput& input = inputs[input_index];
63  uint32_t prevout_index = tx->vin[input_index].prevout.n;
64  if (input.non_witness_utxo) {
65  if (prevout_index >= input.non_witness_utxo->vout.size()) {
66  return false;
67  }
68  if (input.non_witness_utxo->GetHash() != tx->vin[input_index].prevout.hash) {
69  return false;
70  }
71  utxo = input.non_witness_utxo->vout[prevout_index];
72  } else if (!input.witness_utxo.IsNull()) {
73  utxo = input.witness_utxo;
74  } else {
75  return false;
76  }
77  return true;
78 }
79 
80 bool PSBTInput::IsNull() const
81 {
82  return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
83 }
84 
86 {
87  if (!final_script_sig.empty()) {
88  sigdata.scriptSig = final_script_sig;
89  sigdata.complete = true;
90  }
93  sigdata.complete = true;
94  }
95  if (sigdata.complete) {
96  return;
97  }
98 
99  sigdata.signatures.insert(partial_sigs.begin(), partial_sigs.end());
100  if (!redeem_script.empty()) {
101  sigdata.redeem_script = redeem_script;
102  }
103  if (!witness_script.empty()) {
104  sigdata.witness_script = witness_script;
105  }
106  for (const auto& key_pair : hd_keypaths) {
107  sigdata.misc_pubkeys.emplace(key_pair.first.GetID(), key_pair);
108  }
109 }
110 
112 {
113  if (sigdata.complete) {
114  partial_sigs.clear();
115  hd_keypaths.clear();
118 
119  if (!sigdata.scriptSig.empty()) {
120  final_script_sig = sigdata.scriptSig;
121  }
122  if (!sigdata.scriptWitness.IsNull()) {
124  }
125  return;
126  }
127 
128  partial_sigs.insert(sigdata.signatures.begin(), sigdata.signatures.end());
129  if (redeem_script.empty() && !sigdata.redeem_script.empty()) {
130  redeem_script = sigdata.redeem_script;
131  }
132  if (witness_script.empty() && !sigdata.witness_script.empty()) {
133  witness_script = sigdata.witness_script;
134  }
135  for (const auto& entry : sigdata.misc_pubkeys) {
136  hd_keypaths.emplace(entry.second);
137  }
138 }
139 
140 void PSBTInput::Merge(const PSBTInput& input)
141 {
143  if (witness_utxo.IsNull() && !input.witness_utxo.IsNull()) {
144  // TODO: For segwit v1, we will want to clear out the non-witness utxo when setting a witness one. For v0 and non-segwit, this is not safe
145  witness_utxo = input.witness_utxo;
146  }
147 
148  partial_sigs.insert(input.partial_sigs.begin(), input.partial_sigs.end());
149  hd_keypaths.insert(input.hd_keypaths.begin(), input.hd_keypaths.end());
150  unknown.insert(input.unknown.begin(), input.unknown.end());
151 
156 }
157 
159 {
160  if (!redeem_script.empty()) {
161  sigdata.redeem_script = redeem_script;
162  }
163  if (!witness_script.empty()) {
164  sigdata.witness_script = witness_script;
165  }
166  for (const auto& key_pair : hd_keypaths) {
167  sigdata.misc_pubkeys.emplace(key_pair.first.GetID(), key_pair);
168  }
169 }
170 
172 {
173  if (redeem_script.empty() && !sigdata.redeem_script.empty()) {
174  redeem_script = sigdata.redeem_script;
175  }
176  if (witness_script.empty() && !sigdata.witness_script.empty()) {
177  witness_script = sigdata.witness_script;
178  }
179  for (const auto& entry : sigdata.misc_pubkeys) {
180  hd_keypaths.emplace(entry.second);
181  }
182 }
183 
184 bool PSBTOutput::IsNull() const
185 {
186  return redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
187 }
188 
189 void PSBTOutput::Merge(const PSBTOutput& output)
190 {
191  hd_keypaths.insert(output.hd_keypaths.begin(), output.hd_keypaths.end());
192  unknown.insert(output.unknown.begin(), output.unknown.end());
193 
194  if (redeem_script.empty() && !output.redeem_script.empty()) redeem_script = output.redeem_script;
196 }
197 bool PSBTInputSigned(const PSBTInput& input)
198 {
199  return !input.final_script_sig.empty() || !input.final_script_witness.IsNull();
200 }
201 
203  size_t count = 0;
204  for (const auto& input : psbt.inputs) {
205  if (!PSBTInputSigned(input)) {
206  count++;
207  }
208  }
209 
210  return count;
211 }
212 
213 void UpdatePSBTOutput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index)
214 {
215  CMutableTransaction& tx = *Assert(psbt.tx);
216  const CTxOut& out = tx.vout.at(index);
217  PSBTOutput& psbt_out = psbt.outputs.at(index);
218 
219  // Fill a SignatureData with output info
220  SignatureData sigdata;
221  psbt_out.FillSignatureData(sigdata);
222 
223  // Construct a would-be spend of this output, to update sigdata with.
224  // Note that ProduceSignature is used to fill in metadata (not actual signatures),
225  // so provider does not need to provide any private keys (it can be a HidingSigningProvider).
226  MutableTransactionSignatureCreator creator(&tx, /*input_idx=*/0, out.nValue, SIGHASH_ALL);
227  ProduceSignature(provider, creator, out.scriptPubKey, sigdata);
228 
229  // Put redeem_script, witness_script, key paths, into PSBTOutput.
230  psbt_out.FromSignatureData(sigdata);
231 }
232 
234 {
235  const CMutableTransaction& tx = *psbt.tx;
236  bool have_all_spent_outputs = true;
237  std::vector<CTxOut> utxos(tx.vin.size());
238  for (size_t idx = 0; idx < tx.vin.size(); ++idx) {
239  if (!psbt.GetInputUTXO(utxos[idx], idx)) have_all_spent_outputs = false;
240  }
242  if (have_all_spent_outputs) {
243  txdata.Init(tx, std::move(utxos), true);
244  } else {
245  txdata.Init(tx, {}, true);
246  }
247  return txdata;
248 }
249 
250 bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, const PrecomputedTransactionData* txdata, int sighash, SignatureData* out_sigdata, bool finalize)
251 {
252  PSBTInput& input = psbt.inputs.at(index);
253  const CMutableTransaction& tx = *psbt.tx;
254 
255  if (PSBTInputSigned(input)) {
256  return true;
257  }
258 
259  // Fill SignatureData with input info
260  SignatureData sigdata;
261  input.FillSignatureData(sigdata);
262 
263  // Get UTXO
264  bool require_witness_sig = false;
265  CTxOut utxo;
266 
267  if (input.non_witness_utxo) {
268  // If we're taking our information from a non-witness UTXO, verify that it matches the prevout.
269  COutPoint prevout = tx.vin[index].prevout;
270  if (prevout.n >= input.non_witness_utxo->vout.size()) {
271  return false;
272  }
273  if (input.non_witness_utxo->GetHash() != prevout.hash) {
274  return false;
275  }
276  utxo = input.non_witness_utxo->vout[prevout.n];
277  } else if (!input.witness_utxo.IsNull()) {
278  utxo = input.witness_utxo;
279  // When we're taking our information from a witness UTXO, we can't verify it is actually data from
280  // the output being spent. This is safe in case a witness signature is produced (which includes this
281  // information directly in the hash), but not for non-witness signatures. Remember that we require
282  // a witness signature in this situation.
283  require_witness_sig = true;
284  } else {
285  return false;
286  }
287 
288  sigdata.witness = false;
289  bool sig_complete;
290  if (txdata == nullptr) {
291  sig_complete = ProduceSignature(provider, DUMMY_SIGNATURE_CREATOR, utxo.scriptPubKey, sigdata);
292  } else {
293  MutableTransactionSignatureCreator creator(&tx, index, utxo.nValue, txdata, sighash);
294  sig_complete = ProduceSignature(provider, creator, utxo.scriptPubKey, sigdata);
295  }
296  // Verify that a witness signature was produced in case one was required.
297  if (require_witness_sig && !sigdata.witness) return false;
298 
299  // If we are not finalizing, set sigdata.complete to false to not set the scriptWitness
300  if (!finalize && sigdata.complete) sigdata.complete = false;
301 
302  input.FromSignatureData(sigdata);
303 
304  // If we have a witness signature, put a witness UTXO.
305  // TODO: For segwit v1, we should remove the non_witness_utxo
306  if (sigdata.witness) {
307  input.witness_utxo = utxo;
308  // input.non_witness_utxo = nullptr;
309  }
310 
311  // Fill in the missing info
312  if (out_sigdata) {
313  out_sigdata->missing_pubkeys = sigdata.missing_pubkeys;
314  out_sigdata->missing_sigs = sigdata.missing_sigs;
315  out_sigdata->missing_redeem_script = sigdata.missing_redeem_script;
316  out_sigdata->missing_witness_script = sigdata.missing_witness_script;
317  }
318 
319  return sig_complete;
320 }
321 
323 {
324  // Finalize input signatures -- in case we have partial signatures that add up to a complete
325  // signature, but have not combined them yet (e.g. because the combiner that created this
326  // PartiallySignedTransaction did not understand them), this will combine them into a final
327  // script.
328  bool complete = true;
329  const PrecomputedTransactionData txdata = PrecomputePSBTData(psbtx);
330  for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
331  complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, SIGHASH_ALL, nullptr, true);
332  }
333 
334  return complete;
335 }
336 
338 {
339  // It's not safe to extract a PSBT that isn't finalized, and there's no easy way to check
340  // whether a PSBT is finalized without finalizing it, so we just do this.
341  if (!FinalizePSBT(psbtx)) {
342  return false;
343  }
344 
345  result = *psbtx.tx;
346  for (unsigned int i = 0; i < result.vin.size(); ++i) {
347  result.vin[i].scriptSig = psbtx.inputs[i].final_script_sig;
348  result.vin[i].scriptWitness = psbtx.inputs[i].final_script_witness;
349  }
350  return true;
351 }
352 
353 TransactionError CombinePSBTs(PartiallySignedTransaction& out, const std::vector<PartiallySignedTransaction>& psbtxs)
354 {
355  out = psbtxs[0]; // Copy the first one
356 
357  // Merge
358  for (auto it = std::next(psbtxs.begin()); it != psbtxs.end(); ++it) {
359  if (!out.Merge(*it)) {
361  }
362  }
363  return TransactionError::OK;
364 }
365 
366 std::string PSBTRoleName(PSBTRole role) {
367  switch (role) {
368  case PSBTRole::CREATOR: return "creator";
369  case PSBTRole::UPDATER: return "updater";
370  case PSBTRole::SIGNER: return "signer";
371  case PSBTRole::FINALIZER: return "finalizer";
372  case PSBTRole::EXTRACTOR: return "extractor";
373  // no default case, so the compiler can warn about missing cases
374  }
375  assert(false);
376 }
377 
378 bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error)
379 {
380  bool invalid;
381  std::string tx_data = DecodeBase64(base64_tx, &invalid);
382  if (invalid) {
383  error = "invalid base64";
384  return false;
385  }
386  return DecodeRawPSBT(psbt, tx_data, error);
387 }
388 
389 bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error)
390 {
392  try {
393  ss_data >> psbt;
394  if (!ss_data.empty()) {
395  error = "extra data after PSBT";
396  return false;
397  }
398  } catch (const std::exception& e) {
399  error = e.what();
400  return false;
401  }
402  return true;
403 }
CTxIn
An input of a transaction.
Definition: transaction.h:65
CMutableTransaction::vin
std::vector< CTxIn > vin
Definition: transaction.h:346
CScriptWitness::IsNull
bool IsNull() const
Definition: script.h:566
CombinePSBTs
TransactionError CombinePSBTs(PartiallySignedTransaction &out, const std::vector< PartiallySignedTransaction > &psbtxs)
Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial sign...
Definition: psbt.cpp:353
FinalizePSBT
bool FinalizePSBT(PartiallySignedTransaction &psbtx)
Finalizes a PSBT if possible, combining partial signatures.
Definition: psbt.cpp:322
PSBTInput::non_witness_utxo
CTransactionRef non_witness_utxo
Definition: psbt.h:51
PSBTInput::partial_sigs
std::map< CKeyID, SigPair > partial_sigs
Definition: psbt.h:58
count
static int count
Definition: tests.c:41
assert
assert(!tx.IsCoinBase())
SignatureData::missing_redeem_script
uint160 missing_redeem_script
ScriptID of the missing redeemScript (if any)
Definition: sign.h:79
SignPSBTInput
bool SignPSBTInput(const SigningProvider &provider, PartiallySignedTransaction &psbt, int index, const PrecomputedTransactionData *txdata, int sighash, SignatureData *out_sigdata, bool finalize)
Signs a PSBTInput, verifying that all provided data matches what is being signed.
Definition: psbt.cpp:250
check.h
SignatureData::scriptWitness
CScriptWitness scriptWitness
The scriptWitness of an input. Contains complete signatures or the traditional partial signatures for...
Definition: sign.h:71
DUMMY_SIGNATURE_CREATOR
const BaseSignatureCreator & DUMMY_SIGNATURE_CREATOR
A signature creator that just produces 71-byte empty signatures.
Definition: sign.cpp:579
MakeUCharSpan
constexpr auto MakeUCharSpan(V &&v) -> decltype(UCharSpanCast(MakeSpan(std::forward< V >(v))))
Like MakeSpan, but for (const) unsigned char member types only.
Definition: span.h:278
PartiallySignedTransaction::IsNull
bool IsNull() const
Definition: psbt.cpp:17
COutPoint::hash
uint256 hash
Definition: transaction.h:29
PSBTOutput::FillSignatureData
void FillSignatureData(SignatureData &sigdata) const
Definition: psbt.cpp:158
PSBTRole::UPDATER
@ UPDATER
PartiallySignedTransaction::inputs
std::vector< PSBTInput > inputs
Definition: psbt.h:394
PSBTInput::witness_script
CScript witness_script
Definition: psbt.h:54
PartiallySignedTransaction::AddInput
bool AddInput(const CTxIn &txin, PSBTInput &psbtin)
Definition: psbt.cpp:40
SigningProvider
An interface to be implemented by keystores that support signing.
Definition: signingprovider.h:18
MutableTransactionSignatureCreator
A signature creator for transactions.
Definition: sign.h:39
PSBTOutput::redeem_script
CScript redeem_script
Definition: psbt.h:278
TransactionError::PSBT_MISMATCH
@ PSBT_MISMATCH
FinalizeAndExtractPSBT
bool FinalizeAndExtractPSBT(PartiallySignedTransaction &psbtx, CMutableTransaction &result)
Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized.
Definition: psbt.cpp:337
DUMMY_SIGNING_PROVIDER
const SigningProvider & DUMMY_SIGNING_PROVIDER
Definition: signingprovider.cpp:12
PSBTOutput::witness_script
CScript witness_script
Definition: psbt.h:279
CScript::clear
void clear()
Definition: script.h:549
Assert
#define Assert(val)
Identity function.
Definition: check.h:57
DecodeBase64PSBT
bool DecodeBase64PSBT(PartiallySignedTransaction &psbt, const std::string &base64_tx, std::string &error)
Decode a base64ed PSBT into a PartiallySignedTransaction.
Definition: psbt.cpp:378
CTxOut::nValue
CAmount nValue
Definition: transaction.h:131
strencodings.h
CTxOut::IsNull
bool IsNull() const
Definition: transaction.h:149
TransactionError
TransactionError
Definition: error.h:22
PartiallySignedTransaction::PartiallySignedTransaction
PartiallySignedTransaction()
Definition: psbt.h:405
PSBTInput::final_script_sig
CScript final_script_sig
Definition: psbt.h:55
SignatureData
Definition: sign.h:65
PartiallySignedTransaction::Merge
bool Merge(const PartiallySignedTransaction &psbt)
Merge psbt into this.
Definition: psbt.cpp:22
PSBTInput::hd_keypaths
std::map< CPubKey, KeyOriginInfo > hd_keypaths
Definition: psbt.h:57
CTxOut
An output of a transaction.
Definition: transaction.h:128
PSBTRole::SIGNER
@ SIGNER
CTxOut::scriptPubKey
CScript scriptPubKey
Definition: transaction.h:132
PartiallySignedTransaction::GetInputUTXO
bool GetInputUTXO(CTxOut &utxo, int input_index) const
Finds the UTXO for a given input index.
Definition: psbt.cpp:60
DecodeBase64
std::vector< unsigned char > DecodeBase64(const char *p, bool *pf_invalid)
Definition: strencodings.cpp:142
PrecomputedTransactionData::Init
void Init(const T &tx, std::vector< CTxOut > &&spent_outputs, bool force=false)
Initialize this PrecomputedTransactionData with transaction data.
Definition: interpreter.cpp:1423
PSBTInput::final_script_witness
CScriptWitness final_script_witness
Definition: psbt.h:56
PSBTRole::CREATOR
@ CREATOR
SignatureData::redeem_script
CScript redeem_script
The redeemScript (if any) for the input.
Definition: sign.h:69
PSBTOutput::IsNull
bool IsNull() const
Definition: psbt.cpp:184
SignatureData::scriptSig
CScript scriptSig
The scriptSig of an input. Contains complete signatures or the traditional partial signatures format.
Definition: sign.h:68
SignatureData::witness
bool witness
Stores whether the input this SigData corresponds to is a witness input.
Definition: sign.h:67
PartiallySignedTransaction::tx
std::optional< CMutableTransaction > tx
Definition: psbt.h:393
PSBTInput::Merge
void Merge(const PSBTInput &input)
Definition: psbt.cpp:140
SignatureData::signatures
std::map< CKeyID, SigPair > signatures
BIP 174 style partial signatures for the input. May contain all signatures necessary for producing a ...
Definition: sign.h:73
UpdatePSBTOutput
void UpdatePSBTOutput(const SigningProvider &provider, PartiallySignedTransaction &psbt, int index)
Updates a PSBTOutput with information from provider.
Definition: psbt.cpp:213
SignatureData::missing_sigs
std::vector< CKeyID > missing_sigs
KeyIDs of pubkeys for signatures which could not be found.
Definition: sign.h:78
SignatureData::witness_script
CScript witness_script
The witnessScript (if any) for the input. witnessScripts are used in P2WSH outputs.
Definition: sign.h:70
PSBTOutput
A structure for PSBTs which contains per output information.
Definition: psbt.h:276
PrecomputedTransactionData
Definition: interpreter.h:150
SignatureData::complete
bool complete
Stores whether the scriptSig and scriptWitness are complete.
Definition: sign.h:66
PSBTInput::unknown
std::map< std::vector< unsigned char >, std::vector< unsigned char > > unknown
Definition: psbt.h:59
PartiallySignedTransaction::AddOutput
bool AddOutput(const CTxOut &txout, const PSBTOutput &psbtout)
Definition: psbt.cpp:53
PSBTRole::EXTRACTOR
@ EXTRACTOR
PSBTRoleName
std::string PSBTRoleName(PSBTRole role)
Definition: psbt.cpp:366
DecodeRawPSBT
bool DecodeRawPSBT(PartiallySignedTransaction &psbt, const std::string &tx_data, std::string &error)
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
Definition: psbt.cpp:389
CountPSBTUnsignedInputs
size_t CountPSBTUnsignedInputs(const PartiallySignedTransaction &psbt)
Counts the unsigned inputs of a PSBT.
Definition: psbt.cpp:202
ProduceSignature
bool ProduceSignature(const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
Definition: sign.cpp:332
SignatureData::missing_pubkeys
std::vector< CKeyID > missing_pubkeys
KeyIDs of pubkeys which could not be found.
Definition: sign.h:77
CMutableTransaction::vout
std::vector< CTxOut > vout
Definition: transaction.h:347
PSBTInput::FillSignatureData
void FillSignatureData(SignatureData &sigdata) const
Definition: psbt.cpp:85
PSBTOutput::Merge
void Merge(const PSBTOutput &output)
Definition: psbt.cpp:189
SIGHASH_ALL
@ SIGHASH_ALL
Definition: interpreter.h:27
PSBTInput
A structure for PSBTs which contain per-input information.
Definition: psbt.h:49
PSBTRole::FINALIZER
@ FINALIZER
CScriptWitness::SetNull
void SetNull()
Definition: script.h:568
PSBTInput::FromSignatureData
void FromSignatureData(const SignatureData &sigdata)
Definition: psbt.cpp:111
COutPoint::n
uint32_t n
Definition: transaction.h:30
SignatureData::misc_pubkeys
std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo > > misc_pubkeys
Definition: sign.h:74
PartiallySignedTransaction
A version of CTransaction with the PSBT format.
Definition: psbt.h:391
TransactionError::OK
@ OK
No error.
PSBTRole
PSBTRole
Definition: psbt.h:560
PartiallySignedTransaction::outputs
std::vector< PSBTOutput > outputs
Definition: psbt.h:395
CDataStream
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:204
PSBTInputSigned
bool PSBTInputSigned(const PSBTInput &input)
Checks whether a PSBTInput is already signed.
Definition: psbt.cpp:197
prevector::empty
bool empty() const
Definition: prevector.h:286
SER_NETWORK
@ SER_NETWORK
Definition: serialize.h:138
COutPoint
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:26
PSBTInput::redeem_script
CScript redeem_script
Definition: psbt.h:53
CDataStream::empty
bool empty() const
Definition: streams.h:256
SignatureData::missing_witness_script
uint256 missing_witness_script
SHA256 of the missing witnessScript (if any)
Definition: sign.h:80
error
bool error(const char *fmt, const Args &... args)
Definition: system.h:49
PSBTInput::IsNull
bool IsNull() const
Definition: psbt.cpp:80
CMutableTransaction
A mutable version of CTransaction.
Definition: transaction.h:344
PSBTOutput::FromSignatureData
void FromSignatureData(const SignatureData &sigdata)
Definition: psbt.cpp:171
PSBTInput::witness_utxo
CTxOut witness_utxo
Definition: psbt.h:52
PrecomputePSBTData
PrecomputedTransactionData PrecomputePSBTData(const PartiallySignedTransaction &psbt)
Compute a PrecomputedTransactionData object from a psbt.
Definition: psbt.cpp:233
PSBTOutput::hd_keypaths
std::map< CPubKey, KeyOriginInfo > hd_keypaths
Definition: psbt.h:280
PartiallySignedTransaction::unknown
std::map< std::vector< unsigned char >, std::vector< unsigned char > > unknown
Definition: psbt.h:396
PSBTOutput::unknown
std::map< std::vector< unsigned char >, std::vector< unsigned char > > unknown
Definition: psbt.h:281
PROTOCOL_VERSION
static const int PROTOCOL_VERSION
network protocol versioning
Definition: version.h:12
psbt.h