Commit graph

2190 commits

Author SHA1 Message Date
Andrew Poelstra
64194498cf
Merge ElementsProject/elements#1025: Introduce blech32m format for v1+ witness programs
c72c949d29 blech32: copy ubsan suppression for bech32 to blech32 (Andrew Poelstra)
d13fb4994b blech32: add test vectors for blech32 and blech32m (Andrew Poelstra)
15a826ea27 blech32: add functional tests for blech32m (Andrew Poelstra)
c01e09e8c3 blech32: add blech32m format and use it to decode witness v1+ addresses (Andrew Poelstra)
18fcec8714 naming nits (Fabian Jahr)
8515f40fed Add signet support to gen_key_io_test_vectors.py (Pieter Wuille)
b3df66f82e Use Bech32m encoding for v1+ segwit addresses (Pieter Wuille)
42f43a1bcb Add Bech32m test vectors (Pieter Wuille)
b1d1d94e01 Implement Bech32m encoding/decoding (Pieter Wuille)
c607835bad Better error messages for invalid addresses (Bezdrighin)

Pull request description:

  Includes backports of https://github.com/bitcoin/bitcoin/pull/20832 (1 commit) and https://github.com/bitcoin/bitcoin/pull/20861 (5 commits)

ACKs for top commit:
  gwillen:
    utACK c72c949.

Tree-SHA512: af96a6ef31b1cab72b0350197dcb34761e9ffb2ec43685084408b5fafcda0adee1945045003194600372652f7cca65d721bda3ed9b6be7e9543d3199e2cbe145
2021-08-30 18:59:25 +00:00
sanket1729
31c232a39b clarify that secp scalars are unsigned big endian 2021-08-24 10:46:33 -07:00
sanket1729
f11fe0ad9c Update spec for rolling sha256 opcodes 2021-08-23 16:39:22 -07:00
sanket1729
3055e85042 Rename taptweak 2021-08-19 09:49:10 -07:00
Pieter Wuille
b3df66f82e Use Bech32m encoding for v1+ segwit addresses
This also includes updates to the Python test framework implementation,
test vectors, and release notes.

https://github.com/bitcoin/bitcoin/pull/20861 (3/5)
2021-08-17 22:32:47 +00:00
sanket1729
a651f7ed4b More updates to spec 2021-08-17 15:20:35 -07:00
sanket1729
147b9b7f6a Remove binary operations for 64 bits 2021-08-17 15:20:35 -07:00
sanket1729
95f82f5080 Update spec for inputoutpoint 2021-08-17 15:20:35 -07:00
sanket1729
6c4971dfbd Confirm overflow behaviour of scalars 2021-08-17 15:20:35 -07:00
sanket1729
1d778dd632 Remove shifts, update output spk introspection 2021-08-17 15:20:35 -07:00
sanket1729
49978abf5a Renumber opcodes; minor fixups 2021-08-17 15:20:35 -07:00
sanket1729
3be79d1257 Update LE32 to read only unsigned 2021-08-17 15:20:35 -07:00
sanket1729
d3cff9eea4 Update overflow behavior 2021-08-17 15:20:35 -07:00
sanket1729
50733b8826 Flatten out introspection opcodes 2021-08-17 15:20:35 -07:00
sanket1729
4bce8af953 Remove MULTISCALAREXPVERIFY. Sigops budget calculation is mentioned in respective opcode sections 2021-08-17 15:20:35 -07:00
sanket1729
5ae2945da7 [WIP] updated spec for tapscript opcodes
Update op_success
2021-08-17 15:20:35 -07:00
fanquake
60a5632f77 build: set minimum supported macOS to 10.14 2021-07-11 18:43:54 +00:00
Andrew Poelstra
e0532f60c7
Merge ElementsProject/elements#933: doc: add document describing Taproot sighashes
cca82245f8 doc: fix `SigMsg` length in taproot sighash (Andrew Poelstra)
7ca7983c2a doc/taproot-sighash: encode issuance rangeproofs in sighash; clean up padding etc (Andrew Poelstra)
04cb40010f doc/taproot-sighash: clarify text about pegin input data (Andrew Poelstra)
a88e4c5b1d doc/taproot-sighash: remove "padded" CTxOut format from doc (Andrew Poelstra)
41de29493f taproot-sighash.mediawiki: address formatting/typo comments from Russell (Andrew Poelstra)
dc5b3185b4 taproot-sighash.mediawiki: remove input `nNonce` field (Andrew Poelstra)
f62c8d19d3 taproot-sighash.mediawiki: fix ambiguity in text (Andrew Poelstra)
a552fbf470 update taphash doc (sanket1729)
88d41e5ba2 doc: add missing nNonce field for ACP taproot sighashes (Andrew Poelstra)
639f6f3a98 doc: expand all confidential fields in taproot-sighash to fixed 33 bytes (Andrew Poelstra)
d19dd01ce6 doc: add document describing Taproot sighashes (Andrew Poelstra)

