decoderawtransaction with issuetoken

+3 votes
1. Use createrawsendfrom to create a issuetoken transaction.

createrawsendfrom 12tDDPm72xRFqmQ96jJtqT4cCGwTHNVsz2A4HB '{"12tDDPm72xRFqmQ96jJtqT4cCGwTHNVsz2A4HB":{"issuetoken":{"asset":"a6201c2e4127","token":"nft1","qty":1}}}' '[]'

2. Decode raw transaction

decoderawtransaction 01000000018c66ccc136aec20567502d63af86863b6ee5d0a9ef3e715baec6a911ec4ad7dd0200000000ffffffff0200000000000000006776a9140dee8693d58dd6fb03aeabc8123037d9f302
867d88ac1c73706b741f7a9868936f3f8df401999414a8f63b0100000000000000752e73706b6c000b208c66ccc136aec20567502d63af86863b6ee5d0a9ef3e715baec6a911ec4ad7dd000a046e667431750000000000000000197
6a9140dee8693d58dd6fb03aeabc8123037d9f302867d88ac00000000

3. How do I tell from the output that this is a issue token transaction?

"vout" : [
{
"value" : 0,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dee8693d58dd6fb03aeabc8123037d9f302867d OP_EQUALVERIFY OP_CHECKSIG 73706b741f7a9868936f3f8df401999414a8f63b0100000000000000 OP_DROP 73706b6
c000b208c66ccc136aec20567502d63af86863b6ee5d0a9ef3e715baec6a911ec4ad7dd000a046e667431 OP_DROP",
"hex" : "76a9140dee8693d58dd6fb03aeabc8123037d9f302867d88ac1c73706b741f7a9868936f3f8df401999414a8f63b0100000000000000752e73706b6c000b208c66ccc136aec20567502d63af86863b
6ee5d0a9ef3e715baec6a911ec4ad7dd000a046e66743175",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"12tDDPm72xRFqmQ96jJtqT4cCGwTHNVsz2A4HB"
]
}
},
{
"value" : 0,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dee8693d58dd6fb03aeabc8123037d9f302867d OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9140dee8693d58dd6fb03aeabc8123037d9f302867d88ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"12tDDPm72xRFqmQ96jJtqT4cCGwTHNVsz2A4HB"
]
}
}
]
asked Jul 19, 2022 by anonymous

2 Answers

0 votes

After the transaction is sent, there will be an "assets" structure in the decode JSON with subfield "type" : "issuetoken". So this can be read very easily.

However as you note, this is not shown in the decoded transaction before it is sent, which is something we will look into addressing.

In the meantime, you can use the following workaround – look in the "asm" field of the output and see if it ends with an OP_DROP, and if the previous item begins with 73706b6c. The labels a new token issuance.

answered Jul 19, 2022 by MultiChain
0 votes

One more thing – this behavior will be improved in version 2.3, to be released shortly. The appropriate "assets" structure will appear in the decode JSON whether the transaction has been sent or not.

answered Jul 21, 2022 by MultiChain
...