Commit graph

115 commits

Author SHA1 Message Date
Byron Hambly
a992ccaac2 Merge 196b459920 into merged_master (Bitcoin PR bitcoin/bitcoin#23438) 2023-06-29 08:37:35 +00:00
Byron Hambly
47626b5a64 Merge 623745ca74 into merged_master (Bitcoin PR bitcoin/bitcoin#23912) 2023-06-14 15:44:11 +00:00
James Dorfman
b0afaee332 Merge eb63b8fab9 into merged_master (Bitcoin PR bitcoin/bitcoin#23718) 2023-06-13 05:47:02 +00:00
Byron Hambly
e9be7bfc96 Merge 383d350bd5 into merged_master (Bitcoin PR bitcoin/bitcoin#22513) 2023-05-31 13:50:36 +00:00
Byron Hambly
6a650c1a67 Merge 398fd63356 into merged_master (Bitcoin PR bitcoin/bitcoin#23525) 2023-05-26 13:06:05 +00:00
Allen Piscitello
420de43c1c removing code to blind issuances. PSET should be modified to include an option to blind or unblind issuances, defaulting to unblind. 2022-08-24 09:42:29 -05:00
Allen Piscitello
5954b10a1a Fixing issuance cases and half blinded cases in PSET 2022-08-18 11:20:02 -05:00
MarcoFalke
fa24493d63
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
2022-01-02 11:40:31 +01:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00
Antoine Poinsot
4d6b5321a5
psbt: implement hash preimages fields 2021-12-11 18:32:17 +01:00
Andrew Chow
81521173ba Merge global xpubs in joinpsbts and combinepsbts 2021-12-10 08:29:47 -05:00
Andrew Chow
df84fa99c5 Add GetVersion helper to PSBT 2021-12-10 08:29:26 -05:00
W. J. van der Laan
383d350bd5
Merge bitcoin/bitcoin#22513: rpc: Allow walletprocesspsbt to sign without finalizing
a99ed89865 psbt: sign without finalizing (Andrew Chow)

Pull request description:

  It can be useful to sign an input with `walletprocesspsbt` but not finalize that input if it is complete. This PR adds another option to `walletprocesspsbt` to be able to do that. We will still finalize by default.

  This does not materially change the PSBT workflow since `finalizepsbt` needs to be called in order to extract the tx for broadcast.

ACKs for top commit:
  meshcollider:
    utACK a99ed89865
  Sjors:
    utACK a99ed89

Tree-SHA512: c88e5d3222109c5f4e763b1b9d97ce4655f68f2985a4509caab2d4e7f5bac5047328fd69696e82a330f5c5a333e0312568ae293515689b77a4747ca2f17caca6
2021-11-29 17:20:20 +01:00
MarcoFalke
fa54a40809
doc: Pick better named args for MutableTransactionSignatureCreator
Argument names of "nInIn" are not helpful.
2021-11-16 13:38:12 +01:00
Andrew Poelstra
a1f0aea3d7 Merge 43665e3ca0 into merged_master (Elements PR ElementsProject/elements#1055) 2021-10-14 19:32:30 +00:00
Andrew Poelstra
0e1007fa7b minor PSET fix 2021-10-06 19:10:15 +00:00
Andrew Poelstra
7b69a940eb Merge 846ab81794 into merged_master (Elements PR ElementsProject/elements#1051) 2021-10-02 13:27:49 +00:00
Andrew Poelstra
fec0b59112 pset: make sure combinepsbt doesn't crash when explicit values are missing
I accidentally dropped this check (and its test) in the previous
commits. Restore both.
2021-10-01 20:10:27 +00:00
Andrew Poelstra
187c8094bb combinepsbt: only use explicit values if the corresponding proofs pass 2021-10-01 17:17:41 +00:00
Andrew Chow
a99ed89865 psbt: sign without finalizing
We don't always want to finalize after signing, so make it possible to
do that.
2021-09-28 19:13:42 -04:00
Andrew Poelstra
daa471ddd2 Merge 4c7dc0620a into merged_master (Elements PR ElementsProject/elements#1046) 2021-09-22 02:26:13 +00:00
Andrew Poelstra
35cfda73b9 PSET: do not assume in GetUnsignedTx that explicit amounts/assets are available 2021-09-21 20:33:31 +00:00
Andrew Poelstra
6c368ab1a3 Merge a1726c555b into merged_master (Elements PR ElementsProject/elements#1045) 2021-09-21 20:32:03 +00:00
Andrew Poelstra
1b23ad7093 pset: fix encoding of blinded asset issuances 2021-09-19 20:58:07 +00:00
Andrew Poelstra
9c3c61aa0a psbt: make sure rangeproofs are present in the confidential version of the unsigned tx
These rangeproofs are covered by signature in both Taproot and
SIGHASH_RANGEPROOF signatures, so they need to be present.
2021-09-19 14:52:47 +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 Chow
9f94966581 pset: Allow GetUnsignedTx to force unblinded values
In order to get the Unique id for a PSET, the explicit values and assets
need to be used. Since GetUnsignedTx is used to create the tx that is
hashed, modify GetUnsignedTx so that the explicit values and assets are
used when requested.
2021-09-11 20:58:40 -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
37c925f472 pset: Do not remove amounts after blinding 2021-09-07 20:44:30 -04:00
Andrew Poelstra
7d1c77f0a1 Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002)
This forward-ports the new Taproot sighash but does not fix a couple
22-blocked TODOs related to the MissingDataBehavior enum. Should be fixed
in a followup commit.

One nontrivial change I had to make was feeding the genesis hash to SignTransaction
(the "global" one in script/sign.cpp) so that it could correctly compute
the sighash at signing time.
2021-09-04 22:14:42 +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
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 Chow
64b30bfc3d Enable analyzepsbt 2021-06-22 14:42:38 -04:00
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
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
2c0cee5a20 Update GetUnsignedTx for PSET 2021-06-22 14:42:19 -04:00
Andrew Chow
e9bfff25db Allow empty scriptPubKeys 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
bad1876e03 Re-enable and fix PSBT signing 2021-06-22 14:42:19 -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
e860cd0f42 Add a PSBT constructor for providing the version 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
139ac3613e Implement PSBTv2 AddInput and AddOutput 2021-06-22 13:54:50 -04:00
Andrew Chow
f269d1170c Update FinalizeAndExtract for v2 2021-06-22 13:54:50 -04:00
Andrew Chow
23f644206b Update SignPSBTInput for PSBTv2 2021-06-22 13:54:50 -04:00