Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BIP 370 PSBTv2 #21283

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Implement BIP 370 PSBTv2 #21283

wants to merge 35 commits into from

Commits on Jun 13, 2024

  1. Define psbtv2 field numbers

    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    168773d View commit details
    Browse the repository at this point in the history
  2. Change PSBT unknown fields test to use higher numbers

    Previously these tests were using 0x0f as the field number. Changed to
    use 0xf0 instead as it is unlikely we will hit that anytime soon.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a5cb6e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c033e44 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6e1983b View commit details
    Browse the repository at this point in the history
  5. Enforce PSBT version constraints

    With PSBTv2, some fields are not allowed in PSBTv2, and some are
    required. Enforce those.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    576392f View commit details
    Browse the repository at this point in the history
  6. Add PSBT::CacheUnsignedTxPieces

    Fetches the PSBTv2 fields from PSBTv0's global unsigned tx. This allows
    us to pretend everything internally is a PSBTv2 and makes things easier
    to work with.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    3947056 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    58a3f87 View commit details
    Browse the repository at this point in the history
  8. Convert PSBTv0 unsigned tx to PSBTv2 fields

    This is just a convenience and doesn't effect serialization.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    7a5f3ff View commit details
    Browse the repository at this point in the history
  9. Replace PSBT::GetInputUTXO with PSBTInput::GetUTXO

    Now that PSBTInput's track their own prevouts, there's no need for a
    PSBT global function to fetch input specific data.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    518e102 View commit details
    Browse the repository at this point in the history
  10. Add PSBT::ComputeLockTime()

    Function to compute the lock time for the transaction
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    5a65961 View commit details
    Browse the repository at this point in the history
  11. Add PSBT::GetUnsignedTx

    A helper function for getting the unsigned transaction regardless of
    psbt version.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    8d7104c View commit details
    Browse the repository at this point in the history
  12. Add PSBT::GetUniqueID

    The unique ID for PSBTv2 is different from v0. Use this function to get
    the ID without requiring the caller to know the version number.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    6ef4bc8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ad1b22c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    67e60c5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a4a61a3 View commit details
    Browse the repository at this point in the history
  16. Add PSBTInput::GetOutPoint

    Helper for getting the PSBTInput COutPoint
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    169c828 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a6482d2 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    67cf571 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c2b7f15 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    43dca9a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    039ffab View commit details
    Browse the repository at this point in the history
  22. Update RPCs for PSBTv2

    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    d55e0f4 View commit details
    Browse the repository at this point in the history
  23. Update wallet for PSBTv2

    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    9204367 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    0224cde View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    537a969 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    da25e28 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    1348ee1 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    6de3d13 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    78ae8a7 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    22d7a2d View commit details
    Browse the repository at this point in the history
  31. Allow createpsbt and walletcreatefundedpsbt to take psbt version

    Use v2 for other RPCs. For some tests to work, PSBTv0 is set explicitly.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    213f6bc View commit details
    Browse the repository at this point in the history
  32. Use GetUnsignedTx when serializing in PSBTv0

    If we are asked to make a PSBTv0, we may not necessarily have made an
    unsigned transaction. So instead use GetUnsignedTx which will either
    fetch one that already exists, or construct a new one from the stored
    data. Internally we may be storing a PSBTv0 like a PSBTv2, but still
    want to serialize those as v0.
    achow101 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    caa5d36 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    108c3f4 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    89c94a7 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    2619a5f View commit details
    Browse the repository at this point in the history