Hans Schmidt :  Oct 25th 2018

hans_schm1dt@protonmail.com


Anatomy of a Ravencoin Asset Transaction Script
(creation or transfer)

*Note: Applies for asset creation and asset transfer transactions. See notes below for asset reissue transactions*


Update 2021-06-02:

This page describes the encoding within a Ravencoin Asset Transaction Script. Such a script is always appended to the scriptPubKey in an output structure of a transaction.

For more context and examples of how a complete transaction is constructed, please look HERE.


EXAMPLE HEX:c03872766e7105544553545900743ba40b00000008010122122086d85921a971bab5d727b ca0feb2a3f1336c4c5bf0453cc4c0104984c8cecfeb75

EXAMPLE ASM:OP_RVN_ASSET 72766e 71 05 5445535459 00743ba40b000000 08 01 01 22 122086d85921a971bab5d727bca0feb2a3f1336c4c5bf0453cc4c0104984c8cecfeb OP_DROP

Description Value
OP_RVN_ASSET c0
Bytelength of script(1 or 2 bytes) 38
Asset_type Header(rvn) 72766e
Asset_type (transfer(t)=74 or new(q)=71 or owner(o)=6f) 74
Bytelength of Asset_Name(1 byte) 05
Asset_Name (up to 31 bytes: 30 for normal, 31 for ownership) 5445535459
8 Bytes of Little Endian hex: Amount of assets in satoshis 00743ba40b000000
Divisible by (1 byte) range(00..08) units
08
is reissueable (1 byte) (01 yes: 00 no) 01
has ipfs (1 byte) (01 yes: 00 no) 01
IPFS hash decoded from base58 to hex 122086d85921a971bab5d727bca0feb
2a3f1336c4c5bf0453cc4c0104984c8cecfeb
OP_DROP 75

So in this example we have an OP_RVN_ASSET with a total bytelength of 38 bytes, with a transaction type rvnt (asset transfer).

The Bytelength of the Asset_Name is 5 and the Asset_Name is TESTY. The amount of the transaction is 500.

The Asset is divisible by up to 8 units(decimal places), and the Asset is marked as reissuable.

The Asset has an IPFS hash, of 34 bytes in length, and the base58 encoded hash is QmXR2gRJnYHFaYvSCKEy6mPeJAsTN8ab7AvGZeNRbycnXL.

Anatomy of a Ravencoin Asset Reissue Transaction Script *For reissue transactions the format is identical up until and including the encoded amount (qty) in satoshis.*
Description Value
OP_RVN_ASSET c0
Bytelength of script(1 byte) 38
Asset_type Header(rvn) 72766e
Asset_type reissue(r) =72 72
Bytelength of Asset_Name(1 byte) 05
Asset_Name (up to 31 bytes: 30 for normal, 31 for ownership) 5445535459
8 Bytes of Little Endian hex: Amount of assets in satoshis 00743ba40b000000
Divisible by (1 byte) range(00..08) units 08  note: FF is used to indicate no change in units
is reissueable (1 byte) (01 yes: 00 no) 01
new IPFS hash decoded from base58 to hexif changed (34 bytes)  
122086d85921a971bab5d727bca0feb
2a3f1336c4c5bf0453cc4c0104984c8cecfeb
OP_DROP 75

I am not 100% certain this is correct for all cases


Copyright 2018 by Hans Schmidt