Each field in a protocol action is assigned with a data type. Standard scalar types have a single value, these include primitive and basic types. While compound types are made up of fields that have their own types, including nested compound types.

Primitive Types

Type Description
int A signed integer. size is the number of bytes for the integer. Valid values for size are 1, 2, 4, 8.
uint An unsigned integer. size is the number of bytes for the integer. Valid values for size are 1, 2, 4, 8.
float A floating point number. size is the number of bytes for the float. Valid values for size are 4 and 8.
bool A boolean stored as 1 byte.
bin Fixed length binary data. size is the length in bytes of the data.
varbin Variable length binary data. The data is preceded by an integer that specifies the actual length in bytes. size is the number of bits used to serialize the length in bytes of the data. Valid values for size are 8, 16, 32, and 64. For example, a varbin value with a size of 8 will be able to contain up to 255 bytes and will be preceded by a 1 byte unsigned integer specifying the length in bytes.
fixedchar Fixed length text data. The data is assumed to be UTF-8 unless the first two bytes are a valid UTF-16 BOM (Byte Order Method). size is the length in bytes of the data.
varchar Variable length text data. The data is assumed to be UTF-8 unless the first two bytes are a valid UTF-16 BOM (Byte Order Method). The data is preceded by an integer that specifies the actual length in bytes. size is the number of bits used to serialize the length in bytes of the data. Valid values for size are 8, 16, 32, and 64. For example, a `varchar` value with a size of 8 will be able to contain up to 255 bytes and will be preceded by a 1 byte unsigned integer specifying the length in bytes.

Basic Types

Op Return Message

OpReturnMessage implements a base interface for all message types.

Provides the ability to serialize the data as a Bitcoin OP_RETURN script and to request the variable payload data.

Payload Message

PayloadMessage is the interface for messages that are derived from payloads, such as asset types and message types.

Provides the ability to serialize the data.

Tx Id

TxId represents a Bitcoin transaction ID.

It is the double SHA256 hash of the serialized transaction.

size does not need to be specified and is always 32 bytes.

Public Key Hash

PublicKeyHash represents a Bitcoin Public Key Hash.

It is the RIPEMD160 hash of the SHA256 of the serialized public key.

Public key hashes are used as an "address" to send/receive transactions, tokens, and messages.

size does not need to be specified and is always 20 bytes.

Asset Code

AssetCode represents a unique identifier for an asset/token.

size does not need to be specified and is always 32 bytes.

Contract Code

ContractCode represents a unique identifier for a static contract.

The size does not need to be specified and is always 32 bytes.

Timestamp

Timestamp represents a time. size does not need to be specified and is always 8 bytes.

Compound Types

Administrator

Administrator is used to refer to a Administration role in an Entity.

Field Type Description
Type Role Chairman, Director, Managing Partner, etc.. Found in 'Roles' in Specification/Resources Example: 7
Name varchar(8) Length 0-255 bytes. 0 is valid. Example: Satoshi Nakamoto

Age Restriction

Age restriction is used to specify required ages for asset ownership.

Field Type Description
Lower uint(1) The lowest age valid to own asset. Zero for no restriction.
Upper uint(1) The highest age valid to own asset. Zero for no restriction.

Amendment

An Amendment is used to describe the modification of a single field in a Contract or Asset, as defined in the ContractFormation and AssetCreation messages.

Field Type Description
FieldIndex uint(1) Index of the field to be amended. A field with a complex array type uses the same FieldIndex value for all elements. For example, in C1 the VotingSystems field is FieldIndex 16. Indexes are zero based. Example: 2
Element uint(2) Specifies the element of the complex array type to be amended. This only applies to array types, and has no meaning for a simple type such as uint64, string, byte or byte[]. Specifying a value > 0 for a simple type will result in a Rejection. To specify the 3rd VotingSystem of a Contract, the value 2 would be given. Indexes are zero based. Example: 0
SubfieldIndex uint(1) Index of the subfield to be amended. This only applies to specific fields containing complex types with subfields. This is used to specify which field of the object the amendment applies to. For example to specify the 2nd field of a VotingSystem, value 1 would be given. Example: 1
SubfieldElement uint(2) Specifies the element of the complex array type to be amended. This only applies to array types, and has no meaning for a simple type such as uint64, string, byte or byte[]. Specifying a value > 0 for a simple type will result in a Rejection. For example to specify the 2nd field of a VotingSystem, value 1 would be given. Example: 1
Operation uint(1) 0 = Modify. 1 = Add an element to the data to the array of elements. 2 = Delete the element listed in the Element field. The Add and Delete operations only apply to a particilar element of a complex array type. For example, it could be used to remove a particular VotingSystem from a Contract. Example: 0
Data varbin(32) New data for the amended subfield. Data type depends on the the type of the field being amended. The value should be serialize as defined by the protocol. The bytes should be in an format appropriate for the field being modified.

