-
Notifications
You must be signed in to change notification settings - Fork 120
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
Part 1: Asset Minting with V1 Asset Group Key and Chantools Cold Storage Support #1272
base: main
Are you sure you want to change the base?
Conversation
c766bbe
to
cabfd1d
Compare
Pull Request Test Coverage Report for Build 12709993838Details
💛 - Coveralls |
Introduce a new method to support future usage in the tapgarden package.
Refactored the `FundBatch` method to use a general return type, `FundBatchResp`. This change improves code health and allows for easier extension by enabling the state machine to return additional fields in the future.
Introduced a `newVerboseBatch` function to create a verbose mint batch from a regular mint batch. This functionality is extracted from the existing list batch logic as part of a refactor. The function will be used in a future commit to include a verbose batch in the response of the FundBatch RPC endpoint.
Added comments to the planter function `buildGroupReqs` to improve code readability and explain the logic more clearly.
Introduce a guide outlining the workflow for using external group keys. Future commits in this PR will add features and implement changes to support the described workflow.
The FundBatch RPC endpoint now returns a verbose batch instead of a regular batch. The verbose batch includes additional asset group information required by external signers.
Added a new `ExternalKey` message type to represent an external key used for deriving and managing HD wallet addresses per BIP-86. A new field of type `ExternalKey` was added to the `MintAsset` message, enabling the specification of an external key when a mint request is added to the batch.
Introduce a new `ExternalKey` type and add external key fields of this type to `Seedling` and `GroupKeyRequest`.
Add unmarshalling support for the new `Asset.ExternalGroupKey` field in the `MintAsset` RPC endpoint. Also populate the external key in the `Seedling` instance.
Add an `external_key` field to the `GroupKeyRequest` RPC message, which will also make it available in the `UnsealedAsset` RPC message. Include marshalling functionality for the new field.
Added the following command line minting flags: - group_key_xpub - group_key_derivation_path - group_key_fingerprint
Updated the documentation for the `MintAsset.group_tapscript_root` field to clarify its purpose: it now represents the custom tapscript subtree root for V1 group key reveals and serves as the tapscript tree root for V0 group key reveals.
Add the `CustomTapscriptRoot` field to both the `GroupKey` and `GroupKeyRequest` types. This field stores the user-defined custom tapscript subtree root, which is committed to by the asset group key. Update the `buildGroupReqs` function to leverage this new field when constructing group key requests for generating asset group keys.
Introduce a new `GroupKeyVersion` type to represent the group key version in `asset.GroupKey` and `asset.GroupKeyRequest`. Add a `version` field to both `asset.GroupKey` and `asset.GroupKeyRequest`, with logic to populate it. Enhance the verification process by adding version-specific checks.
Update `GroupKeyRequest` methods to support the generation of version 1 (V1) group keys.
Add a new PSBT field to the `UnsealedAssets` RPC message type, which contains the byte-serialized PSBT equivalent of the group virtual transaction for unsealed assets. As a result, the `FundBatch` and `ListBatches` RPC endpoints now return group virtual PSBTs. Include logic to generate the group virtual PSBT. The PSBT is unsigned and is provided to allow signing with an external cold private key.
8af293f
to
4666b23
Compare
1e543e2
to
e61d638
Compare
I think these are the necessary changes. This PR can't really be made smaller in any meaningful way. |
Extended the `asset_groups` database table with two new columns: `rows_version` and `custom_subtree_root`. These fields are required to store and retrieve new GroupKey data for use during mint proof generation, where the group key reveal is formulated.
Ensured the `version` and `custom_subtree_root` columns are populated with the appropriate GroupKey data when storing a group key in the database.
Implemented parsing logic for the `version` and `custom_subtree_root` fields when reading from the database.
Added support for group key reveal V1 alongside the existing group key reveal V0 when generating mint proofs.
Adds a test to ensure the new PSBT field introduced in the previous commit can be used to derive a transaction identical to the group virtual transaction.
Update the `build-itest` Makefile target, used as a subcommand during `make itest`, to ensure `chantools` is properly set up for integration tests. Additionally, update `.gitignore` to exclude the `chantools` build directory.
Add a test harness to execute the chantools binary via the command line and parse its output.
Added a new integration test, `testMintExternalGroupKeyChantools`, to verify the ability to mint an asset and generate an asset group signature using chantools with an externally managed signing key.
e61d638
to
c0c6795
Compare
As mentioned during our last call, I’ve updated |
This PR builds on Oli's WIP to demonstrate asset minting using the new V1 asset group key formulation. It integrates
chantools
to mint assets with an external asset group signing key (taproot internal key), offering a viable option for users who wish to keep their asset group signing key in cold storage.A new integration test is included to simulate user behavior by leveraging
chantools
via the command line. The test verifies that the minter can successfully sign an asset into the asset group using the external asset group signing key.Notes for Reviewers
Work which will be included in a future PR(s), ordered by most important first:
ExternalKey
type and methods (draft: Add unit test for method ExternalKey.PubKey #1284)PendingAssetGroup.PSBT
.