Page MenuHomePhabricator

[ecash-lib] Modify GENESIS payment action to optionally accept group token id
ClosedPublic

Authored by bytesofman on Sep 2 2025, 17:14.

Details

Summary

In adding support for minting NFTs to ecash-wallet, we will need a way for a user to specify this in their Action. Minting an NFT is a GENESIS tx of a SLP_TOKEN_TYPE_NFT1_CHILD. Per spec, the genesis tx must include a utxo of the group token at input index 0. The inclusion of this is what implies the group of this NFT.

So, the user must specify the group, so that ecash-wallet knows what utxo to select.

In Cashtab we only support minting from the group page, so we just have this info. But ecash-wallet will need this info from the user.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman published this revision for review.Sep 2 2025, 17:56

Isn't it worth adding a new action instead ? At least that will make for a cleaner interface

Isn't it worth adding a new action instead ? At least that will make for a cleaner interface

Possibly. I think though it is (slightly) better to keep the API of "actions match their corresponding spec token actions".

Minting an NFT is ... kind of its own thing. But it is technically a GENESIS tx with this one extra input requirement.

I think including validation for this field based on the token type is enough to preserve the interface, and this is included in D18558

The alternative: NftMintAction ... raises its own potential ambiguities. Is this a MINT or a kind of MintAction? no, it's a GENESIS. but yeah it is minting ... but only an NFT...

The "fix" here is probably to develop a cleaner NFT spec on ALP.

This revision is now accepted and ready to land.Sep 3 2025, 15:16