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

Single-sig P2TR pkScript/sigScript functions #304

Open
benma opened this issue Nov 15, 2021 · 9 comments
Open

Single-sig P2TR pkScript/sigScript functions #304

benma opened this issue Nov 15, 2021 · 9 comments

Comments

@benma
Copy link
Contributor

benma commented Nov 15, 2021

Are there plans for this?

https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki

@jgriffiths
Copy link
Contributor

Hi @benma

We do have plans for supporting receiving and spending from taproot outputs. However at this stage we are still in the planning stage of how we will structure our multisig trees, and the anonymity set is very small, so this isn't our highest priority at present.

@ChristopherA
Copy link

Any updates on the roadmap for P2TR support for libwally? Is there a fork somewhere that has a feature branch starting work on it?

We have multiple wallet projects, both our own and others in the Airgapped Wallet Community stalled on this.

/cc @jesseposner @jonasnick @wolfmcnally

@jgriffiths
Copy link
Contributor

Hi @ChristopherA long time no chat, hope you are well.

Wally supports paying to P2TR outputs already, I assume you mean support for receiving and spending from taproot inputs. Its likely that we will support taproot through descriptors when that is merged, along with whatever support functions make sense in that context. Until very recently we had no resources for wally development; that situation should have improved now.

Currently I'm planning to fix the build issues, add PSBT v2 support and then complete descriptor/miniscript support, at which point the missing parts for TR can be assessed.

@greenaddress
Copy link
Contributor

@instagibbs could you do a PR to cover this use case as a basis for what you will use/need in core lightning?

There may be more needed I didn't check yet

@instagibbs
Copy link
Contributor

#351 to track the proposed support

@jgriffiths
Copy link
Contributor

jgriffiths commented Dec 12, 2022

@instagibbs I think we should add a function to convert a non-neutered BIP32 ext_key to a keyspend only key, i.e. implement:

internal_key:       lift_x(derived_key)
32_byte_output_key: internal_key + int(HashTapTweak(bytes(internal_key)))G

From BIP86 - something like bip32_key_get_keyspend_private_key/bip32_key_get_keyspend_public_key.

We should probably also expose x-only key conversion and fetching from an ext_key. Following that we have all the primitives for singlesig keyspend only TR wallets except schnorr sigs.

@instagibbs
Copy link
Contributor

Sounds right, I implemented the rest inside of CLN directly, such as the BIP86-like committment https://github.com/instagibbs/lightning/blob/eltoo_support/bitcoin/signature.c#L251

and regular BIP340 signing: https://github.com/instagibbs/lightning/blob/eltoo_support/bitcoin/signature.c#L141

@instagibbs
Copy link
Contributor

notice all my interfaces are using compressed keys; xonly keys are only used "just in time" when required for blockchain usage.

@instagibbs
Copy link
Contributor

https://github.com/ElementsProject/libwally-core/releases/tag/release_0.9.0 now has support for PSBT signing of keyspends, in addition to more general sighash support of tapscript.

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 a pull request may close this issue.

5 participants