Add PSBT documentation #13941

pull sipa wants to merge 1 commits into bitcoin:master from sipa:201807_psbtdoc changing 2 files +133 −0
  1. sipa commented at 0:06 am on August 11, 2018: member

    This is just some initial text to get going; other contributions welcome.

    I’d like to include other workflows, such as hardware wallets and (manual) coinjoins. However, the former will in practice require PSBT interfaces for existing hardware devices, and the second can really use some extra RPCs first.

  2. in doc/psbt.md:109 in 9eb20b5097 outdated
    104+
    105+Later, when *V* BTC has been received on *Amulti*, and Bob and Carol want to
    106+move the coins in their entirety to address *Asend*, with no change. Alice
    107+does not need to be involved.
    108+- One of them - let's assume Carol here - initiates the creation. She runs
    109+  `walletcreatefundedpsbt [] {"Asend":V} 0 false {"subtractFeeFromOutputs":[0]}`,
    


    achow101 commented at 0:16 am on August 11, 2018:
    "includeWatching":true is also necessary here since Amulti is only solvable by Bob, not spendable. By default watching only outputs will not be selected.

    sipa commented at 6:15 pm on August 14, 2018:
    Fixed.
  3. in doc/psbt.md:86 in 9eb20b5097 outdated
    81+### Workflows
    82+
    83+#### Multisig with multiple Bitcoin Core instances
    84+
    85+Alice, Bob, and Carol want to create a 2-of-3 multisig address. They're all using
    86+Bitcoin Core.
    


    achow101 commented at 0:17 am on August 11, 2018:
    Should probably also say that we are assuming no other addresses in the wallets are being used. Otherwise walletcreatefundedpsbt below may choose outputs that are not for Amulti

    sipa commented at 6:15 pm on August 14, 2018:
    Done, added a note about having separate walets.
  4. in doc/psbt.md:111 in 9eb20b5097 outdated
    106+move the coins in their entirety to address *Asend*, with no change. Alice
    107+does not need to be involved.
    108+- One of them - let's assume Carol here - initiates the creation. She runs
    109+  `walletcreatefundedpsbt [] {"Asend":V} 0 false {"subtractFeeFromOutputs":[0]}`,
    110+  and gives the produced PSBT *P* to Bob. *P* contains Carol's signature but
    111+  not Bob's.
    


    achow101 commented at 0:18 am on August 11, 2018:
    walletcreatefundedpsbt does not sign. Carol needs to use walletprocesspsbt first.

    sipa commented at 6:15 pm on August 14, 2018:
    Fixed.
  5. fanquake added the label Docs on Aug 11, 2018
  6. in doc/psbt.md:92 in 9eb20b5097 outdated
    85+Alice, Bob, and Carol want to create a 2-of-3 multisig address. They're all using
    86+Bitcoin Core.
    87+
    88+Setup:
    89+- All three call `getnewaddress` to create a new address; call these addresses
    90+  *Aalice*, *Abob*, and *Acarol*.
    


    Sjors commented at 11:45 am on August 11, 2018:
    Maybe suggest all participants use bech32 as their address type as well as the multisig address type, or at least suggest that being consistent will reduce the chances of confusion?

    achow101 commented at 2:32 am on August 14, 2018:
    I don’t think it matters since they only need the pubkeys which getaddressinfo will provide for all address types. Maybe it is needed with addmultisigaddress, but I don’t think this is necessary.

    sipa commented at 6:16 pm on August 14, 2018:
    For the individual getnewaddress calls it doesn’t matter, as they only communicate the pubkey anyway. For addmultisigaddress I’ve added a comment.
  7. Sjors approved
  8. Sjors commented at 11:49 am on August 11, 2018: member
    Concept ACK. This mutlisig explanation is a great start, since that was badly lacking even before PSBT.
  9. promag commented at 0:15 am on August 12, 2018: member
    Concept ACK. Add an entry in doc/README.md, maybe in Miscellaneous section?
  10. meshcollider commented at 1:35 pm on August 14, 2018: contributor
    Concept ACK, although would it be sensible to put it in https://github.com/bitcoin-core/docs instead?
  11. sipa force-pushed on Aug 14, 2018
  12. sipa commented at 6:17 pm on August 14, 2018: member
    @MeshCollider I expect this document will grow in future versions, as more PSBT RPCs are being worked on. By keeping it inside the repo we can keep it in sync with the actual implementation in releases.
  13. Add PSBT documentation 19efc01aec
  14. in doc/psbt.md:104 in 6847abf2be outdated
     99+  addresstype option each, to avoid constructing different versions due to
    100+  differences in configuration.
    101+- They also run `importaddress "Amulti" "" false` to make their wallets treat
    102+  payments to *Amulti* as contributing to the watch-only balance.
    103+- Others can verify the produced address by running
    104+  `createmultisig 2 ["Kalice","Kbob","Kcarol"]`, and expecting *Amulti* as
    


    achow101 commented at 7:13 pm on August 14, 2018:
    Since createmultisig and addmultisigaddress may use different address types, you probably will need to add a comment here that different address types may be needed in order to get the correct address.
  15. sipa force-pushed on Aug 14, 2018
  16. in doc/psbt.md:114 in 19efc01aec
    109+
    110+Later, when *V* BTC has been received on *Amulti*, and Bob and Carol want to
    111+move the coins in their entirety to address *Asend*, with no change. Alice
    112+does not need to be involved.
    113+- One of them - let's assume Carol here - initiates the creation. She runs
    114+  `walletcreatefundedpsbt [] {"Asend":V} 0 false {"subtractFeeFromOutputs":[0], "includeWatching":true}`.
    


    achow101 commented at 7:22 pm on August 14, 2018:
    nit: the preferred method of specifying outputs is to use an array of objects instead of a dictionary. So this should be [{"Asend":V}]
  17. achow101 commented at 7:22 pm on August 14, 2018: member
    utACK 19efc01aec6b0d8750413fa1b721e04aaecf8f73
  18. laanwj commented at 9:33 am on August 16, 2018: member
    Looks good to me, thanks a lot for adding documentation! utACK
  19. laanwj merged this on Aug 21, 2018
  20. laanwj closed this on Aug 21, 2018

  21. laanwj referenced this in commit 2df11322fa on Aug 21, 2018
  22. fanquake referenced this in commit 5d41561702 on Dec 13, 2018
  23. fanquake referenced this in commit ddd008dbef on Dec 28, 2018
  24. MarcoFalke referenced this in commit 16521ce086 on Dec 30, 2018
  25. deadalnix referenced this in commit f997599463 on Oct 5, 2020
  26. PastaPastaPasta referenced this in commit fcfbe2c27a on Jun 27, 2021
  27. PastaPastaPasta referenced this in commit c49cf36473 on Jun 28, 2021
  28. PastaPastaPasta referenced this in commit 0f2a0dbafe on Jun 29, 2021
  29. PastaPastaPasta referenced this in commit 406296133e on Jun 29, 2021
  30. PastaPastaPasta referenced this in commit 2dd594b760 on Jun 29, 2021
  31. PastaPastaPasta referenced this in commit 357ae908e3 on Jun 29, 2021
  32. PastaPastaPasta referenced this in commit 3e8a386613 on Jun 29, 2021
  33. PastaPastaPasta referenced this in commit 2a104b15e5 on Jul 18, 2021
  34. PastaPastaPasta referenced this in commit cb839641bb on Jul 18, 2021
  35. PastaPastaPasta referenced this in commit 88883b772f on Jul 19, 2021
  36. MarcoFalke locked this on Sep 8, 2021

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-12-19 06:12 UTC

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