LedgerHQ / app-bitcoin-new

Modern Bitcoin Application based on PSBT and Descriptors
Apache License 2.0
93 stars 69 forks source link

Allow using compressed public keys and x-only pub keys in Taproot policies with tapscripts #268

Closed crypto7world closed 2 months ago

crypto7world commented 2 months ago

Linked to #267

Context

I'm developing a Taproot Bitcoin wallet designed to allow on-chain backup access / inheritance of bitcoins. Kind of what Liana does, but in a full Taproot manner.

A possible descriptor of the wallet at some point in time could be this one (this is the external descriptor):

tr([44990794/86'/1'/6']tpubDDpFTt9TRJhoEfbwqVPcRBqKFUvCaYWShm9Ga1Kpefg4XWU8Pe2V12S2LYGQgLThAsJCMb4GNJggLApWdptZhX5DcMtQw1XiToM2RC2E2ML/0/*,and_v(v:pk([99ccb69a/86'/1'/1751476594'/0/0]02ee39732e7f49cf4c9bd9b3faec01ed6f62a668fef33fbec0f2708e4cebf5bc9b),and_v(v:older(8640),after(1751450400))))

It allows a key-path spend at any time from the owner keys under [44990794/86'/1'/6'] and after a fixed date (and if the UTXO is older than 8640 blocks or ~60 days) it allows spending using a backup key [99ccb69a/86'/1'/1751476594'/0/0].

As per the wallet.md document specification, I should be able to register this policy:

tr([44990794/86'/1'/6']tpubDDpFTt9TRJhoEfbwqVPcRBqKFUvCaYWShm9Ga1Kpefg4XWU8Pe2V12S2LYGQgLThAsJCMb4GNJggLApWdptZhX5DcMtQw1XiToM2RC2E2ML/**,and_v(v:pk([99ccb69a/86'/1'/1751476594'/0/0]02ee39732e7f49cf4c9bd9b3faec01ed6f62a668fef33fbec0f2708e4cebf5bc9b),and_v(v:older(8640),after(1751450400))))

Problem

Unfortunately there is currently an "implementation specific limitation" that prevent the use of compressed public keys in the policy.

Expected behavior

We should be able to use single public keys in the Tapscripts, it would open more variety of Taproot usecases to be supported by Ledger.

Final note

I don't currently know if it is a hard-limitation or just something that has been pushed down on the roadmap and I'm curious to know when, if at all, this feature is planned to be shipped.

bigspider commented 2 months ago

Closing, as already answered in #267. No need to open multiple issues.