-
Notifications
You must be signed in to change notification settings - Fork 131
minting: fix re-issuing into existing group with external key #1517
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
base: main
Are you sure you want to change the base?
Conversation
This commit fixes two checks that prevented us to re-issue more assets into an existing group using an external group key.
Turns out we didn't really set up the group minting request properly to mint into an existing group. Before this change we'd simply mint a completely new group, using the same external key.
so this is ready to test? |
Yes. |
Pull Request Test Coverage Report for Build 14864958611Details
💛 - Coveralls |
} | ||
|
||
if group.GroupKey.RawKey.PubKey == nil { | ||
return fmt.Errorf("group raw key is " + |
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.
is this the same as
taproot-assets/taprpc/mintrpc/mint.proto
Lines 216 to 226 in 5225722
/* | |
The external group key is an optional field that allows specifying an | |
external signing key for the group virtual transaction during minting. | |
This key enables signing operations to be performed externally, outside | |
the daemon. | |
If this field is set then group_internal_key must be unset, and vice versa. | |
*/ | |
taprpc.ExternalKey external_group_key = 14; | |
err := fn.MapOptionZ( | ||
c.ExternalKey, func(extKey asset.ExternalKey) error { | ||
if group.GroupKey == nil { | ||
return fmt.Errorf("group key is nil") |
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.
is this the same as tweaked_group_key
?
err) | ||
} | ||
|
||
// If it's not an external key, we need to check that we can actually |
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.
so this would mean
taproot-assets/taprpc/mintrpc/mint.proto
Lines 174 to 182 in 5225722
/* | |
The optional key that will be used as the internal key for an asset group | |
created with this asset. | |
If this field is set then external_group_key must be unset, and vice versa. | |
*/ | |
taprpc.KeyDescriptor group_internal_key = 10; | |
@@ -2668,7 +2668,11 @@ func (c *ChainPlanter) prepAssetSeedling(ctx context.Context, | |||
// If a group internal key or tapscript root is specified, emission must | |||
// also be enabled. | |||
if !req.EnableEmission { | |||
if req.GroupInternalKey != nil { | |||
// For re-issuance or regular assets, the group internal key |
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.
do you mean "of" instead of "or"?
// shouldn't be set. It is, however, set for re-issuance with | ||
// an external key, because the internal group key is the key | ||
// we compare the external key against. | ||
if req.GroupInternalKey != nil && req.ExternalKey.IsNone() { | ||
return fmt.Errorf("cannot specify group internal key " + | ||
"without enabling emission") |
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.
https://lightning.engineering/api-docs/api/taproot-assets/mint/mint-asset/ does not really use the word "emission" except in CLI example. can we add "emission" to
taproot-assets/taprpc/mintrpc/mint.proto
Lines 153 to 159 in 5225722
/* | |
If true, then the asset will be created with a group key, which allows for | |
future asset issuance. | |
*/ | |
bool new_grouped_asset = 6; | |
if req.GroupInternalKey != nil { | ||
// For re-issuance or regular assets, the group internal key | ||
// shouldn't be set. It is, however, set for re-issuance with | ||
// an external key, because the internal group key is the key |
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.
generally, I'm confused here what this whole comment means.
Fixes #1515.
Fixes #1516.