AssetReceiver

An AssetReceiver is a quantity, address, and oracle signature. The quantity could be used to describe a number of tokens, or a value. The address is where the asset will be sent.

Field Type Description
Address PublicKeyHash The address receiving the tokens
Quantity uint(8) Number of tokens to be received by address at Output X Example: 100
OracleSigAlgorithm uint(1) 0 = No Oracle-signed Message (OracleConfirmationSig skipped in serialization), 1 = ECDSA+secp256k1. If the contract for the asset being received has oracles, then a signature is required from one of them. Example: 1
OracleIndex uint(1) Specifies the index into the list of oracles in the contract offer that was used to authorize this transfer.
OracleConfirmationSig varbin(8) Length 0-255 bytes. If restricted to a oracle (whitelist) or has transfer restrictions (age, location, investor status): ECDSA+secp256k1 (or the like) signed message provided by an approved/trusted oracle through an API signature of the defined message. If no transfer restrictions(trade restriction/age restriction fields in the Asset Type payload. or restricted to a whitelist by the Contract Auth Flags, it is a NULL field.
OracleSigBlockHeight uint(4) The block height of the block hash used in the oracle signature.

Asset Settlement

AssetSettlement is the data required to settle an asset transfer.

Field Type Description
ContractIndex uint(2) Index of input containing the contract's address for this offset
AssetType fixedchar(3) Three letter character that specifies the asset type. Example: COU Example: SHC
AssetCode AssetCode A unique code that is used to identify the asset. It is generated by hashing the contract public key hash and the asset index. SHA256(contract PKH + asset index) Cannot be changed by the administration, operator or smart contract.
Settlements QuantityIndex[8] Each element contains the resulting token balance of Asset X for the output Address, which is referred to by the index.

Asset Transfer

AssetTransfer is the data required to transfer an asset.

Field Type Description
ContractIndex uint(2) Index of output containing the contract's address for this offset
AssetType fixedchar(3) Three letter character that specifies the asset type. Example: COU Example: SHC
AssetCode AssetCode A unique code that is used to identify the asset. It is generated by hashing the contract public key hash and the asset index. SHA256(contract PKH + asset index) Cannot be changed by the administration, operator or smart contract.
AssetSenders QuantityIndex[8] Each element has the value of tokens to be spent from the input address, which is referred to by the index.
AssetReceivers AssetReceiver[8] Each element has the value of tokens to be received, the address, and an oracle signature if required.

Document

A file containing data.

Field Type Description
Name varchar(8) Full name, including file extension, of the file. Length 0-255 bytes. 0 is valid. Example: Agreement.pdf
Type varchar(8) MIME type of the file. Length 0-255 bytes. 0 is valid. Example: application/pdf
Contents varbin(32) The contents of the file.

Entity

Entity represents the details of a legal Entity, such as a public or private company, government agency, or and individual.

Field Type Description
Name varchar(8) Length 1-255 bytes (0 is not valid). Issuing entity (company, organization, individual). Can be any unique identifying string, including human readable names for branding/vanity purposes. Example: Tesla Inc.
Type EntityType The type of entity. (i.e Public Company, Individual) (Specification/Resources). Example: P
LEI fixedchar(20) Null is valid. A Legal Entity Identifier (or LEI) is an international identifier made up of a 20-character identifier that identifies distinct legal entities that engage in financial transactions. It is defined by ISO 17442.[1] Natural persons are not required to have an LEI; they’re eligible to have one issued, however, but only if they act in an independent business capacity.[2] The LEI is a global standard, designed to be non-proprietary data that is freely accessible to all.[3] As of December 2018, over 1,300,000 legal entities from more than 200 countries have now been issued with LEIs. ISO 17442 - https://en.wikipedia.org/wiki/Legal_Entity_Identifier Example: 54930084UKLVMY22DS16
AddressIncluded bool Registered/Physical/mailing address(HQ). Y-1/N-0, N means there is no issuer address. Entity/Contracting Party X Details Example: 1
UnitNumber varchar(8) Issuer/Entity/Contracting Party X Address Details (eg. HQ) Example: 2
BuildingNumber varchar(8) Example: 13577
Street varchar(16) Example: Fairmont Ave
SuburbCity varchar(8) Example: Robinoh
TerritoryStateProvinceCode fixedchar(5) Example: BC
CountryCode fixedchar(3) Example: USA
PostalZIPCode fixedchar(12) Example: 50210
EmailAddress varchar(8) Length 0-255 bytes. Address for text-based communication: eg. email address, Bitcoin address Example: satoshi@tokenized.com
PhoneNumber varchar(8) Length 0-50 bytes. 0 is valid. Phone Number for Entity. Example: 0448484848
Administration Administrator[8] A list of people that are in Administrative Roles for the Entity. eg. Chair, Director, Managing Partner, etc.
Management Manager[8] A list of people in Management Roles for the Entity. e.g CEO, COO, CTO, CFO, Secretary, Executive, etc.

Manager

Manager is used to refer to a role that is responsible for the Management of an Entity.

Field Type Description
Type Role CEO, COO, CFO, etc. Found in 'Roles' in Specification/Resources Example: 5
Name varchar(8) Length 0-255 bytes. 0 is valid. Example: Satoshi Nakamoto

Oracle

A Oracle defines the details of a public Oracle.

Field Type Description
Name varchar(8) Length 0-255 bytes. 0 is valid. Oracle X Name (eg. Coinbase, Tokenized, etc.) Example: Tokenized
URL varchar(8) Length 0-255 bytes. 0 is valid. If applicable: URL for REST/RPC Endpoint Example: http://oracle.tokenized.com/api/3650d9/version2010
PublicKey varbin(8) Length 0-255 bytes. 0 is not valid. Oracle Public Key (eg. Bitcoin Public key), used to confirm digital signed proofs for transfers. Can also be the same public address that controls a Tokenized Oracle.

Output

Reference to a bitcoin transaction output.

Field Type Description
TxId TxId
OutputIndex uint(4) The index of the output within the referenced transaction.

Output Tag

A tag or category of an output used to categorize and organize outputs from different transactions.

Field Type Description
Tag varchar(8) The text of the tag.

Quantity Index

A QuantityIndex contains a quantity, and an index. The quantity could be used to describe a number of tokens, or a value. The index is used to refer to an input or output index position.

Field Type Description
Index uint(2) The index of the input/output (depending on context) sending/receiving the tokens. Example: 0
Quantity uint(8) Number of tokens being sent Example: 100

Target Address

A TargetAddress defines a public address and quantity.

Field Type Description
Address PublicKeyHash Public address where the token balance will be changed.
Quantity uint(8) Qty of tokens to be frozen, thawed, confiscated or reconciled. For Contract-wide freezes 0 will be used. Example: 10000

Voting System

A VotingSystem defines all details of a Voting System.

Field Type Description
Name varchar(8) eg. Special Resolutions, Ordinary Resolutions, Fundamental Matters, General Matters, Directors' Vote, Poll, etc. Example: Special Resolutions
VoteType fixedchar(1) R - Relative Threshold, A - Absolute Threshold, P - Plurality, (Relative Threshold means the number of counted votes must exceed the threshold % of total ballots cast. Abstentations/spoiled votes do not detract from the liklihood of a vote passing as they are not included in the denominator. Absolute Threshold requires the number of ballots counted to exceed the threshold value when compared to the total outstanding tokens. Abstentations/spoiled votes detract from the liklihood of the vote passing. For example, in an absolute threshold vote, if the threshold was 50% and 51% of the total outstanding tokens did not vote, then the vote cannot pass. 50% of all tokens would have had to vote for one vote option for the vote to be successful. Plurality means the most favoured option is selected, regardless of the number of votes cast or the percentage relative to other choices. Example: A
TallyLogic fixedchar(1) 0 - Standard Scoring (+1 * # of tokens owned), 1 - Weighted Scoring (1st choice * Vote Max * # of tokens held, 2nd choice * Vote Max-1 * # of tokens held,..etc.) Example: 0
ThresholdPercentage uint(1) This field is ignored when VoteType is P (Plurality). Otherwise it is the percentage of ballots required for a proposal to pass. Valid values are greater than 0 and less than 100. 75 means 75% and greater. Only applicable to Relative and Absolute Threshold vote methods. The Plurality vote method requires no threshold value (NULL), as the successful vote option is simply selected on the basis of highest ballots cast for it. Example: 75
VoteMultiplierPermitted bool Where an asset has a vote multiplier, true must be set here for the vote multiplier to count, otherwise votes are simply treated as 1x per token.
HolderProposalFee uint(8) Token Owners must pay the fee amount to broadcast a valid Proposal. If the Proposal action is valid, the smart contract will start a vote. 0 is valid. Example: 100