Dijets Virtual Machine - Transaction Format
This file is meant to be the single source of truth for how we serialize transactions in the Dijets Virtual Machine. This document uses the primitive serialisation format for packing and secp256k1 for cryptographic user identification.
Codec ID#
Some data is prepended with a codec ID (unt16) that denotes how the data should
be deserialized. Right now, the only valid codec ID is 0 (0x00 0x00
).
Transferable Output#
Transferable outputs wrap an output with an asset ID.
What Transferable Output Contains#
A transferable output contains an AssetID
and an Output
.
AssetID
is a 32-byte array that defines which asset this output references.Output
is an output, as defined below. Outputs have four possible types:SECP256K1TransferOutput
,SECP256K1MintOutput
,NFTTransferOutput
andNFTMintOutput
.
Proto Transferable Output Specification#
_10message TransferableOutput {_10 bytes asset_id = 1; // 32 bytes_10 Output output = 2; // size(output)_10}
Transferable Output Example#
Let’s make a transferable output:
AssetID
:0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Output
:"Example SECP256K1 Transfer Output from below"
_22[_22 AssetID <- 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f_22 Output <- 0x000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859,_22]_22=_22[_22 // assetID:_22 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_22 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_22 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_22 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_22 // output:_22 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_22 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_22 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_22 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_22 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_22 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_22 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_22 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_22 0x43, 0xab, 0x08, 0x59,_22]
Transferable Input#
Transferable inputs describe a specific UTXO with a provided transfer input.
What Transferable Input Contains#
A transferable input contains a TxID
, UTXOIndex
AssetID
and an Input
.
TxID
is a 32-byte array that defines which transaction this input is consuming an output from. Transaction IDs are calculated by taking sha256 of the bytes of the signed transaction.UTXOIndex
is an int that defines which UTXO this input is consuming in the specified transaction.AssetID
is a 32-byte array that defines which asset this input references.Input
is an input, as defined below. This can currently only be a SECP256K1 transfer input
Proto Transferable Input Specification#
_10message TransferableInput {_10 bytes tx_id = 1; // 32 bytes_10 uint32 utxo_index = 2; // 04 bytes_10 bytes asset_id = 3; // 32 bytes_10 Input input = 4; // size(input)_10}
Transferable Input Example#
Let’s make a transferable input:
TxID
:0xf1e1d1c1b1a191817161514131211101f0e0d0c0b0a090807060504030201000
UTXOIndex
:5
AssetID
:0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Input
:"Example SECP256K1 Transfer Input from below"
_25[_25 TxID <- 0xf1e1d1c1b1a191817161514131211101f0e0d0c0b0a090807060504030201000_25 UTXOIndex <- 0x00000005_25 AssetID <- 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f_25 Input <- 0x0000000500000000075bcd15000000020000000700000003_25]_25=_25[_25 // txID:_25 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_25 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_25 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_25 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_25 // utxoIndex:_25 0x00, 0x00, 0x00, 0x05,_25 // assetID:_25 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_25 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_25 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_25 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_25 // input:_25 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,_25 0x07, 0x5b, 0xcd, 0x15, 0x00, 0x00, 0x00, 0x02,_25 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07_25]
Transferable Operation#
Transferable operations describe a set of UTXOs with a provided transfer operation. Only one Asset ID is able to be referenced per operation.
What Transferable Operation Contains#
A transferable operation contains an AssetID
, UTXOIDs
, and a TransferOp
.
AssetID
is a 32-byte array that defines which asset this operation changes.UTXOIDs
is an array of TxID-OutputIndex tuples. This array must be sorted in lexicographical order.TransferOp
is a transferable operation object.
Proto Transferable Operation Specs#
_10message UTXOID {_10 bytes tx_id = 1; // 32 bytes_10 uint32 utxo_index = 2; // 04 bytes_10}_10message TransferableOp {_10 bytes asset_id = 1; // 32 bytes_10 repeated UTXOID utxo_ids = 2; // 4 + 36 * len(utxo_ids) bytes_10 TransferOp transfer_op = 3; // size(transfer_op)_10}
Transferable Operation Example#
Let’s make a transferable operation:
AssetID
:0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
UTXOIDs
:UTXOID
:TxID
:0xf1e1d1c1b1a191817161514131211101f0e0d0c0b0a090807060504030201000
UTXOIndex
:5
Op
:"Example Transfer Op from below"
_38[_38 AssetID <- 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f_38 UTXOIDs <- [_38 {_38 TxID:0xf1e1d1c1b1a191817161514131211101f0e0d0c0b0a090807060504030201000_38 UTXOIndex:5_38 }_38 ]_38 Op <- 0x0000000d0000000200000003000000070000303900000003431100000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859_38]_38=_38[_38 // assetID:_38 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_38 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_38 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_38 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_38 // number of utxoIDs:_38 0x00, 0x00, 0x00, 0x01,_38 // txID:_38 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_38 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_38 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_38 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_38 // utxoIndex:_38 0x00, 0x00, 0x00, 0x05,_38 // op:_38 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x02,_38 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07,_38 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x03,_38 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,_38 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61, 0xfb,_38 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8, 0x34,_38 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55, 0xc3,_38 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e, 0xde,_38 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89, 0x43,_38 0xab, 0x08, 0x59,_38]
Outputs#
Outputs have four possible types:
SECP256K1TransferOutput
,
SECP256K1MintOutput
,
NFTTransferOutput
and
NFTMintOutput
.
SECP256K1 Mint Output#
A secp256k1 mint output is an output that is owned by a collection of addresses.
What SECP256K1 Mint Output Contains#
A secp256k1 Mint output contains a TypeID
, Locktime
, Threshold
, and Addresses
.
TypeID
is the ID for this output type. It is0x00000006
.Locktime
is a long that contains the Unix timestamp that this output can be spent after. The Unix timestamp is specific to the second.Threshold
is an int that names the number of unique signatures required to spend the output. Must be less than or equal to the length ofAddresses
. IfAddresses
is empty, must be 0.Addresses
is a list of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
Proto SECP256K1 Mint Output Specification#
_10message SECP256K1MintOutput {_10 uint32 typeID = 1; // 04 bytes_10 uint64 locktime = 2; // 08 bytes_10 uint32 threshold = 3; // 04 bytes_10 repeated bytes addresses = 4; // 04 bytes + 20 bytes * len(addresses)_10}
SECP256K1 Mint Output Example#
Let’s make a SECP256K1 mint output with:
TypeID
:6
Locktime
:54321
Threshold
:1
Addresses
:0x51025c61fbcfc078f69334f834be6dd26d55a955
0xc3344128e060128ede3523a24a461c8943ab0859
_28[_28 TypeID <- 0x00000006_28 Locktime <- 0x000000000000d431_28 Threshold <- 0x00000001_28 Addresses <- [_28 0x51025c61fbcfc078f69334f834be6dd26d55a955,_28 0xc3344128e060128ede3523a24a461c8943ab0859,_28 ]_28]_28=_28[_28 // typeID:_28 0x00, 0x00, 0x00, 0x06,_28 // locktime:_28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_28 // threshold:_28 0x00, 0x00, 0x00, 0x01,_28 // number of addresses:_28 0x00, 0x00, 0x00, 0x02,_28 // addrs[0]:_28 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_28 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_28 0x6d, 0x55, 0xa9, 0x55,_28 // addrs[1]:_28 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_28 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_28 0x43, 0xab, 0x08, 0x59,_28]
SECP256K1 Transfer Output#
A secp256k1 transfer output allows for sending a quantity of an asset to a collection of addresses after a specified Unix time.
What SECP256K1 Transfer Output Contains#
A secp256k1 transfer output contains a TypeID
, Amount
, Locktime
, Threshold
, and Addresses
.
TypeID
is the ID for this output type. It is0x00000007
.Amount
is a long that specifies the quantity of the asset that this output owns. Must be positive.Locktime
is a long that contains the Unix timestamp that this output can be spent after. The Unix timestamp is specific to the second.Threshold
is an int that names the number of unique signatures required to spend the output. Must be less than or equal to the length ofAddresses
. IfAddresses
is empty, must be 0.Addresses
is a list of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
Proto SECP256K1 Transfer Output Specification#
_10message SECP256K1TransferOutput {_10 uint32 typeID = 1; // 04 bytes_10 uint64 amount = 2; // 08 bytes_10 uint64 locktime = 3; // 08 bytes_10 uint32 threshold = 4; // 04 bytes_10 repeated bytes addresses = 5; // 04 bytes + 20 bytes * len(addresses)_10}
SECP256K1 Transfer Output Example#
Let’s make a secp256k1 transfer output with:
TypeID
:7
Amount
:12345
Locktime
:54321
Threshold
:1
Addresses
:0x51025c61fbcfc078f69334f834be6dd26d55a955
0xc3344128e060128ede3523a24a461c8943ab0859
_31[_31 TypeID <- 0x00000007_31 Amount <- 0x0000000000003039_31 Locktime <- 0x000000000000d431_31 Threshold <- 0x00000001_31 Addresses <- [_31 0x51025c61fbcfc078f69334f834be6dd26d55a955,_31 0xc3344128e060128ede3523a24a461c8943ab0859,_31 ]_31]_31=_31[_31 // typeID:_31 0x00, 0x00, 0x00, 0x07,_31 // amount:_31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x39,_31 // locktime:_31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_31 // threshold:_31 0x00, 0x00, 0x00, 0x01,_31 // number of addresses:_31 0x00, 0x00, 0x00, 0x02,_31 // addrs[0]:_31 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_31 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_31 0x6d, 0x55, 0xa9, 0x55,_31 // addrs[1]:_31 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_31 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_31 0x43, 0xab, 0x08, 0x59,_31]
NFT Mint Output#
An NFT mint output is an NFT that is owned by a collection of addresses.
What NFT Mint Output Contains#
An NFT Mint output contains a TypeID
, GroupID
, Locktime
, Threshold
, and Addresses
.
TypeID
is the ID for this output type. It is0x0000000a
.GroupID
is an int that specifies the group this NFT is issued to.Locktime
is a long that contains the Unix timestamp that this output can be spent after. The Unix timestamp is specific to the second.Threshold
is an int that names the number of unique signatures required to spend the output. Must be less than or equal to the length ofAddresses
. IfAddresses
is empty, must be 0.Addresses
is a list of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
Proto NFT Mint Output Specification#
_10message NFTMintOutput {_10 uint32 typeID = 1; // 04 bytes_10 uint32 group_id = 2; // 04 bytes_10 uint64 locktime = 3; // 08 bytes_10 uint32 threshold = 4; // 04 bytes_10 repeated bytes addresses = 5; // 04 bytes + 20 bytes * len(addresses)_10}
NFT Mint Output Example#
Let’s make an NFT mint output with:
TypeID
:10
GroupID
:12345
Locktime
:54321
Threshold
:1
Addresses
:0x51025c61fbcfc078f69334f834be6dd26d55a955
0xc3344128e060128ede3523a24a461c8943ab0859
_31[_31 TypeID <- 0x0000000a_31 GroupID <- 0x00003039_31 Locktime <- 0x000000000000d431_31 Threshold <- 0x00000001_31 Addresses <- [_31 0x51025c61fbcfc078f69334f834be6dd26d55a955,_31 0xc3344128e060128ede3523a24a461c8943ab0859,_31 ]_31]_31=_31[_31 // TypeID_31 0x00, 0x00, 0x00, 0x0a,_31 // groupID:_31 0x00, 0x00, 0x30, 0x39,_31 // locktime:_31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_31 // threshold:_31 0x00, 0x00, 0x00, 0x01,_31 // number of addresses:_31 0x00, 0x00, 0x00, 0x02,_31 // addrs[0]:_31 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_31 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_31 0x6d, 0x55, 0xa9, 0x55,_31 // addrs[1]:_31 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_31 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_31 0x43, 0xab, 0x08, 0x59,_31]
NFT Transfer Output#
An NFT transfer output is an NFT that is owned by a collection of addresses.
What NFT Transfer Output Contains#
An NFT transfer output contains a TypeID
, GroupID
, Payload
, Locktime
, Threshold
, and Addresses
.
TypeID
is the ID for this output type. It is0x0000000b
.GroupID
is an int that specifies the group this NFT was issued with.Payload
is an arbitrary string of bytes no long longer than 1024 bytes.Locktime
is a long that contains the Unix timestamp that this output can be spent after. The Unix timestamp is specific to the second.Threshold
is an int that names the number of unique signatures required to spend the output. Must be less than or equal to the length ofAddresses
. IfAddresses
is empty, must be 0.Addresses
is a list of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
Proto NFT Transfer Output Specification#
_10message NFTTransferOutput {_10 uint32 typeID = 1; // 04 bytes_10 uint32 group_id = 2; // 04 bytes_10 bytes payload = 3; // 04 bytes + len(payload)_10 uint64 locktime = 4 // 08 bytes_10 uint32 threshold = 5; // 04 bytes_10 repeated bytes addresses = 6; // 04 bytes + 20 bytes * len(addresses)_10}
NFT Transfer Output Example#
Let’s make an NFT transfer output with:
TypeID
:11
GroupID
:12345
Payload
:NFT Payload
Locktime
:54321
Threshold
:1
Addresses
:0x51025c61fbcfc078f69334f834be6dd26d55a955
0xc3344128e060128ede3523a24a461c8943ab0859
_37[_37 TypeID <- 0x0000000b_37 GroupID <- 0x00003039_37 Payload <- 0x4e4654205061796c6f6164_37 Locktime <- 0x000000000000d431_37 Threshold <- 0x00000001_37 Addresses <- [_37 0x51025c61fbcfc078f69334f834be6dd26d55a955,_37 0xc3344128e060128ede3523a24a461c8943ab0859,_37 ]_37]_37=_37[_37 // TypeID:_37 0x00, 0x00, 0x00, 0x0b,_37 // groupID:_37 0x00, 0x00, 0x30, 0x39,_37 // length of payload:_37 0x00, 0x00, 0x00, 0x0b,_37 // payload:_37 0x4e, 0x46, 0x54, 0x20, 0x50, 0x61, 0x79, 0x6c,_37 0x6f, 0x61, 0x64,_37 // locktime:_37 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_37 // threshold:_37 0x00, 0x00, 0x00, 0x01,_37 // number of addresses:_37 0x00, 0x00, 0x00, 0x02,_37 // addrs[0]:_37 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_37 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_37 0x6d, 0x55, 0xa9, 0x55,_37 // addrs[1]:_37 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_37 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_37 0x43, 0xab, 0x08, 0x59,_37]
Inputs#
Inputs have one possible type: SECP256K1TransferInput
.
SECP256K1 Transfer Input#
A secp256k1 transfer input allows for spending an unspent secp256k1 transfer output.
What SECP256K1 Transfer Input Contains#
A secp256k1 transfer input contains an Amount
and AddressIndices
.
TypeID
is the ID for this input type. It is0x00000005
.Amount
is a long that specifies the quantity that this input should be consuming from the UTXO. Must be positive. Must be equal to the amount specified in the UTXO.AddressIndices
is a list of unique ints that define the private keys that are being used to spend the UTXO. Each UTXO has an array of addresses that can spend the UTXO. Each int represents the index in this address array that will sign this transaction. The array must be sorted low to high.
Proto SECP256K1 Transfer Input Specification#
_10message SECP256K1TransferInput {_10 uint32 typeID = 1; // 04 bytes_10 uint64 amount = 2; // 08 bytes_10 repeated uint32 address_indices = 3; // 04 bytes + 04 bytes * len(address_indices)_10}
SECP256K1 Transfer Input Example#
Let’s make a payment input with:
TypeId
:5
Amount
:123456789
AddressIndices
: [3
,7
]
_18[_18 TypeID <- 0x00000005_18 Amount <- 123456789 = 0x00000000075bcd15,_18 AddressIndices <- [0x00000003, 0x00000007]_18]_18=_18[_18 // type id:_18 0x00, 0x00, 0x00, 0x05,_18 // amount:_18 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_18 // length:_18 0x00, 0x00, 0x00, 0x02,_18 // sig[0]_18 0x00, 0x00, 0x00, 0x03,_18 // sig[1]_18 0x00, 0x00, 0x00, 0x07,_18]
Operations#
Operations have three possible types: SECP256K1MintOperation
, NFTMintOp
, and NFTTransferOp
.
SECP256K1 Mint Operation#
A secp256k1 mint operation consumes a SECP256K1 mint output, creates a new mint output and sends a transfer output to a new set of owners.
What SECP256K1 Mint Operation Contains#
A secp256k1 Mint operation contains a TypeID
, AddressIndices
, MintOutput
, and TransferOutput
.
TypeID
is the ID for this output type. It is0x00000008
.AddressIndices
is a list of unique ints that define the private keys that are being used to spend the UTXO. Each UTXO has an array of addresses that can spend the UTXO. Each int represents the index in this address array that will sign this transaction. The array must be sorted low to high.MintOutput
is a SECP256K1 Mint output.TransferOutput
is a SECP256K1 Transfer output.
Proto SECP256K1 Mint Operation Specification#
_10message SECP256K1MintOperation {_10 uint32 typeID = 1; // 4 bytes_10 repeated uint32 address_indices = 2; // 04 bytes + 04 bytes * len(address_indices)_10 MintOutput mint_output = 3; // size(mint_output_10 TransferOutput transfer_output = 4; // size(transfer_output)_10}
SECP256K1 Mint Operation Example#
Let’s make a secp256k1 mint operation with:
TypeId
:8
AddressIndices
:0x00000003
0x00000007
MintOutput
:"Example SECP256K1 Mint Output from above"
TransferOutput
:"Example SECP256K1 Transfer Output from above"
_36[_36 TypeID <- 0x00000008_36 AddressIndices <- [0x00000003, 0x00000007]_36 MintOutput <- 0x00000006000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c89_36 TransferOutput <- 0x000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859_36]_36=_36[_36 // typeID_36 0x00, 0x00, 0x00, 0x08,_36 // number of address_indices:_36 0x00, 0x00, 0x00, 0x02,_36 // address_indices[0]:_36 0x00, 0x00, 0x00, 0x03,_36 // address_indices[1]:_36 0x00, 0x00, 0x00, 0x07,_36 // mint output_36 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,_36 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_36 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_36 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_36 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_36 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_36 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_36 0x43, 0xab, 0x08, 0x59,_36 // transfer output_36 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_36 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_36 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_36 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_36 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_36 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_36 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_36 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_36 0x43, 0xab, 0x08, 0x59,_36]
NFT Mint Op#
An NFT mint operation consumes an NFT mint output and sends an unspent output to a new set of owners.
What NFT Mint Op Contains#
An NFT mint operation contains a TypeID
, AddressIndices
, GroupID
, Payload
, and Output
of addresses.
TypeID
is the ID for this operation type. It is0x0000000c
.AddressIndices
is a list of unique ints that define the private keys that are being used to spend the UTXO. Each UTXO has an array of addresses that can spend the UTXO. Each int represents the index in this address array that will sign this transaction. The array must be sorted low to high.GroupID
is an int that specifies the group this NFT is issued to.Payload
is an arbitrary string of bytes no longer than 1024 bytes.Output
is not aTransferableOutput
, but rather is a lock time, threshold, and an array of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
Proto NFT Mint Op Specification#
_10message NFTMintOp {_10 uint32 typeID = 1; // 04 bytes_10 repeated uint32 address_indices = 2; // 04 bytes + 04 bytes * len(address_indices)_10 uint32 group_id = 3; // 04 bytes_10 bytes payload = 4; // 04 bytes + len(payload)_10 repeated bytes outputs = 5; // 04 bytes + size(outputs)_10}
NFT Mint Op Example#
Let’s make an NFT mint operation with:
TypeId
:12
AddressIndices
:0x00000003
0x00000007
GroupID
:12345
Payload
:0x431100
Locktime
:54321
Threshold
:1
Addresses
:0xc3344128e060128ede3523a24a461c8943ab0859
_44[_44 TypeID <- 0x0000000c_44 AddressIndices <- [_44 0x00000003,_44 0x00000007,_44 ]_44 GroupID <- 0x00003039_44 Payload <- 0x431100_44 Locktime <- 0x000000000000d431_44 Threshold <- 0x00000001_44 Addresses <- [_44 0xc3344128e060128ede3523a24a461c8943ab0859_44 ]_44]_44=_44[_44 // Type ID_44 0x00, 0x00, 0x00, 0x0c,_44 // number of address indices:_44 0x00, 0x00, 0x00, 0x02,_44 // address index 0:_44 0x00, 0x00, 0x00, 0x03,_44 // address index 1:_44 0x00, 0x00, 0x00, 0x07,_44 // groupID:_44 0x00, 0x00, 0x30, 0x39,_44 // length of payload:_44 0x00, 0x00, 0x00, 0x03,_44 // payload:_44 0x43, 0x11, 0x00,_44 // number of outputs:_44 0x00, 0x00, 0x00, 0x01,_44 // outputs[0]_44 // locktime:_44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_44 // threshold:_44 0x00, 0x00, 0x00, 0x01,_44 // number of addresses:_44 0x00, 0x00, 0x00, 0x01,_44 // addrs[0]:_44 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_44 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_44 0x43, 0xab, 0x08, 0x59,_44]
NFT Transfer Op#
An NFT transfer operation sends an unspent NFT transfer output to a new set of owners.
What NFT Transfer Op Contains#
An NFT transfer operation contains a TypeID
, AddressIndices
and an untyped NFTTransferOutput
.
TypeID
is the ID for this output type. It is0x0000000d
.AddressIndices
is a list of unique ints that define the private keys that are being used to spend the UTXO. Each UTXO has an array of addresses that can spend the UTXO. Each int represents the index in this address array that will sign this transaction. The array must be sorted low to high.NFTTransferOutput
is the output of this operation and must be an NFT Transfer Output. This output doesn’t have theTypeId
, because the type is known by the context of being in this operation.
Proto NFT Transfer Op Specification#
_10message NFTTransferOp {_10 uint32 typeID = 1; // 04 bytes_10 repeated uint32 address_indices = 2; // 04 bytes + 04 bytes * len(address_indices)_10 uint32 group_id = 3; // 04 bytes_10 bytes payload = 4; // 04 bytes + len(payload)_10 uint64 locktime = 5; // 08 bytes_10 uint32 threshold = 6; // 04 bytes_10 repeated bytes addresses = 7; // 04 bytes + 20 bytes * len(addresses)_10}
NFT Transfer Op Example#
Let’s make an NFT transfer operation with:
TypeID
:13
AddressIndices
:0x00000007
0x00000003
GroupID
:12345
Payload
:0x431100
Locktime
:54321
Threshold
:1
Addresses
:0xc3344128e060128ede3523a24a461c8943ab0859
0x51025c61fbcfc078f69334f834be6dd26d55a955
_46[_46 TypeID <- 0x0000000d_46 AddressIndices <- [_46 0x00000007,_46 0x00000003,_46 ]_46 GroupID <- 0x00003039_46 Payload <- 0x431100_46 Locktime <- 0x000000000000d431_46 Threshold <- 00000001_46 Addresses <- [_46 0x51025c61fbcfc078f69334f834be6dd26d55a955,_46 0xc3344128e060128ede3523a24a461c8943ab0859,_46 ]_46]_46=_46[_46 // Type ID_46 0x00, 0x00, 0x00, 0x0d,_46 // number of address indices:_46 0x00, 0x00, 0x00, 0x02,_46 // address index 0:_46 0x00, 0x00, 0x00, 0x07,_46 // address index 1:_46 0x00, 0x00, 0x00, 0x03,_46 // groupID:_46 0x00, 0x00, 0x30, 0x39,_46 // length of payload:_46 0x00, 0x00, 0x00, 0x03,_46 // payload:_46 0x43, 0x11, 0x00,_46 // locktime:_46 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_46 // threshold:_46 0x00, 0x00, 0x00, 0x01,_46 // number of addresses:_46 0x00, 0x00, 0x00, 0x02,_46 // addrs[0]:_46 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_46 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_46 0x6d, 0x55, 0xa9, 0x55,_46 // addrs[1]:_46 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_46 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_46 0x43, 0xab, 0x08, 0x59,_46]
Initial State#
Initial state describes the initial state of an asset when it is created. It contains the ID of the feature extension that the asset uses, and a variable length array of outputs that denote the genesis UTXO set of the asset.
What Initial State Contains#
Initial state contains a FxID
and an array of Output
.
FxID
is an int that defines which feature extension this state is part of. For SECP256K1 assets, this is0x00000000
. For NFT assets, this is0x00000001
.Outputs
is a variable length array of outputs, as defined above.
Proto Initial State Specification#
_10message InitialState {_10 uint32 fx_id = 1; // 04 bytes_10 repeated Output outputs = 2; // 04 + size(outputs) bytes_10}
Initial State Example#
Let’s make an initial state:
FxID
:0x00000000
InitialState
:["Example SECP256K1 Transfer Output from above"]
_23[_23 FxID <- 0x00000000_23 InitialState <- [_23 0x000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859,_23 ]_23]_23=_23[_23 // fxID:_23 0x00, 0x00, 0x00, 0x00,_23 // num outputs:_23 0x00, 0x00, 0x00, 0x01,_23 // output:_23 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_23 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_23 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_23 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_23 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_23 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_23 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_23 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_23 0x43, 0xab, 0x08, 0x59,_23]
Credentials#
Credentials have two possible types: SECP256K1Credential
, and NFTCredential
.
Each credential is paired with an Input or Operation. The order of the
credentials match the order of the inputs or operations.
SECP256K1 Credential#
A secp256k1 credential contains a list of 65-byte recoverable signatures.
What SECP256K1 Credential Contains#
TypeID
is the ID for this type. It is0x00000009
.Signatures
is an array of 65-byte recoverable signatures. The order of the signatures must match the input’s signature indices.
Proto SECP256K1 Credential Specification#
_10message SECP256K1Credential {_10 uint32 typeID = 1; // 4 bytes_10 repeated bytes signatures = 2; // 4 bytes + 65 bytes * len(signatures)_10}
SECP256K1 Credential Example#
Let’s make a payment input with:
TypeID
:9
signatures
:0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1e1d1f202122232425262728292a2b2c2e2d2f303132333435363738393a3b3c3d3e3f00
0x404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5e5d5f606162636465666768696a6b6c6e6d6f707172737475767778797a7b7c7d7e7f00
_34[_34 TypeID <- 0x00000009_34 Signatures <- [_34 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1e1d1f202122232425262728292a2b2c2e2d2f303132333435363738393a3b3c3d3e3f00,_34 0x404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5e5d5f606162636465666768696a6b6c6e6d6f707172737475767778797a7b7c7d7e7f00,_34 ]_34]_34=_34[_34 // Type ID_34 0x00, 0x00, 0x00, 0x09,_34 // length:_34 0x00, 0x00, 0x00, 0x02,_34 // sig[0]_34 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_34 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_34 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_34 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1e, 0x1d, 0x1f,_34 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,_34 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2e, 0x2d, 0x2f,_34 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,_34 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,_34 0x00,_34 // sig[1]_34 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,_34 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,_34 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,_34 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5e, 0x5d, 0x5f,_34 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,_34 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6e, 0x6d, 0x6f,_34 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,_34 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,_34 0x00,_34]
NFT Credential#
An NFT credential is the same as an secp256k1
credential with a
different TypeID. The TypeID for an NFT credential is 0x0000000e
.
Unsigned Transactions#
Unsigned transactions contain the full content of a transaction with only the
signatures missing. Unsigned transactions have four possible types:
CreateAssetTx
,
OperationTx
,
ImportTx
,
and
ExportTx
.
They all embed
BaseTx
, which
contains common fields and operations.
Unsigned BaseTx#
What Base TX Contains#
A base TX contains a TypeID
, NetworkID
, BlockchainID
, Outputs
, Inputs
, and Memo
.
TypeID
is the ID for this type. It is0x00000000
.NetworkID
is an int that defines which network this transaction is meant to be issued to. This value is meant to support transaction routing and is not designed for replay attack prevention.BlockchainID
is a 32-byte array that defines which blockchain this transaction was issued to. This is used for replay attack prevention for transactions that could potentially be valid across network or blockchain.Outputs
is an array of transferable output objects. Outputs must be sorted lexicographically by their serialized representation. The total quantity of the assets created in these outputs must be less than or equal to the total quantity of each asset consumed in the inputs minus the transaction fee.Inputs
is an array of transferable input objects. Inputs must be sorted and unique. Inputs are sorted first lexicographically by theirTxID
and then by theUTXOIndex
from low to high. If there are inputs that have the sameTxID
andUTXOIndex
, then the transaction is invalid as this would result in a double spend.Memo
Memo field contains arbitrary bytes, up to 256 bytes.
Proto Base TX Specification#
_10message BaseTx {_10 uint32 typeID = 1; // 04 bytes_10 uint32 network_id = 2; // 04 bytes_10 bytes blockchain_id = 3; // 32 bytes_10 repeated Output outputs = 4; // 04 bytes + size(outs)_10 repeated Input inputs = 5; // 04 bytes + size(ins)_10 bytes memo = 6; // 04 bytes + size(memo)_10}
Base TX Example#
Let’s make an base TX that uses the inputs and outputs from the previous examples:
TypeID
:0
NetworkID
:4
BlockchainID
:0xffffffffeeeeeeeeddddddddcccccccbbbbbbbbaaaaaaaa9999999988888888
Outputs
:"Example Transferable Output as defined above"
Inputs
:"Example Transferable Input as defined above"
Memo
:0x00010203
_59[_59 TypeID <- 0x00000000_59 NetworkID <- 0x00000004_59 BlockchainID <- 0xffffffffeeeeeeeeddddddddcccccccbbbbbbbbaaaaaaaa9999999988888888_59 Outputs <- [_59 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859_59 ]_59 Inputs <- [_59 0xf1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd15000000020000000700000003_59 ]_59 Memo <- 0x00010203_59]_59=_59[_59 // typeID_59 0x00, 0x00, 0x00, 0x00,_59 // networkID:_59 0x00, 0x00, 0x00, 0x04,_59 // blockchainID:_59 0xff, 0xff, 0xff, 0xff, 0xee, 0xee, 0xee, 0xee,_59 0xdd, 0xdd, 0xdd, 0xdd, 0xcc, 0xcc, 0xcc, 0xcc,_59 0xbb, 0xbb, 0xbb, 0xbb, 0xaa, 0xaa, 0xaa, 0xaa,_59 0x99, 0x99, 0x99, 0x99, 0x88, 0x88, 0x88, 0x88,_59 // number of outputs:_59 0x00, 0x00, 0x00, 0x01,_59 // transferable output:_59 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_59 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_59 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_59 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_59 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_59 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_59 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_59 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_59 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_59 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_59 0x43, 0xab, 0x08, 0x59,_59 // number of inputs:_59 0x00, 0x00, 0x00, 0x01,_59 // transferable input:_59 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_59 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_59 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_59 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_59 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x02, 0x03,_59 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_59 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_59 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_59 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x05,_59 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_59 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07,_59 0x00, 0x00, 0x00, 0x03,_59 // Memo length:_59 0x00, 0x00, 0x00, 0x04,_59 // Memo:_59 0x00, 0x01, 0x02, 0x03,_59]
Unsigned CreateAssetTx#
What Unsigned Create Asset TX Contains#
An unsigned create asset TX contains a BaseTx
, Name
, Symbol
,
Denomination
, and InitialStates
. The TypeID
is 0x00000001
.
BaseTx
Name
is a human readable string that defines the name of the asset this transaction will create. The name is not guaranteed to be unique. The name must consist of only printable ASCII characters and must be no longer than 128 characters.Symbol
is a human readable string that defines the symbol of the asset this transaction will create. The symbol is not guaranteed to be unique. The symbol must consist of only printable ASCII characters and must be no longer than 4 characters.Denomination
is a byte that defines the divisibility of the asset this transaction will create. For example, the DJT token is divisible into billionths. Therefore, the denomination of the DJT token is 9. The denomination must be no more than 32.InitialStates
is a variable length array that defines the feature extensions this asset supports, and the initial state of those feature extensions.
Proto Unsigned Create Asset TX Specification#
_10message CreateAssetTx {_10 BaseTx base_tx = 1; // size(base_tx)_10 string name = 2; // 2 bytes + len(name)_10 name symbol = 3; // 2 bytes + len(symbol)_10 uint8 denomination = 4; // 1 bytes_10 repeated InitialState initial_states = 5; // 4 bytes + size(initial_states)_10}
Unsigned Create Asset TX Example#
Let’s make an unsigned base TX that uses the inputs and outputs from the previous examples:
BaseTx
:"Example BaseTx as defined above with ID set to 1"
Name
:Volatility Index
Symbol
:VIX
Denomination
:2
InitialStates
:"Example Initial State as defined above"
_68[_68 BaseTx <- 0x0000000100000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203_68 Name <- 0x0010566f6c6174696c69747920496e646578_68 Symbol <- 0x0003564958_68 Denomination <- 0x02_68 InitialStates <- [_68 0x0000000000000001000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859,_68 ]_68]_68=_68[_68 // base tx:_68 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04,_68 0xff, 0xff, 0xff, 0xff, 0xee, 0xee, 0xee, 0xee,_68 0xdd, 0xdd, 0xdd, 0xdd,_68 0xcc, 0xcc, 0xcc, 0xcc, 0xbb, 0xbb, 0xbb, 0xbb,_68 0xaa, 0xaa, 0xaa, 0xaa, 0x99, 0x99, 0x99, 0x99,_68 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x01,_68 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_68 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_68 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_68 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_68 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_68 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_68 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_68 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_68 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_68 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_68 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_68 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_68 0x43, 0xab, 0x08, 0x59, 0x00, 0x00, 0x00, 0x01,_68 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_68 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_68 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_68 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_68 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x02, 0x03,_68 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_68 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_68 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_68 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x05,_68 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_68 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07,_68 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,_68 0x00, 0x01, 0x02, 0x03_68 // name:_68 0x00, 0x10, 0x56, 0x6f, 0x6c, 0x61, 0x74, 0x69,_68 0x6c, 0x69, 0x74, 0x79, 0x20, 0x49, 0x6e, 0x64,_68 0x65, 0x78,_68 // symbol length:_68 0x00, 0x03,_68 // symbol:_68 0x56, 0x49, 0x58,_68 // denomination:_68 0x02,_68 // number of InitialStates:_68 0x00, 0x00, 0x00, 0x01,_68 // InitialStates[0]:_68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,_68 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_68 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_68 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_68 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_68 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_68 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_68 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_68 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_68 0x43, 0xab, 0x08, 0x59,_68]
Unsigned OperationTx#
What Unsigned Operation TX Contains#
An unsigned operation TX contains a BaseTx
, and Ops
. The TypeID
for this type is 0x00000002
.
BaseTx
Ops
is a variable-length array of Transferable Operations.
Proto Unsigned Operation TX Specification#
_10message OperationTx {_10 BaseTx base_tx = 1; // size(base_tx)_10 repeated TransferOp ops = 2; // 4 bytes + size(ops)_10}
Unsigned Operation TX Example#
Let’s make an unsigned operation TX that uses the inputs and outputs from the previous examples:
BaseTx
:"Example BaseTx above" with TypeID set to 2
Ops
: ["Example Transferable Operation as defined above"
]
_64[_64 BaseTx <- 0x0000000200000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203_64 Ops <- [_64 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f00000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a090807060504030201000000000050000000d0000000200000003000000070000303900000003431100000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859,_64 ]_64]_64=_64[_64 // base tx:_64 0x00, 0x00, 0x00, 0x02,_64 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff,_64 0xee, 0xee, 0xee, 0xee, 0xdd, 0xdd, 0xdd, 0xdd,_64 0xcc, 0xcc, 0xcc, 0xcc, 0xbb, 0xbb, 0xbb, 0xbb,_64 0xaa, 0xaa, 0xaa, 0xaa, 0x99, 0x99, 0x99, 0x99,_64 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x01,_64 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_64 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_64 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_64 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_64 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_64 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_64 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_64 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_64 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_64 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_64 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_64 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_64 0x43, 0xab, 0x08, 0x59, 0x00, 0x00, 0x00, 0x01,_64 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_64 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_64 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_64 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_64 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x02, 0x03,_64 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_64 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_64 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_64 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x05,_64 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_64 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07,_64 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,_64 0x00, 0x01, 0x02, 0x03_64 // number of operations:_64 0x00, 0x00, 0x00, 0x01,_64 // transfer operation:_64 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_64 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_64 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_64 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_64 0x00, 0x00, 0x00, 0x01, 0xf1, 0xe1, 0xd1, 0xc1,_64 0xb1, 0xa1, 0x91, 0x81, 0x71, 0x61, 0x51, 0x41,_64 0x31, 0x21, 0x11, 0x01, 0xf0, 0xe0, 0xd0, 0xc0,_64 0xb0, 0xa0, 0x90, 0x80, 0x70, 0x60, 0x50, 0x40,_64 0x30, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x05,_64 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x02,_64 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07,_64 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x03,_64 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,_64 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61, 0xfb,_64 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8, 0x34,_64 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55, 0xc3,_64 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e, 0xde,_64 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89, 0x43,_64 0xab, 0x08, 0x59,_64]
Unsigned ImportTx#
What Unsigned Import TX Contains#
An unsigned import TX contains a BaseTx
, SourceChain
and Ins
. * The TypeID
for this type is 0x00000003
.
BaseTx
SourceChain
is a 32-byte source blockchain ID.Ins
is a variable length array of Transferable Inputs.
Proto Unsigned Import TX Specification#
_10message ImportTx {_10 BaseTx base_tx = 1; // size(base_tx)_10 bytes source_chain = 2; // 32 bytes_10 repeated TransferIn ins = 3; // 4 bytes + size(ins)_10}
Unsigned Import TX Example#
Let’s make an unsigned import TX that uses the inputs from the previous examples:
BaseTx
:"Example BaseTx as defined above"
, but withTypeID
set to3
SourceChain
:0x0000000000000000000000000000000000000000000000000000000000000000
Ins
:"Example SECP256K1 Transfer Input as defined above"
_66[_66 BaseTx <- 0x0000000300000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203_66 SourceChain <- 0x0000000000000000000000000000000000000000000000000000000000000000_66 Ins <- [_66 f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd15000000020000000300000007,_66 ]_66]_66=_66[_66 // base tx:_66 0x00, 0x00, 0x00, 0x03,_66 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff,_66 0xee, 0xee, 0xee, 0xee, 0xdd, 0xdd, 0xdd, 0xdd,_66 0xcc, 0xcc, 0xcc, 0xcc, 0xbb, 0xbb, 0xbb, 0xbb,_66 0xaa, 0xaa, 0xaa, 0xaa, 0x99, 0x99, 0x99, 0x99,_66 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x01,_66 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_66 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_66 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_66 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_66 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_66 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_66 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_66 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_66 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_66 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_66 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_66 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_66 0x43, 0xab, 0x08, 0x59, 0x00, 0x00, 0x00, 0x01,_66 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_66 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_66 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_66 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_66 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x02, 0x03,_66 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_66 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_66 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_66 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x05,_66 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_66 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07,_66 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,_66 0x00, 0x01, 0x02, 0x03_66 // source chain:_66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_66 // input count:_66 0x00, 0x00, 0x00, 0x01,_66 // txID:_66 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_66 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_66 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_66 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_66 // utxoIndex:_66 0x00, 0x00, 0x00, 0x05,_66 // assetID:_66 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_66 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_66 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_66 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_66 // input:_66 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,_66 0x07, 0x5b, 0xcd, 0x15, 0x00, 0x00, 0x00, 0x02,_66 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07,_66]
Unsigned ExportTx#
What Unsigned Export TX Contains#
An unsigned export TX contains a BaseTx
, DestinationChain
, and Outs
. The
TypeID
for this type is 0x00000004
.
DestinationChain
is the 32 byte ID of the chain where the funds are being exported to.Outs
is a variable length array of Transferable Outputs.
Proto Unsigned Export TX Specification#
_10message ExportTx {_10 BaseTx base_tx = 1; // size(base_tx)_10 bytes destination_chain = 2; // 32 bytes_10 repeated TransferOut outs = 3; // 4 bytes + size(outs)_10}
Unsigned Export TX Example#
Let’s make an unsigned export TX that uses the outputs from the previous examples:
BaseTx
:"Example BaseTx as defined above"
, but withTypeID
set to4
DestinationChain
:0x0000000000000000000000000000000000000000000000000000000000000000
Outs
:"Example SECP256K1 Transfer Output as defined above"
_65[_65 BaseTx <- 0x0000000400000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203_65 DestinationChain <- 0x0000000000000000000000000000000000000000000000000000000000000000_65 Outs <- [_65 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859,_65 ]_65]_65=_65[_65 // base tx:_65 0x00, 0x00, 0x00, 0x04_65 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff,_65 0xee, 0xee, 0xee, 0xee, 0xdd, 0xdd, 0xdd, 0xdd,_65 0xcc, 0xcc, 0xcc, 0xcc, 0xbb, 0xbb, 0xbb, 0xbb,_65 0xaa, 0xaa, 0xaa, 0xaa, 0x99, 0x99, 0x99, 0x99,_65 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x01,_65 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_65 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_65 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_65 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_65 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_65 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_65 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_65 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_65 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_65 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_65 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_65 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_65 0x43, 0xab, 0x08, 0x59, 0x00, 0x00, 0x00, 0x01,_65 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81,_65 0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,_65 0xf0, 0xe0, 0xd0, 0xc0, 0xb0, 0xa0, 0x90, 0x80,_65 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0x00,_65 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x02, 0x03,_65 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_65 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_65 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_65 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x05,_65 0x00, 0x00, 0x00, 0x00, 0x07, 0x5b, 0xcd, 0x15,_65 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07,_65 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,_65 0x00, 0x01, 0x02, 0x03_65 // destination_chain:_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_65 // outs[] count:_65 0x00, 0x00, 0x00, 0x01,_65 // assetID:_65 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_65 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_65 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_65 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_65 // output:_65 0x00, 0x00, 0x00, 0x07,_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x39,_65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_65 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,_65 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_65 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_65 0x6d, 0x55, 0xa9, 0x55, 0xc3, 0x34, 0x41, 0x28,_65 0xe0, 0x60, 0x12, 0x8e, 0xde, 0x35, 0x23, 0xa2,_65 0x4a, 0x46, 0x1c, 0x89, 0x43, 0xab, 0x08, 0x59,_65]
Signed Transaction#
A signed transaction is an unsigned transaction with the addition of an array of credentials.
What Signed Transaction Contains#
A signed transaction contains a CodecID
, UnsignedTx
, and Credentials
.
CodecID
The only current valid codec id is00 00
.UnsignedTx
is an unsigned transaction, as described above.Credentials
is an array of credentials. Each credential will be paired with the input in the same index at this credential.
Proto Signed Transaction Specification#
_10message Tx {_10 uint16 codec_id = 1; // 2 bytes_10 UnsignedTx unsigned_tx = 2; // size(unsigned_tx)_10 repeated Credential credentials = 3; // 4 bytes + size(credentials)_10}
Signed Transaction Example#
Let’s make a signed transaction that uses the unsigned transaction and credentials from the previous examples.
CodecID
:0
UnsignedTx
:0x0000000100000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203
Credentials
0x0000000900000002000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1e1d1f202122232425262728292a2b2c2e2d2f303132333435363738393a3b3c3d3e3f00404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5e5d5f606162636465666768696a6b6c6e6d6f707172737475767778797a7b7c7d7e7f00
_64[_64 CodecID <- 0x0000_64 UnsignedTx <- 0x0000000100000004ffffffffeeeeeeeeddddddddccccccccbbbbbbbbaaaaaaaa999999998888888800000001000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab085900000001f1e1d1c1b1a191817161514131211101f0e0d0c0b0a09080706050403020100000000005000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0000000500000000075bcd150000000200000007000000030000000400010203_64 Credentials <- [_64 0x0000000900000002000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1e1d1f202122232425262728292a2b2c2e2d2f303132333435363738393a3b3c3d3e3f00404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5e5d5f606162636465666768696a6b6c6e6d6f707172737475767778797a7b7c7d7e7f00,_64 ]_64]_64=_64[_64 // Codec ID_64 0x00, 0x00,_64 // unsigned transaction:_64 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04,_64 0xff, 0xff, 0xff, 0xff, 0xee, 0xee, 0xee, 0xee,_64 0xdd, 0xdd, 0xdd, 0xdd, 0xcc, 0xcc, 0xcc, 0xcc,_64 0xbb, 0xbb, 0xbb, 0xbb, 0xaa, 0xaa, 0xaa, 0xaa,_64 0x99, 0x99, 0x99, 0x99, 0x88, 0x88, 0x88, 0x88,_64 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03,_64 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_64 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_64 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_64 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x07,_64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x39,_64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x31,_64 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,_64 0x51, 0x02, 0x5c, 0x61, 0xfb, 0xcf, 0xc0, 0x78,_64 0xf6, 0x93, 0x34, 0xf8, 0x34, 0xbe, 0x6d, 0xd2,_64 0x6d, 0x55, 0xa9, 0x55, 0xc3, 0x34, 0x41, 0x28,_64 0xe0, 0x60, 0x12, 0x8e, 0xde, 0x35, 0x23, 0xa2,_64 0x4a, 0x46, 0x1c, 0x89, 0x43, 0xab, 0x08, 0x59,_64 0x00, 0x00, 0x00, 0x01, 0xf1, 0xe1, 0xd1, 0xc1,_64 0xb1, 0xa1, 0x91, 0x81, 0x71, 0x61, 0x51, 0x41,_64 0x31, 0x21, 0x11, 0x01, 0xf0, 0xe0, 0xd0, 0xc0,_64 0xb0, 0xa0, 0x90, 0x80, 0x70, 0x60, 0x50, 0x40,_64 0x30, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x05,_64 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_64 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_64 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_64 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_64 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,_64 0x07, 0x5b, 0xcd, 0x15, 0x00, 0x00, 0x00, 0x02,_64 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03,_64 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x02, 0x03_64 // number of credentials:_64 0x00, 0x00, 0x00, 0x01,_64 // credential[0]:_64 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02,_64 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_64 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_64 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_64 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1e, 0x1d, 0x1f,_64 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,_64 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2e, 0x2d, 0x2f,_64 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,_64 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,_64 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,_64 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,_64 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,_64 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5e, 0x5d,_64 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,_64 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6e, 0x6d,_64 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,_64 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e,_64 0x7f, 0x00,
UTXO#
A UTXO is a standalone representation of a transaction output.
What UTXO Contains#
A UTXO contains a CodecID
, TxID
, UTXOIndex
, AssetID
, and Output
.
CodecID
The only validCodecID
is00 00
TxID
is a 32-byte transaction ID. Transaction IDs are calculated by taking sha256 of the bytes of the signed transaction.UTXOIndex
is an int that specifies which output in the transaction specified byTxID
that this UTXO was created by.AssetID
is a 32-byte array that defines which asset this UTXO references.Output
is the output object that created this UTXO. The serialisation of Outputs was defined above. Valid output types are SECP Mint Output, SECP Transfer Output, NFT Mint Output, NFT Transfer Output.
Proto UTXO Specification#
_10message Utxo {_10 uint16 codec_id = 1; // 02 bytes_10 bytes tx_id = 2; // 32 bytes_10 uint32 output_index = 3; // 04 bytes_10 bytes asset_id = 4; // 32 bytes_10 Output output = 5; // size(output)_10}
UTXO Examples#
Let’s make a UTXO with a SECP Mint Output:
CodecID
:0
TxID
:0x47c92ed62d18e3cccda512f60a0d5b1e939b6ab73fb2d011e5e306e79bd0448f
UTXOIndex
:0
=0x00000001
AssetID
:0x47c92ed62d18e3cccda512f60a0d5b1e939b6ab73fb2d011e5e306e79bd0448f
Output
:0x00000006000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a
_31[_31 CodecID <- 0x0000_31 TxID <- 0x47c92ed62d18e3cccda512f60a0d5b1e939b6ab73fb2d011e5e306e79bd0448f_31 UTXOIndex <- 0x00000001_31 AssetID <- 0x47c92ed62d18e3cccda512f60a0d5b1e939b6ab73fb2d011e5e306e79bd0448f_31 Output <- 00000006000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a_31]_31=_31[_31 // codecID:_31 0x00, 0x00,_31 // txID:_31 0x47, 0xc9, 0x2e, 0xd6, 0x2d, 0x18, 0xe3, 0xcc,_31 0xcd, 0xa5, 0x12, 0xf6, 0x0a, 0x0d, 0x5b, 0x1e,_31 0x93, 0x9b, 0x6a, 0xb7, 0x3f, 0xb2, 0xd0, 0x11,_31 0xe5, 0xe3, 0x06, 0xe7, 0x9b, 0xd0, 0x44, 0x8f,_31 // utxo index:_31 0x00, 0x00, 0x00, 0x01,_31 // assetID:_31 0x47, 0xc9, 0x2e, 0xd6, 0x2d, 0x18, 0xe3, 0xcc,_31 0xcd, 0xa5, 0x12, 0xf6, 0x0a, 0x0d, 0x5b, 0x1e,_31 0x93, 0x9b, 0x6a, 0xb7, 0x3f, 0xb2, 0xd0, 0x11,_31 0xe5, 0xe3, 0x06, 0xe7, 0x9b, 0xd0, 0x44, 0x8f,_31 // secp mint output:_31 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,_31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,_31 0x00, 0x00, 0x00, 0x01, 0x3c, 0xb7, 0xd3, 0x84,_31 0x2e, 0x8c, 0xee, 0x6a, 0x0e, 0xbd, 0x09, 0xf1,_31 0xfe, 0x88, 0x4f, 0x68, 0x61, 0xe1, 0xb2, 0x9c,_31 0x62, 0x76, 0xaa, 0x2a,_31]
Let’s make a UTXO with a SECP Transfer Output from the signed transaction created above:
CodecID
:0
TxID
:0xf966750f438867c3c9828ddcdbe660e21ccdbb36a9276958f011ba472f75d4e7
UTXOIndex
:0
=0x00000000
AssetID
:0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Output
:"Example SECP256K1 Transferable Output as defined above"
_34[_34 CodecID <- 0x0000_34 TxID <- 0xf966750f438867c3c9828ddcdbe660e21ccdbb36a9276958f011ba472f75d4e7_34 UTXOIndex <- 0x00000000_34 AssetID <- 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f_34 Output <- 0x000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859_34]_34=_34[_34 // codecID:_34 0x00, 0x00,_34 // txID:_34 0xf9, 0x66, 0x75, 0x0f, 0x43, 0x88, 0x67, 0xc3,_34 0xc9, 0x82, 0x8d, 0xdc, 0xdb, 0xe6, 0x60, 0xe2,_34 0x1c, 0xcd, 0xbb, 0x36, 0xa9, 0x27, 0x69, 0x58,_34 0xf0, 0x11, 0xba, 0x47, 0x2f, 0x75, 0xd4, 0xe7,_34 // utxo index:_34 0x00, 0x00, 0x00, 0x00,_34 // assetID:_34 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,_34 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,_34 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,_34 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,_34 // secp transfer output:_34 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_34 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_34 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_34 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x02, 0x03,_34 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,_34 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,_34 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,_34 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,_34 0x24, 0x25, 0x26, 0x27,_34]
Let’s make a UTXO with an NFT Mint Output:
CodecID
:0
TxID
:0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7
UTXOIndex
:0
=0x00000001
AssetID
:0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7
Output
:0x0000000a00000000000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a
_31[_31 CodecID <- 0x0000_31 TxID <- 0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7_31 UTXOIndex <- 0x00000001_31 AssetID <- 0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7_31 Output <- 0000000a00000000000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a_31]_31=_31[_31 // codecID:_31 0x00, 0x00,_31 // txID:_31 0x03, 0xc6, 0x86, 0xef, 0xe8, 0xd8, 0x0c, 0x51,_31 0x9f, 0x35, 0x69, 0x29, 0xf6, 0xda, 0x94, 0x5f,_31 0x7f, 0xf9, 0x03, 0x78, 0xf0, 0x04, 0x4b, 0xb0,_31 0xe1, 0xa5, 0xd6, 0xc1, 0xad, 0x06, 0xba, 0xe7,_31 // utxo index:_31 0x00, 0x00, 0x00, 0x01,_31 // assetID:_31 0x03, 0xc6, 0x86, 0xef, 0xe8, 0xd8, 0x0c, 0x51,_31 0x9f, 0x35, 0x69, 0x29, 0xf6, 0xda, 0x94, 0x5f,_31 0x7f, 0xf9, 0x03, 0x78, 0xf0, 0x04, 0x4b, 0xb0,_31 0xe1, 0xa5, 0xd6, 0xc1, 0xad, 0x06, 0xba, 0xe7,_31 // nft mint output:_31 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00,_31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_31 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,_31 0x3c, 0xb7, 0xd3, 0x84, 0x2e, 0x8c, 0xee, 0x6a,_31 0x0e, 0xbd, 0x09, 0xf1, 0xfe, 0x88, 0x4f, 0x68,_31 0x61, 0xe1, 0xb2, 0x9c, 0x62, 0x76, 0xaa, 0x2a,_31]
Let’s make a UTXO with an NFT Transfer Output:
CodecID
:0
TxID
:0xa68f794a7de7bdfc5db7ba5b73654304731dd586bbf4a6d7b05be6e49de2f936
UTXOIndex
:0
=0x00000001
AssetID
:0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7
Output
:0x0000000b000000000000000b4e4654205061796c6f6164000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a
_33[_33 CodecID <- 0x0000_33 TxID <- 0xa68f794a7de7bdfc5db7ba5b73654304731dd586bbf4a6d7b05be6e49de2f936_33 UTXOIndex <- 0x00000001_33 AssetID <- 0x03c686efe8d80c519f356929f6da945f7ff90378f0044bb0e1a5d6c1ad06bae7_33 Output <- 0000000b000000000000000b4e4654205061796c6f6164000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c6276aa2a_33]_33=_33[_33 // codecID:_33 0x00, 0x00,_33 // txID:_33 0xa6, 0x8f, 0x79, 0x4a, 0x7d, 0xe7, 0xbd, 0xfc,_33 0x5d, 0xb7, 0xba, 0x5b, 0x73, 0x65, 0x43, 0x04,_33 0x73, 0x1d, 0xd5, 0x86, 0xbb, 0xf4, 0xa6, 0xd7,_33 0xb0, 0x5b, 0xe6, 0xe4, 0x9d, 0xe2, 0xf9, 0x36,_33 // utxo index:_33 0x00, 0x00, 0x00, 0x01,_33 // assetID:_33 0x03, 0xc6, 0x86, 0xef, 0xe8, 0xd8, 0x0c, 0x51,_33 0x9f, 0x35, 0x69, 0x29, 0xf6, 0xda, 0x94, 0x5f,_33 0x7f, 0xf9, 0x03, 0x78, 0xf0, 0x04, 0x4b, 0xb0,_33 0xe1, 0xa5, 0xd6, 0xc1, 0xad, 0x06, 0xba, 0xe7,_33 // nft transfer output:_33 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00,_33 0x00, 0x00, 0x00, 0x0b, 0x4e, 0x46, 0x54, 0x20,_33 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x00,_33 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_33 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x3c,_33 0xb7, 0xd3, 0x84, 0x2e, 0x8c, 0xee, 0x6a, 0x0e,_33 0xbd, 0x09, 0xf1, 0xfe, 0x88, 0x4f, 0x68, 0x61,_33 0xe1, 0xb2, 0x9c, 0x62, 0x76, 0xaa, 0x2a,_33]
GenesisAsset#
An asset to be issued in an instance of the AVM's Genesis
What GenesisAsset Contains#
An instance of a GenesisAsset contains an Alias
, NetworkID
, BlockchainID
,
Outputs
, Inputs
, Memo
, Name
, Symbol
, Denomination
, and
InitialStates
.
Alias
is the alias for this asset.NetworkID
defines which network this transaction is meant to be issued to. This value is meant to support transaction routing and is not designed for replay attack prevention.BlockchainID
is the ID (32-byte array) that defines which blockchain this transaction was issued to. This is used for replay attack prevention for transactions that could potentially be valid across network or blockchain.Outputs
is an array of transferable output objects. Outputs must be sorted lexicographically by their serialized representation. The total quantity of the assets created in these outputs must be less than or equal to the total quantity of each asset consumed in the inputs minus the transaction fee.Inputs
is an array of transferable input objects. Inputs must be sorted and unique. Inputs are sorted first lexicographically by theirTxID
and then by theUTXOIndex
from low to high. If there are inputs that have the sameTxID
andUTXOIndex
, then the transaction is invalid as this would result in a double spend.Memo
is a memo field that contains arbitrary bytes, up to 256 bytes.Name
is a human readable string that defines the name of the asset this transaction will create. The name is not guaranteed to be unique. The name must consist of only printable ASCII characters and must be no longer than 128 characters.Symbol
is a human readable string that defines the symbol of the asset this transaction will create. The symbol is not guaranteed to be unique. The symbol must consist of only printable ASCII characters and must be no longer than 4 characters.Denomination
is a byte that defines the divisibility of the asset this transaction will create. For example, the DJT token is divisible into billionths. Therefore, the denomination of the DJT token is 9. The denomination must be no more than 32.InitialStates
is a variable length array that defines the feature extensions this asset supports, and the initial state of those feature extensions.
Proto GenesisAsset Specification#
_12message GenesisAsset {_12 string alias = 1; // 2 bytes + len(alias)_12 uint32 network_id = 2; // 04 bytes_12 bytes blockchain_id = 3; // 32 bytes_12 repeated Output outputs = 4; // 04 bytes + size(outputs)_12 repeated Input inputs = 5; // 04 bytes + size(inputs)_12 bytes memo = 6; // 04 bytes + size(memo)_12 string name = 7; // 2 bytes + len(name)_12 name symbol = 8; // 2 bytes + len(symbol)_12 uint8 denomination = 9; // 1 bytes_12 repeated InitialState initial_states = 10; // 4 bytes + size(initial_states)_12}
GenesisAsset Example#
Let’s make a GenesisAsset:
Alias
:asset1
NetworkID
:12345
BlockchainID
:0x0000000000000000000000000000000000000000000000000000000000000000
Outputs
: []Inputs
: []Memo
:2Zc54v4ek37TEwu4LiV3j41PUMRd6acDDU3ZCVSxE7X
Name
:asset1
Symbol
:MFCA
Denomination
:1
InitialStates
:"Example Initial State as defined above"
_59[_59 Alias <- 0x617373657431_59 NetworkID <- 0x00003039_59 BlockchainID <- 0x0000000000000000000000000000000000000000000000000000000000000000_59 Outputs <- []_59 Inputs <- []_59 Memo <- 0x66x726f6d20736e6f77666c616b6520746f206176616c616e636865_59 Name <- 0x617373657431_59 Symbol <- 0x66x726f6d20736e6f77666c616b6520746f206176616c616e636865_59 Denomination <- 0x66x726f6d20736e6f77666c616b6520746f206176616c616e636865_59 InitialStates <- [_59 0x0000000000000001000000070000000000003039000000000000d431000000010000000251025c61fbcfc078f69334f834be6dd26d55a955c3344128e060128ede3523a24a461c8943ab0859_59 ]_59]_59=_59[_59 // asset alias len:_59 0x00, 0x06,_59 // asset alias:_59 0x61, 0x73, 0x73, 0x65, 0x74, 0x31,_59 // network_id:_59 0x00, 0x00, 0x30, 0x39,_59 // blockchain_id:_59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,_59 // output_len:_59 0x00, 0x00, 0x00, 0x00,_59 // input_len:_59 0x00, 0x00, 0x00, 0x00,_59 // memo_len:_59 0x00, 0x00, 0x00, 0x1b,_59 // memo:_59 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x73, 0x6e, 0x6f, 0x77, 0x66, 0x6c, 0x61,_59 0x6b, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65,_59 // asset_name_len:_59 0x00, 0x0f,_59 // asset_name:_59 0x6d, 0x79, 0x46, 0x69, 0x78, 0x65, 0x64, 0x43, 0x61, 0x70, 0x41, 0x73, 0x73, 0x65, 0x74,_59 // symbol_len:_59 0x00, 0x04,_59 // symbol:_59 0x4d, 0x46, 0x43, 0x41,_59 // denomination:_59 0x07,_59 // number of InitialStates:_59 0x00, 0x00, 0x00, 0x01,_59 // InitialStates[0]:_59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,_59 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0x30, 0x39, 0x00, 0x00, 0x00, 0x00,_59 0x00, 0x00, 0xd4, 0x31, 0x00, 0x00, 0x00, 0x01,_59 0x00, 0x00, 0x00, 0x02, 0x51, 0x02, 0x5c, 0x61,_59 0xfb, 0xcf, 0xc0, 0x78, 0xf6, 0x93, 0x34, 0xf8,_59 0x34, 0xbe, 0x6d, 0xd2, 0x6d, 0x55, 0xa9, 0x55,_59 0xc3, 0x34, 0x41, 0x28, 0xe0, 0x60, 0x12, 0x8e,_59 0xde, 0x35, 0x23, 0xa2, 0x4a, 0x46, 0x1c, 0x89,_59 0x43, 0xab, 0x08, 0x59,_59]
Vertex#
A vertex is a collection of transactions. It's the DAG equivalent of a block in a linear blockchain.
What Vertex Contains#
A vertex contains a ChainID
, Height
, Epoch
, ParentIDs
,
TransactionCount
, TransactionSize
, Transactions
, and Restrictions
.
ChainID
is the ID of the chain this vertex exists on.Height
is the maximum height of a parent vertex plus 1.Epoch
is the epoch this vertex belongs to.ParentIDs
are the IDs of this vertex's parents.TransactionCount
is the total number of transactions in this vertex.TransactionSize
is the total size of the transactions in this vertex.Transactions
are the transactions in this vertex.Restrictions
are IDs of transactions that must be accepted in the same epoch as this vertex or an earlier one.
Proto Vertex Specification#
_11message AzimuthId {_11 uint16 codec_id = 1; // 04 bytes_11 bytes chain_id = 2; // 32 bytes_11 uint64 height = 3; // 08 bytes_11 uint32 epoch = 4; // 04 bytes_11 repeated bytes parent_ids = 5; // 04 bytes + 32 bytes * count(parent_ids)_11 uint32 tx_count = 5; // 04 bytes_11 uint32 txs_size = 6; // 04 bytes_11 repeated bytes transactions = 9; // 04 bytes + size(transactions)_11 repeated bytes restrictions = 10; // 04 bytes + size(restrictions)_11}
AzimuthId Example#
Let’s make an AzimuthId:
CodecID
:0x0000
ChainID
:0xd891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf
Height
:3
Epoch
:0
ParentIDs
: [0x73fa32c486fe9feeb392ee374530c6fe076b08a111fd58e974e7f903a52951d2
]Transactions
:[Example BaseTx as defined above]
Restrictions
: []
_32[_32 CodecID <- 0x0000_32 ChainID <- 0xd891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf_32 Height <- 0x0000000000000003_32 Epoch <- 0x00000000_32 ParentIDs <- [0x73fa32c486fe9feeb392ee374530c6fe076b08a111fd58e974e7f903a52951d2]_32 Transactions <- [Example BaseTx defined above]_32 Restrictions <- []_32]_32=_32[_32 // codec id_32 00 00_32 // chain id_32 d8 91 ad 56 05 6d 9c 01 f1 8f 43 f5 8b 5c 78 4a d0 7a 4a 49 cf 3d 1f 11 62 38 04 b5 cb a2 c6 bf_32 // height_32 00 00 00 00 00 00 00 03_32 // epoch_32 00 00 00 00_32 // num parent IDs_32 00 00 00 01_32 // parent id 1_32 73 fa 32 c4 86 fe 9f ee b3 92 ee 37 45 30 c6 fe 07 6b 08 a1 11 fd 58 e9 74 e7 f9 03 a5 29 51 d2_32 // num txs_32 00 00 00 01_32 // size of the transaction_32 00 00 01 7b_32 // base tx from above_32 [omitted for brevity]_32 // num restrictions_32 00 00 00 00_32]