Skip to content

tapgarden/taprpc: permit providing a tapscript sibling hash for minting calls  #343

@Roasbeef

Description

@Roasbeef

As is today, users can use the vPSBT calls to add arbitrary scripts to encumber tap assets. Right now this needs to be done mostly manually, as we currently only have low-level calls.

In order to allow minting directly into a multi-sig like script on both the Bitcoin and Tap layer, we should allow users to pass in this extra script information either during batch creation, or finalization. With this in place, users would be able to mint directly into an arbitrary on-chain script, as well as tapscript. After this, one missing piece would still be being able to pass in PSBTs into the normal send call, as those PSBT witnesses would be used to carry out the on chain Bitcoin spend.

This issue is meant to track only the minting of assets directly into tapscripts.

Steps To Completion

  • Optionally allow a user to specify a tapscript sibling hash+pre-image for each created asset.

    • For the bitcoin anchor output, assuming we keep with the single batch anchor approach, we can accept tapscript root value in the Finalize call.
    • In order to use this, users would need to create their entire script tree, or just that leaf, then make it into a tap branch with the pre-image also available.
  • During the minting process, rather than use a plain BIP 86 tweak key, instead use that script key as an internal key and commit to the tap script tweaked output key as the tweak key.

    • This portion covers the script on the tap layer.
  • Using the parameters added above, rather than using the internal wallet key solely as the top level key with a blank tapscript sibling, the tapscript sibling specified by the user should be used in place.

With the above, users can mint arbitrary asset to a top-level multi-sig anchor output, and also specify arbitrary scripts for each of the asset leaves created in that batch.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions