[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
  1. achow101 commented at 5:45 pm on July 25, 2019: member
    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.
  2. DrahtBot added the label RPC/REST/ZMQ on Jul 25, 2019
  3. DrahtBot added the label Tests on Jul 25, 2019
  4. DrahtBot commented at 8:27 pm on July 25, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    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.

  5. achow101 force-pushed on Jul 31, 2019
  6. laanwj added this to the milestone 0.20.0 on Oct 4, 2019
  7. DrahtBot added the label Needs rebase on Oct 9, 2019
  8. achow101 force-pushed on Oct 9, 2019
  9. achow101 force-pushed on Oct 9, 2019
  10. DrahtBot removed the label Needs rebase on Oct 9, 2019
  11. DrahtBot added the label Needs rebase on Oct 30, 2019
  12. achow101 force-pushed on Oct 31, 2019
  13. DrahtBot removed the label Needs rebase on Oct 31, 2019
  14. DrahtBot added the label Needs rebase on Nov 20, 2019
  15. achow101 force-pushed on Nov 20, 2019
  16. DrahtBot removed the label Needs rebase on Nov 20, 2019
  17. DrahtBot added the label Needs rebase on Mar 4, 2020
  18. achow101 force-pushed on Mar 4, 2020
  19. DrahtBot removed the label Needs rebase on Mar 5, 2020
  20. 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:

    0-        for (const auto xpub_pair : xpubs) {
    1-            for (const auto xpub : xpub_pair.second) {
    2+        for (const auto& xpub_pair : xpubs) {
    3+            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.
  21. laanwj removed this from the milestone 0.20.0 on Mar 26, 2020
  22. laanwj added this to the milestone 0.21.0 on Mar 26, 2020
  23. laanwj added the label Feature on Mar 26, 2020
  24. achow101 force-pushed on Mar 26, 2020
  25. DrahtBot added the label Needs rebase on Apr 23, 2020
  26. achow101 force-pushed on Apr 23, 2020
  27. DrahtBot removed the label Needs rebase on Apr 23, 2020
  28. DrahtBot added the label Needs rebase on Apr 27, 2020
  29. achow101 force-pushed on Apr 27, 2020
  30. DrahtBot removed the label Needs rebase on Apr 27, 2020
  31. DrahtBot added the label Needs rebase on May 20, 2020
  32. achow101 force-pushed on May 20, 2020
  33. DrahtBot removed the label Needs rebase on May 20, 2020
  34. luke-jr referenced this in commit 93bde8969b on Jun 9, 2020
  35. luke-jr referenced this in commit 596415fa60 on Jun 9, 2020
  36. luke-jr referenced this in commit 82ceb28258 on Jun 9, 2020
  37. luke-jr referenced this in commit 51d9a2c365 on Jun 9, 2020
  38. luke-jr referenced this in commit 717793f4d6 on Jun 9, 2020
  39. luke-jr referenced this in commit b8e1e58a5c on Jun 9, 2020
  40. luke-jr referenced this in commit 847d2c4d63 on Jun 9, 2020
  41. luke-jr referenced this in commit efd999d85c on Jun 12, 2020
  42. luke-jr referenced this in commit 8250efa76c on Jun 12, 2020
  43. luke-jr referenced this in commit 3e8b22baae on Jun 12, 2020
  44. luke-jr referenced this in commit 38466f0407 on Jun 12, 2020
  45. luke-jr referenced this in commit 3ed04658c4 on Jun 12, 2020
  46. luke-jr referenced this in commit 9b0cdc3212 on Jun 12, 2020
  47. luke-jr referenced this in commit 1090a9cb93 on Jun 12, 2020
  48. laanwj removed this from the milestone 0.21.0 on Oct 8, 2020
  49. achow101 force-pushed on Jan 4, 2021
  50. in 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.cpp which is looking for these functions.

    achow101 commented at 8:41 pm on January 12, 2021:
    Fixed I think
  51. moveonly: 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.
    30a9b28d8e
  52. Store 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.
    f8a078d9bf
  53. Separate individual HD Keypath serialization into separate functions 868281d1dc
  54. Implement operator< for KeyOriginInfo and CExtPubKey 22e7161feb
  55. Implement serializations for PSBT_GLOBAL_XPUB 6c121791b9
  56. Add global_xpubs to decodepsbt ebb194838d
  57. Add global xpub test vectors from BIP 4bf66a3743
  58. Merge global xpubs in joinpsbts and combinepsbts 9926a387ea
  59. achow101 force-pushed on Jan 12, 2021
  60. achow101 commented at 10:07 pm on January 25, 2021: member
    Combining this PR with #17034
  61. achow101 closed this on Jan 25, 2021

  62. laanwj referenced this in commit 50c502f54a on Dec 10, 2021
  63. sidhujag referenced this in commit 525d6c6f49 on Dec 11, 2021
  64. DrahtBot 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: 2024-07-05 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me