Hans Schmidt : May
22 2022 |
hans_schm1dt@protonmail.com |
This page describes the encoding of a
Ravencoin Asset Script. Asset scripts are used to create an asset, transfer an asset, modify data associated with an asset, or modify the behavior of an asset. An asset script is always placed into one of the output structures of a transaction, with the value of that output set at value=0. Usually the asset script is appended to a bitcoin-style scriptPubKey in the output. There are, however, some asset scripts (called nullasset scripts) which are placed into an output which has no bitcoin-style scriptPubKey at all. For more context and examples of how a complete transaction is constructed, please look HERE. |
Description | Length
|
Hex Value Example |
---|---|---|
OP_RVN_ASSET | 1 byte |
c0 |
Bytelength of script | 1 byte |
0c |
Asset_type Header("rvn" in ASCII) | 3 bytes |
72766e |
Asset operation type: owner(o)=6f | 1 byte |
6f |
Bytelength of Asset_Name | 1 byte |
05 |
Asset_Name: (root_asset! is the owner asset for root_asset) | >=3 and <=30 bytes not including the owner asset ! | |
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
Either: a) The number (#) of bytes below not counting OP_DROP (if #<=75) or b) 0x4c followed by the number (#) of bytes below not counting OP_DROP (if #>75) |
1 or 2
bytes |
48 |
||||||
Asset_type Header("rvn" in ASCII) | 3 bytes |
72766e | ||||||
Asset operation type: new(q)=71 | 1 byte |
71 | ||||||
Bytelength of Asset_Name | 1 byte |
05 | ||||||
Asset_Name: root_asset, root_asset!, root/subasset, root#unique, $restricted_asset, #qualifier, #qualifier/#subqualifier |
>=3 and <=30 bytes not including the owner asset ! | |||||||
8 Bytes of Little Endian hex: "Amount" of assets in satoshis | 8 bytes |
00743ba40b000000 | ||||||
Divisible-by range: (00..08) units |
1 byte |
08 | ||||||
is reissueable (01 yes: 00 no) | 1 byte |
01 | ||||||
Has userdata (01 yes: 00 no) | 1 byte |
01 | ||||||
|
optional variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
Either: a) The number (#) of bytes below not counting OP_DROP (if #<=75) or b) 0x4c followed by the number (#) of bytes below not counting OP_DROP (if #>75) |
1 or 2
bytes |
38 | ||||||
Asset_type Header("rvn" in ASCII) | 3 bytes |
72766e | ||||||
Asset operation type: transfer(t)=74 | 1 byte |
74 | ||||||
Bytelength of Asset_Name | 1 byte |
05 | ||||||
Asset_Name: root_asset, root_asset!, root/subasset, root#unique, $restricted_asset, #qualifier, #qualifier/#subqualifier |
>=3 and <=30 bytes not including the owner asset ! | |||||||
8 Bytes of Little Endian hex: Amount of assets in satoshis | 8 bytes |
00743ba40b000000 | ||||||
|
optional; variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
userdata Expiry Time (UTC Unix timestamp format) |
optional; 8 bytes |
00000000625a168a |
||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
Either: a) The number (#) of bytes below not counting OP_DROP (if #<=75) or b) 0x4c followed by the number (#) of bytes below not counting OP_DROP (if #>75) |
1 or 2
bytes |
38 | ||||||
Asset_type Header("rvn" in ASCII) | 3 bytes |
72766e | ||||||
Asset operation type: reissue(r)=72 | 1 byte |
71 | ||||||
Bytelength of Asset_Name | 1 byte |
05 | ||||||
Asset_Name: root_asset, root_asset!, root/subasset, root#unique, $restricted_asset, #qualifier, #qualifier/#subqualifier |
>=3 and <=30 bytes not including the owner asset ! | |||||||
8 Bytes of Little Endian hex: Amount of assets in satoshis | 8 bytes |
00743ba40b000000 | ||||||
Divisible-by range: (00..08) units |
1 byte |
08 | ||||||
is reissueable (01 yes: 00 no) | 1 byte |
01 | ||||||
Has userdata (01 yes: 00 no) | 1 byte |
01 | ||||||
|
optional; variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
NullAssetTxDataScript identifier |
1 byte |
14 |
||||||
Hash-160 Address |
20
bytes |
|||||||
Bytelength of Script | 1 byte |
0b |
||||||
Bytelength of Qualifier Name |
1 byte |
05 | ||||||
Qualifier Name (#qualifier or #qualifier/#subqualifier) | >=3 and <=30 bytes not including the owner asset ! | |||||||
Operation (1=Add, 0=Remove) |
1 bytes |
01 | ||||||
|
optional; variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
userdata Expiry Time (UTC Unix timestamp format) | optional; 8 bytes |
00000000625a168a | ||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
NullAssetTxDataScript identifier |
1 byte |
14 |
||||||
Hash-160 Address |
20
bytes |
|||||||
Bytelength of Script | 1 byte |
0b |
||||||
Bytelength of Restricted Asset Name |
1 byte |
05 | ||||||
Restricted Asset Name ($restricted_asset) | >=3 and <=30 bytes not including the $ | |||||||
Operation (1=Freeze, 0=Unfreeze) |
1 bytes |
01 | ||||||
|
optional; variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
userdata Expiry Time (UTC Unix timestamp format) | optional; 8 bytes |
00000000625a168a | ||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example | ||||||
---|---|---|---|---|---|---|---|---|
OP_RVN_ASSET | 1 byte |
c0 | ||||||
NullGlobalRestrictionAssetTxDataScript identifier |
2 bytes |
5050 |
||||||
Bytelength of Script | 1 byte |
0b |
||||||
Bytelength of Restricted Asset Name |
1 byte |
05 | ||||||
Restricted Asset Name ($restricted_asset) | >=3 and <=30 bytes not including the $ | |||||||
Operation (1=Freeze, 0=Unfreeze) |
1 bytes |
01 | ||||||
|
optional; variable (max 34 bytes) |
1220c9ae8712366f46a43e 7403e50d1967f2f068d6f42c c65f742edc0cc1706c109f (equivalent to Qmbuw1XZV8i4uFucmKSSYH7 gGhD5B1B1NPMseh9tp5hgea) |
||||||
userdata Expiry Time (UTC Unix timestamp format) | optional; 8 bytes |
00000000625a168a | ||||||
OP_DROP | 1 byte |
75 |
Description | Length
|
Hex Value Example |
---|---|---|
OP_RVN_ASSET | 1 byte |
c0 |
NullAssetVerifierTxDataScript
identifier |
1 byte |
50 |
Bytelength of Script | 1 byte |
anything except 50 |
Bytelength of VerifierString (<=80 bytes after whitespace and "#"s are removed) | 1 byte |
05 |
VerifierString | <=
80 bytes |
(RED&BLUE)&!GREEN |
OP_DROP | 1 byte |
75 |