rust-bitcoin / rust-bitcoin/rust-miniscript

Taproot keysigning is confusing and the API is unhelpful

Open
#744 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

Right now in our Satisfier API we have a lookup_tap_key_spend_sig method which takes no arguments and returns an Option<Signature>.

The premise, I guess, is that there is only one valid key that can sign a keyspend and the satisfier should know this so there's no need to pass in any extra context.

Well, when developing software you might not know the key, at least initially, because

  • The policy compiler will pick a sorta-random key from your policy to be the keyspend key, and it doesn't tell you which one it picks, so you need to know that it does this and then inspect the resulting descriptor
  • The key in the policy isn't even the key that you sign with. You need to tweak the key in the policy.

This would be greatly improved by the API providing a Pk and maybe also a TweakedPublicKey and maybe even the taptweak? And the docs should be improved to explain these things.

In general I feel the satisfier API could be greatly improved to provide more context and information to the satisfier.

Related to #742

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Satisfier API documentation for lookup_tap_key_spend_sig and the discussion in related issue #742. Clarify which key and tweak context the API should expose, then define the documentation changes needed to explain policy-selected and tweaked keys. Done means the API proposal and documentation scope are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.