Pull request description:

  Thanks to @roconnor-blockstream for writing the first draft of this document.

ACKs for top commit:
  sanket1729:
    ACK cca82245f8

Tree-SHA512: a534a0be313b5ba3c74ad4f2cdb1e009f1c240f5f85aeb06195325ff87348a1c1457252c9b347de4400446d0fc98def8c4df55176d4481c44449f5bc4e2917b1
2021-07-07 17:06:45 +00:00
Andrew Poelstra
9a154599fe
Merge ElementsProject/elements#900: Redesign PSET
f8553c571b Disable joinpsbts (Andrew Chow)
864f625fcf Fix display of outputs in PSBT ops dialog (Andrew Chow)
5425da4278 Enable converttopsbt for PSET (Andrew Chow)
4940ceeea6 Use a constant for maximum surjection targets (Andrew Chow)
4a44ff2c2e Check elements blinding field constraints during deser (Andrew Chow)
9fe6401d59 Allow specifying SIGHASH_RANGEPROOF (Andrew Chow)
7533503b3c Initialize optionals with nullopt (Andrew Chow)
64b30bfc3d Enable analyzepsbt (Andrew Chow)
b65a00f095 Add PSBTOutput::GetTxOut() (Andrew Chow)
80ff739c7a Default to adding bip32 derivs (Andrew Chow)
1889554e2c Remove unnecessary psbt blinding test (Andrew Chow)
afd795010b Update rpc_psbt.py for PSET (Andrew Chow)
46ccf611c4 Only allow psbt_version 2 (Andrew Chow)
b1ebc813ea Remove walletsignpsbt, blindpsbt, walletblindpsbt, and walletfillpsbtdata (Andrew Chow)
d8fa5c1458 Use createtx array outputs (Andrew Chow)
0e2f1ff441 Make m_peg_in_witness during SignPSBTInput (Andrew Chow)
bd97836767 Update FinalizeAndExtract for PSEt (Andrew Chow)
c0cb623acc Allow value commitments instead of explicit value (Andrew Chow)
2c0cee5a20 Update GetUnsignedTx for PSET (Andrew Chow)
25df8aa12b Fixes to FillPSBT (Andrew Chow)
e9bfff25db Allow empty scriptPubKeys (Andrew Chow)
eeb6cf76e4 Mark PSET as being implemented (Andrew Chow)
3db2622e70 Only sign blinded PSBTs in walletprocesspsbt (Andrew Chow)
a8a6f4c999 Add IsBlinded and IsFullyBlinded helpers for PSBT (Andrew Chow)
124efa2668 Return better errors for BlindingStatus (Andrew Chow)
f686e0fa54 Remove walletfillpsbtdata RPC (Andrew Chow)
5391095205 Output PSBTOutputs with aux info from ConstructTransaction (Andrew Chow)
ea2c3dfb20 Remove output_assets and have asset field in outputs (Andrew Chow)
e6cc0fd693 Have walletprocesspsbt blind before signing (Andrew Chow)
bad1876e03 Re-enable and fix PSBT signing (Andrew Chow)
9a450ecc19 Set blinder_index to self in walletcreatefundedpsbt (Andrew Chow)
3f6c8bfda1 Add walletblindpsbt rpc (Andrew Chow)
e7dd046b03 Implement BlindPSBT (Andrew Chow)
1dbc3b270c Implement updatepsbtpegin RPC (Andrew Chow)
bdfcb436b7 Add calculateasset RPC (Andrew Chow)
79c4a9901b pset: add issuance things (Andrew Chow)
6890461bfe Implement blinded combiner stuff (Andrew Chow)
2220d844ef Return peg-in UTXO with GetUTXO (Andrew Chow)
33c694f822 Helper functions to determine whether a PSBTOutput is blinded (Andrew Chow)
ee28be3018 Extract elements fields for tx into psbt (Andrew Chow)
f84a927a71 Add DecomposePeginWitness (Andrew Chow)
e37439775a Implement and enable decodepsbt for PSET (Andrew Chow)
b372430f70 Implement PSET fields and their de/ser (Andrew Chow)
ecaf5ea1cf Use GetUnsignedTx when serializing in PSBTv0 (Andrew Chow)
e860cd0f42 Add a PSBT constructor for providing the version (Andrew Chow)
0ca0b7e040 Update rpc_psbt.py to test PSBTv0 explicitly in some places (Andrew Chow)
f4bca18784 Restrict joinpsbts to PSBTv0 only (Andrew Chow)
ebc49e3111 Allow createpsbt and walletcreatefundedpsbt to take psbt version (Andrew Chow)
2c1fe5841f Allow and create PSBTv2 in RPCs (Andrew Chow)
e467ec68ad Update PSBT::UpdatePSBTOutput to use GetUnsignedTx (Andrew Chow)
a34474e25a Allow specifying PSBT version in constructor (Andrew Chow)
bedc1e0fec Implement PSBTv2 in decodepsbt (Andrew Chow)
139ac3613e Implement PSBTv2 AddInput and AddOutput (Andrew Chow)
16395c15e9 Update wallet for PSBTv2 (Andrew Chow)
9c8330024a Update RPCs for PSBTv2 (Andrew Chow)
c9c23cad6b Update PSBT Operations Dialog for v2 (Andrew Chow)
500554acbe Update AnalyzePSBT for PSBTv2 (Andrew Chow)
f269d1170c Update FinalizeAndExtract for v2 (Andrew Chow)
23f644206b Update SignPSBTInput for PSBTv2 (Andrew Chow)
d8dba3333b Add PSBTInput::GetOutPoint (Andrew Chow)
4ff2593280 Implement PSBTv2 field merging (Andrew Chow)
cd5515a266 Change PSBT::AddOutput to take just PSBTOutput (Andrew Chow)
90cd7ec5d5 Change PSBT::AddInput to take just PSBTInput (Andrew Chow)
bd1a57bd80 Add PSBT::GetUniqueID (Andrew Chow)
32bdf2d97e Add PSBT::GetUnsignedTx (Andrew Chow)
10bf24726b Add PSBT::ComputeLockTime() (Andrew Chow)
3c647b7a54 Replace PSBT::GetInputUTXO with PSBTInput::GetUTXO (Andrew Chow)
4b805fd4b5 Convert PSBTv0 unsigned tx to PSBTv2 fields (Andrew Chow)
32234dfa68 Call CacheUnsignedTxPieces in PSBT constructor (Andrew Chow)
c32950e02b Add PSBT::CacheUnsignedTxPieces (Andrew Chow)
457b6bd44b Enforce PSBT version constraints (Andrew Chow)
2042765520 Have PSBTInput and PSBTOutput know the PSBT's version (Andrew Chow)
8c624438ca Change PSBT unknown fields test to use higher numbers (Andrew Chow)
dd792cea62 Implement PSBTv2 fields de/ser (Andrew Chow)
ec03f83d5f Define psbtv2 field numbers (Andrew Chow)
20e8dff880 Merge global xpubs in joinpsbts and combinepsbts (Andrew Chow)
bc2651d200 Add global xpub test vectors from BIP (Andrew Chow)
7fd50b2795 Add global_xpubs to decodepsbt (Andrew Chow)
2c54175f0f Implement serializations for PSBT_GLOBAL_XPUB (Andrew Chow)
5b5c5efbbb Implement operator< for KeyOriginInfo and CExtPubKey (Andrew Chow)
4eabba9be7 Separate individual HD Keypath serialization into separate functions (Andrew Chow)
cb9c553429 Store version bytes and be able to serialize them in CExtPubKey (Andrew Chow)
fad29bafd3 moveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt module (Andrew Chow)
31a7e0a744 Test for proprietary field (Andrew Chow)
5bb930e0b4 Output proprietary type info in decodepsbt (Andrew Chow)
575fec01b2 Implement PSBT proprietary type (Andrew Chow)
25c13ad3b8 Output psbt version in decodepsbt (Andrew Chow)
ad2b2d7c58 Add GetVersion helper to PSBT (Andrew Chow)
50c281fc12 Implement PSBT versions (Andrew Chow)
e882a3a32d Types are compact size uints (Andrew Chow)
fdf71def4c Remove PSET and disable PSBT/PSET things for now (Andrew Chow)

