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

New descriptor type system capable of supporting tapret commitments #62

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dr-orlovsky
Copy link
Member

Some time ago Bitcoin Core wallet introduced output descriptors, which are the way to define a collection of bitcoin transaction output managed by certain wallet.

These descriptors gained traction, since they solved a couple of problems:

  • standard way of declaring multisig wallets with extended keys
  • interoperability with other wallet software (wallet export-import)
  • backups of the complex wallets.

Descriptors were extended with a miniscript - a language which can be used in some parts of the descriptors to deterministically define a complex bitcoin scripts and satisfy them in an automatic way. While miniscript has unlocked wallets beyond simple multisigs (but also having timelocks etc) and for sure has provided utility of automatic satisfaction for complex scripts (much better PSBT signers for instance), it doesn't cover all of the cases required:

  • some parts of descriptors can't be represented with miniscript (for instance key-path spending conditions in taproot, future leafscript versions etc);
  • it doesn't work well with descriptors for all existing forms of bitcoin scripts (for instance, all existing lightning network standard scripts are not covered);
  • it has proven to be still highly unstable with a frequent breaking changes introduced into the instruction set and their compillation.

Taproot softfork - and upcoming introduction of MuSig2 standard have also put a requirement to extend descriptors further. Right now there is an ongoing work with a proposal by P. Wuille, which is gradually get implemented in Bitcoin Core.

RGB puts a requirement for another extension - support for tapret commitments, which has not being addressed yet even as a proposal.

There is only a single implementation of descriptor functionality in rust bitcoin world, which is a part of rust-miniscript library, tightly related and build on top of miniscript itself. It has a significant drawbacks which prevent its use in LNP/BP and RGB wallets as of today and tomorrow:

  • It doesn't support lightning network;
  • It doesn't support unspendable and musig fragments for taproot;
  • The API being constantly refactored with each major release, requiring >20 hr of work to update dependent code in LNP/BP repositories;
  • The API is very inefficient and clunky, with a lot of unnecessary errors, panics etc caused by a poor design of how conditions like "uncompressed public key in segwit context" are handled at the level of the core generics.

This PR aims at introducing a new descriptors API supporting both miniscript and non-miniscript bitcoin scripts, future Taproot extensions and Tapret commitments.

@dr-orlovsky dr-orlovsky added help wanted Extra attention is needed question Further information is requested refactoring Refactoring of the existing code epic Epic task labels Nov 18, 2022
@dr-orlovsky dr-orlovsky added this to the v0.9.0 milestone Nov 18, 2022
@dr-orlovsky dr-orlovsky modified the milestones: v0.9.0, v0.10.0 Jan 23, 2023
@dr-orlovsky dr-orlovsky modified the milestones: v0.10.0, v0.11.0 Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Epic task help wanted Extra attention is needed question Further information is requested refactoring Refactoring of the existing code
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant