Skip to content

Add low level rpc to sign taproot inputs #61

Merged
altafan merged 11 commits intovulpemventures:masterfrom
altafan:low-level-sign
Jan 30, 2024
Merged

Add low level rpc to sign taproot inputs #61
altafan merged 11 commits intovulpemventures:masterfrom
altafan:low-level-sign

Conversation

@altafan
Copy link
Collaborator

@altafan altafan commented Dec 15, 2023

This adds a low level rpc SignPsetWithSchnorrKey that accepts and signs a partial tx.

This pset must contain the account(s) xpub as global field and each taproot input to be signed must specify a TapBip32Derivation field.

Internally, the app service retrieves the account index for a global xpub and contrcuts the derivation path required by the signing wallet to generate the correct private key.

Please @louisinger review.

@altafan altafan requested a review from louisinger December 15, 2023 16:33
@tiero
Copy link
Member

tiero commented Dec 15, 2023

I would add a test to serve as reference/example on how to use the API

value, _ := elementsutil.ValueToBytes(input.ExplicitValue)
prevoutValues := [][]byte{value}

hashForSignature := unsignedTx.HashForWitnessV1(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevoutScripts, prevoutAssets & prevoutValues must include all the transaction inputs data (not only the signed one)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, EplicitAsset & ExplicitValue can't be used. The witness utxo data must be used, see the changes there: altafan#2

@altafan altafan merged commit b109ba0 into vulpemventures:master Jan 30, 2024
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.

3 participants