Pull request description:

  The original PSET had some issues with leaking private information and there were issues with the design of the various roles. This PR replaces it with a new PSET design that should be able to provide all of the things that people expect PSETs to do while preserving privacy.

  Additionally, an actual specification for this new design has been written up. It describes all of the new fields, their serialization, and how roles should handle the PSET data.

  This is still a work in progress as not everything with the blinder role has been worked out yet.

Top commit has no ACKs.

Tree-SHA512: 69f6f74dd252e4fba14e201f8f1d9b017b3b62ddf375e6536e71a3f327435e7c1ef8a12b2914cbed3e46f70bcbc8caadc07342ee323ece45a47dd1d77d81b3e8
2021-07-06 19:55:59 +00:00
Andrew Poelstra
cca82245f8 doc: fix SigMsg length in taproot sighash 2021-07-01 22:20:37 +00:00
Andrew Poelstra
7ca7983c2a doc/taproot-sighash: encode issuance rangeproofs in sighash; clean up padding etc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
04cb40010f doc/taproot-sighash: clarify text about pegin input data 2021-07-01 16:59:52 +00:00
Andrew Poelstra
a88e4c5b1d doc/taproot-sighash: remove "padded" CTxOut format from doc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
41de29493f taproot-sighash.mediawiki: address formatting/typo comments from Russell 2021-07-01 16:59:52 +00:00
Andrew Poelstra
dc5b3185b4 taproot-sighash.mediawiki: remove input nNonce field 2021-07-01 16:59:52 +00:00
Andrew Poelstra
f62c8d19d3 taproot-sighash.mediawiki: fix ambiguity in text 2021-07-01 16:59:52 +00:00
sanket1729
a552fbf470 update taphash doc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
88d41e5ba2 doc: add missing nNonce field for ACP taproot sighashes 2021-07-01 16:59:52 +00:00
Andrew Poelstra
639f6f3a98 doc: expand all confidential fields in taproot-sighash to fixed 33 bytes 2021-07-01 16:59:52 +00:00
Andrew Poelstra
d19dd01ce6 doc: add document describing Taproot sighashes 2021-07-01 16:59:52 +00:00
sanket1729
84339ba5e5 Address Andrew's suggestions 2021-06-28 13:43:39 -07:00
sanket1729
7b187d6b26 Add doc for tapscript opcode upgradres 2021-06-23 14:30:27 -07:00
Andrew Chow
eeb6cf76e4 Mark PSET as being implemented 2021-06-22 14:42:19 -04:00
Steven Roose
4db1799620
Merge ElementsProject/elements#951: Spec for PSET
8e19dfa35b Specify PSET (Andrew Chow)

