https://github.com/bitcoin/bips/pull/784 added a new global field GLOBAL_XPUB to BIP 174. This PR adds support for (de)serializing this field and displaying it in decodepsbt.
[BIP 174] Implement serialization support for GLOBAL_XPUB field. #16463
pull achow101 wants to merge 8 commits into bitcoin:master from achow101:bip174-xpub changing 9 files +225 −75-
achow101 commented at 5:45 PM on July 25, 2019: member
- DrahtBot added the label RPC/REST/ZMQ on Jul 25, 2019
- DrahtBot added the label Tests on Jul 25, 2019
-
DrahtBot commented at 8:27 PM on July 25, 2019: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #17034 (Bip174 extensions by achow101)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
- achow101 force-pushed on Jul 31, 2019
- laanwj added this to the milestone 0.20.0 on Oct 4, 2019
- DrahtBot added the label Needs rebase on Oct 9, 2019
- achow101 force-pushed on Oct 9, 2019
- achow101 force-pushed on Oct 9, 2019
- DrahtBot removed the label Needs rebase on Oct 9, 2019
- DrahtBot added the label Needs rebase on Oct 30, 2019
- achow101 force-pushed on Oct 31, 2019
- DrahtBot removed the label Needs rebase on Oct 31, 2019
- DrahtBot added the label Needs rebase on Nov 20, 2019
- achow101 force-pushed on Nov 20, 2019
- DrahtBot removed the label Needs rebase on Nov 20, 2019
- DrahtBot added the label Needs rebase on Mar 4, 2020
- achow101 force-pushed on Mar 4, 2020
- DrahtBot removed the label Needs rebase on Mar 5, 2020
-
in src/psbt.h:521 in 63f705bb9d outdated
515 | @@ -424,6 +516,18 @@ struct PartiallySignedTransaction 516 | OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion() | SERIALIZE_TRANSACTION_NO_WITNESS); 517 | SerializeToVector(os, *tx); 518 | 519 | + // Write xpubs 520 | + for (const auto xpub_pair : xpubs) { 521 | + for (const auto xpub : xpub_pair.second) {
jonatack commented at 5:54 PM on March 24, 2020:suggested change to reference instead of copy in range loops:
- for (const auto xpub_pair : xpubs) { - for (const auto xpub : xpub_pair.second) { + for (const auto& xpub_pair : xpubs) { + for (const auto& xpub : xpub_pair.second) {
jonatack commented at 5:59 PM on March 24, 2020:(this also fixes warnings if you build with -Wrange-loop-analysis)
achow101 commented at 6:57 PM on March 26, 2020:Done, also in a few other places.
laanwj removed this from the milestone 0.20.0 on Mar 26, 2020laanwj added this to the milestone 0.21.0 on Mar 26, 2020laanwj added the label Feature on Mar 26, 2020achow101 force-pushed on Mar 26, 2020DrahtBot added the label Needs rebase on Apr 23, 2020achow101 force-pushed on Apr 23, 2020DrahtBot removed the label Needs rebase on Apr 23, 2020DrahtBot added the label Needs rebase on Apr 27, 2020achow101 force-pushed on Apr 27, 2020DrahtBot removed the label Needs rebase on Apr 27, 2020DrahtBot added the label Needs rebase on May 20, 2020achow101 force-pushed on May 20, 2020DrahtBot removed the label Needs rebase on May 20, 2020luke-jr referenced this in commit 93bde8969b on Jun 9, 2020luke-jr referenced this in commit 596415fa60 on Jun 9, 2020luke-jr referenced this in commit 82ceb28258 on Jun 9, 2020luke-jr referenced this in commit 51d9a2c365 on Jun 9, 2020luke-jr referenced this in commit 717793f4d6 on Jun 9, 2020luke-jr referenced this in commit b8e1e58a5c on Jun 9, 2020luke-jr referenced this in commit 847d2c4d63 on Jun 9, 2020luke-jr referenced this in commit efd999d85c on Jun 12, 2020luke-jr referenced this in commit 8250efa76c on Jun 12, 2020luke-jr referenced this in commit 3e8b22baae on Jun 12, 2020luke-jr referenced this in commit 38466f0407 on Jun 12, 2020luke-jr referenced this in commit 3ed04658c4 on Jun 12, 2020luke-jr referenced this in commit 9b0cdc3212 on Jun 12, 2020luke-jr referenced this in commit 1090a9cb93 on Jun 12, 2020laanwj removed this from the milestone 0.21.0 on Oct 8, 2020achow101 force-pushed on Jan 4, 2021in src/script/sign.h:103 in 10e209e778 outdated
98 | - } 99 | -} 100 | - 101 | -// Deserialize HD keypaths into a map 102 | -template<typename Stream> 103 | -void DeserializeHDKeypaths(Stream& s, const std::vector<unsigned char>& key, std::map<CPubKey, KeyOriginInfo>& hd_keypaths)
adamjonas commented at 4:56 PM on January 12, 2021:This move appears to be messing with the fuzzer in
/fuzz/script.cppwhich is looking for these functions.
achow101 commented at 8:41 PM on January 12, 2021:Fixed I think
30a9b28d8emoveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt module
SerializeToVector, UnserializeFromVector, DeserializeHDKeypaths, and SerializeHDKeypaths were in sign.h where PSBT was originally implemented. Since all of the PSBT serialization has moved to its own file, these functions should follow.
f8a078d9bfStore version bytes and be able to serialize them in CExtPubKey
CExtPubKey does not store the version bytes for the extended public key. We store these so that a CExtPubKey can be serialized and deserialized with the same version bytes.
Separate individual HD Keypath serialization into separate functions 868281d1dcImplement operator< for KeyOriginInfo and CExtPubKey 22e7161febImplement serializations for PSBT_GLOBAL_XPUB 6c121791b9Add global_xpubs to decodepsbt ebb194838dAdd global xpub test vectors from BIP 4bf66a3743Merge global xpubs in joinpsbts and combinepsbts 9926a387eaachow101 force-pushed on Jan 12, 2021achow101 closed this on Jan 25, 2021laanwj referenced this in commit 50c502f54a on Dec 10, 2021sidhujag referenced this in commit 525d6c6f49 on Dec 11, 2021DrahtBot locked this on Aug 16, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me