-
Notifications
You must be signed in to change notification settings - Fork 137
Description
This issue must be completed first: #1226
This issue proposes a new feature to enhance the asset minting process. It introduces the option for a minter to generate the asset group witness by signing a PSBT using an external signer, independent of tapd. This will enable the minter to securely store the private asset group key in cold storage throughout the minting process.
Batch Minting Overview
At a high level, the current batch minting process involves the following steps:
- The
MintAssetRPC endpoint is called to add a new asset to a minting batch. This batch remains open across multiple calls to this endpoint. - The
SealBatchRPC endpoint is invoked, triggering thetapgarden.ChainPlanter, which generates asset group witnesses where applicable. This step blocks thetapgarden.ChainPlanterinstance until complete. - The
FinalizeBatchRPC endpoint is called, initiating thetapgarden.ChainPlanter. If the batch has not already been sealed, it is sealed at this stage. A newtapgarden.BatchCaretakerstate machine is then started, anchoring the Taproot artifacts to a Bitcoin transaction, which is subsequently broadcast.
If a batch has not been sealed using the SealBatch RPC endpoint then the FinalizeBatch RPC endpoint will call into the same batch sealing routine.
Minimal Solution
A minimal solution could take the following approach:
-
Extend the
Seedling(asset minting request) to include a new flag when passed into theMintAssetRPC endpoint. This flag indicates that the asset group witness should be generated using the new external PSBT signing flow. This ensures that if theFinalizeBatchRPC endpoint is called prematurely, the default batch sealing process fails, avoiding unintended behavior. -
Introduce a new RPC endpoint,
QuerySealBatchPSBTs, which returns all PSBTs required for the minter to externally sign and generate asset group witnesses for each flagged seedling in the batch. This endpoint should send a new request type totapgarden.ChainPlanterwhich will need to be refactored where relevant. The endpoint name seems appropriate, as "seal" appears to refer almost exclusively to asset witness creation based on the code. -
The signed PSBTs are then submitted by the signer through the
SealBatchRPC endpoint. The endpoint uses the newly generated group witnesses to seal the batch as usual.
See also this LND signing gist: https://gist.github.com/guggero/569241aa9fec57e287101187bd28d1c5
Metadata
Metadata
Assignees
Labels
Type
Projects
Status