Skip to content

psbt: Implement BIP 370 PSBTv2#549

Merged
achow101 merged 15 commits intobitcoin-core:masterfrom
achow101:psbt2
Feb 3, 2022
Merged

psbt: Implement BIP 370 PSBTv2#549
achow101 merged 15 commits intobitcoin-core:masterfrom
achow101:psbt2

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Nov 19, 2021

Implements serialization and usage of PSBTv2 fields.

@achow101 achow101 force-pushed the psbt2 branch 4 times, most recently from 9050271 to 2ac9468 Compare November 23, 2021 04:00
@achow101 achow101 force-pushed the psbt2 branch 2 times, most recently from 6956dc4 to dd00ce8 Compare November 24, 2021 00:35
@achow101 achow101 mentioned this pull request Nov 25, 2021
@achow101 achow101 force-pushed the psbt2 branch 2 times, most recently from 468c642 to b86f144 Compare December 10, 2021 16:32
@achow101 achow101 marked this pull request as ready for review December 10, 2021 16:32
@achow101 achow101 force-pushed the psbt2 branch 2 times, most recently from 695920d to a8ebd34 Compare February 2, 2022 17:03
@achow101 achow101 merged commit 0d846a6 into bitcoin-core:master Feb 3, 2022
achow101 added a commit that referenced this pull request Feb 28, 2022
daeec1d ledger: Try legacy protocol when unable to sign multisigs (Andrew Chow)
711e6ba ledger: P2WSH display is also not supported (Andrew Chow)
6df9c1b ledger: Detect when a ledger is not in a Bitcoin app (Andrew Chow)
edbb7c0 ledger: document multisig limitation (Andrew Chow)
6b8381e tests: Use external keys for some multisigs (Andrew Chow)
4f223a5 test: Include xpubs in psbt (Andrew Chow)
f3f20e0 tests, ledger: Test multisigs (Andrew Chow)
ac66cbc tests: additional speculos automation things (Andrew Chow)
dffd014 ledger: Support multisigs (Andrew Chow)
ae2adb5 key: Add from_bytes to ExtendedKey (Andrew Chow)
ef1cf9d docs: Document Taproot signing (Andrew Chow)
3953000 tests: Don't rely on coin selection for signtx tests (Andrew Chow)
cb6b352 tests: Use --chain test more consistently (Andrew Chow)
30b42e4 ci: Test ledger legacy api (Andrew Chow)
3b0680d tests: Test Taproot on Ledger (Andrew Chow)
8536786 ledger: Remove btchip (Andrew Chow)
c154cf7 ledger: Use ledger_bitcoin rather than btchip (Andrew Chow)
b645164 ledger_bitcoin: Change LegacyClient.sign_psbt to return pubkeys too (Andrew Chow)
23baff5 ledger_bitcoin: Modifications to get_wallet_address for our legacy usage (Andrew Chow)
50e2d01 hwwclient: Add Chain as a parameter to constructor (Andrew Chow)
5aad268 key: Add helpers for determing addrtype and standard paths (Andrew Chow)
26a1ccc ledger_bitcoin: Optionally allow HID path in TransportClient (Andrew Chow)
57d5c2f ledgercomm: Add the option to pass in HID path (Andrew Chow)
15e5427 ledgercomm: Use relative imports of itself (Andrew Chow)
88235d6 Include ledgercomm library (Andrew Chow)
b709028 ledger_bitcoin: Fix sign_psbt for our implementation of PSBTv2 (Andrew Chow)
e34f6fd Add ledger_bitcoin library (Andrew Chow)

Pull request description:

  The 2.0 version of the Ledger Bitcoin app uses a completely new protocol which utilizes PSBTv2 and descriptors(ish). Additionally, this new version supports signing Taproot inputs.

  This PR adds support for using the new protocol when the app major version number is detected to be greater than or equal to 2. Ledger has provided a python library in https://github.com/LedgerHQ/app-bitcoin-new/tree/master/bitcoin_client. Given that many components of this library are copied from HWI itself, it doesn't make sense to include the entire thing. Additionally, as we already have access to the device via btchip-python, there is no need to use any of the transport things. So instead, parts of the library are copied to `hwilib/devices/ledgerbitcoin2` and modifications are made to use relative imports to common HWI components. Our copy of btchip-python is slightly modified to work with the new version as well, particularly with returning the status code rather than consuming it when receiving APDU responses.

  As the new protocol uses PSBTv2, this PR also requires #549 for PSBTv2 itself.

  As v2.0.0 supports Taproot, this branch is based on #544 so that Taproot can be supported.

ACKs for top commit:
  Sjors:
    re-ACK daeec1d

Tree-SHA512: 8f956622b439afe15be0c169e02d852d2ec221af9c75a70819956f78a9a8c4c3a7b555d0de4f3fd4df61bb862abda68505c5c2297a13f5c310e200d123cd609b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant