Change method of creating token-id.
The method and algorithm of deciding on a token-id is overly complex for no reason.
My suggestion is this;
- make creation of a token be something that is per definition one transaction. That transaction will have a txid which is used as a token-id from then on.
- Have one output have a script which uses OP_TOKEN_CREATE.
Token_create can eat a push where options are added if that is needed.
After the token_create we have a normal p2pkh locking script. - If any other outputs also use the OP_token_create, the token is invalid and maybe we want to reject the transaction.
- OP_RETURN with SLP style metadata should be on this transaction.
- normal funding happens with some inputs and outputs, ignoring the above points.
Again, the token-ID is then a TXID. Any client that wants to know more about a token just has to find the transaction by its transaction ID. TXIDs are per definition unique.