Pull request description:

  Adds the document specifying the new PSET format that #900 implements.

  Pulled out of #900

Top commit has no ACKs.

Tree-SHA512: 892d27a5735fc581b0963b3e230cc028c08f7750a55c8b4030f9f909dee89910348fdc565739c6ec73ce206b7cfd08d3614ccaf884d5abc43a7470f36368ca43
2021-05-06 15:28:58 +01:00
Andrew Chow
8e19dfa35b Specify PSET 2021-04-20 18:08:17 -04:00
Andrew Poelstra
48dc78db0c Merge 9d35590935 into merged_master (Elements PR #964) 2021-03-26 00:58:03 +00:00
Glenn Willen
2f40d80b01 Further revisions in response to comments 2021-02-26 01:00:16 -08:00
Andrew Poelstra
7036176700 Merge 0bd4929cd0 into merged_master (Bitcoin PR #20284) 2020-12-02 13:51:39 +00:00
Andrew Poelstra
c876734d93 Merge b6a00e76ab into merged_master (Bitcoin PR #20279) 2020-12-01 22:04:54 +00:00
Andrew Poelstra
9ce2c21435 Merge 42b66a6b81 into merged_master (Bitcoin PR #20186) 2020-12-01 20:37:50 +00:00
Andrew Poelstra
f3afbf3d85 Merge f3727fd735 into merged_master (Bitcoin PR #20156) 2020-12-01 18:41:26 +00:00
Andrew Poelstra
d80e17c203 Merge 67d4643a1a into merged_master (Bitcoin PR #20152) 2020-12-01 17:05:26 +00:00
Andrew Poelstra
8258a74157 Merge 4f807348af into merged_master (Bitcoin PR #20185) 2020-12-01 06:49:23 +00:00
Andrew Poelstra
85663c72a3 Merge 82d3596dfe into merged_master (Bitcoin PR #20161) 2020-12-01 04:25:27 +00:00
Andrew Poelstra
943ae42b1a Merge 9855422e65 into merged_master (Bitcoin PR #17428) 2020-12-01 03:53:08 +00:00
Andrew Poelstra
4eeadb7fde Merge 8ed37f6c84 into merged_master (Bitcoin PR #19077) 2020-11-30 20:20:56 +00:00
Andrew Poelstra
f327fa97f2 Merge c2c4dbaebd into merged_master (Bitcoin PR #19988) 2020-11-30 19:05:03 +00:00
Andrew Poelstra
ed77072953 Merge e21b824386 into merged_master (Bitcoin PR #20109) 2020-11-30 18:38:05 +00:00
Andrew Poelstra
c9621a0d4a Merge af22322dab into merged_master (Bitcoin PR #20119) 2020-11-30 17:36:05 +00:00
Andrew Poelstra
4cb66aae97 Merge 0b2abaa666 into merged_master (Bitcoin PR #19954) 2020-11-30 17:12:23 +00:00