-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
c766bbe
to
cabfd1d
Compare
Pull Request Test Coverage Report for Build 12808414882Details
💛 - Coveralls |
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. |
e61d638
to
c0c6795
Compare
As mentioned during our last call, I’ve updated |
tapdb/sqlc/migrations/000026_asset_group_version_customsubtree.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. I have added some small comments throughout.
nit: the commit message of commit a993070 claims the commit populates the external key in the seedling instance, but I don't think that happens in that commit.
I would love to see a itest that tests the re-issuance of an asset with cold minting.
Would also like to see a unit test that tests both the V0 and the V1 flow re GroupTapscriptRoot and a custom tapscript root. Whatever approach we take regarding implicit or explicit flow @Roasbeef suggested, we will end up with two separate flows that are currently not fully covered by unit tests.
tapdb/sqlc/migrations/000026_asset_group_version_customsubtree.up.sql
Outdated
Show resolved
Hide resolved
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.
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.
c4a9222
to
b801f9f
Compare
tapdb/sqlc/migrations/000026_asset_group_version_customsubtree.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, +tACK 🥇
great work!
Extended the `asset_groups` database table with two new columns: `version` and `custom_subtree_root_id`. These fields are required to store and retrieve new GroupKey data for use during mint proof generation, where the group key reveal is formulated. `custom_subtree_root_id` is a foreign key referencing the `root_id` in the `tapscript_roots` table. It links a custom tapscript subtree to the asset group, enabling an upgrade path towards storing user-defined asset group key scripts. This column can be `NULL` when no custom subtree is associated.
Write the group key version and custom subtree root to the database.
Read group key version and custom subtree root 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.
Add a new integration test, `testMintExternalGroupKeyChantools`, to validate minting two assets into the same asset group across two different batches. The test ensures asset group signatures are generated using chantools with an externally managed signing key for each batch.
Add externalKey and customTapscriptRoot arguments to the mock function NewGroupKeyRequestNoErr, enabling them to be specified during testing.
Add TestAssetGroupV1 to verify the ability to store and load an asset group of version 1.
b801f9f
to
5ca4168
Compare
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
.