Skip to content

Common Data Types

All shared data types used across VIZ Ledger protocol operations and virtual operations.


Primitive Types

C++ typeJSON representationDescription
stringstringUTF-8 string
boolbooleantrue / false
uint8_tintegerUnsigned 8-bit integer
uint16_tintegerUnsigned 16-bit integer (0–65535)
int16_tintegerSigned 16-bit integer (−32768–32767)
uint32_tintegerUnsigned 32-bit integer
int32_tintegerSigned 32-bit integer
uint64_tstring or integerUnsigned 64-bit integer — use string in JavaScript to avoid overflow
int64_tstring or integerSigned 64-bit integer
share_typeintegerAlias for safe<int64_t> — token amount in satoshi units
time_point_secstringISO 8601 UTC datetime: "2024-01-15T12:00:00" (no timezone suffix)

account_name_type

A fixed-length string (max 16 bytes) identifying an account. Rules:

  • Dot-separated labels; each label is at least 3 characters.
  • Begins with a letter, ends with a letter or digit.
  • Only lowercase letters (az), digits (09), hyphens (-).
  • Minimum length: 2 characters (CHAIN_MIN_ACCOUNT_NAME_LENGTH).
  • Maximum length: 16 characters (CHAIN_MAX_ACCOUNT_NAME_LENGTH).

JSON: plain string — "alice", "alice.bob"


public_key_type

A secp256k1 compressed public key encoded as base58check with a VIZ prefix.

JSON: string — "VIZ5hqSa4NkEZGAMUpoH5EaEr64mBJuMcPpGjvk8qb7hcPFTbXSQ9"

  • Prefix must be VIZ (not STM, GLS, or any other).
  • Encoded from a 33-byte compressed public key + 4-byte checksum = 37 bytes total, base58-encoded.

asset

Represents a token amount with its symbol. In JSON API responses and operation parameters, serialized as a human-readable string:

"10.000 VIZ"
"5.000000 SHARES"

Token symbols

SymbolStringDecimalsDescription
TOKEN_SYMBOLVIZ3Main liquid token
SHARES_SYMBOLSHARES6Vesting shares (staked VIZ)

When constructing operations, always use the string format. Parse by splitting on the space character: amount part left, symbol right. VIZ uses 3 decimal places; SHARES uses 6.


authority

Multi-signature authority structure controlling an account permission level.

json
{
  "weight_threshold": 1,
  "account_auths": [
    ["alice", 1]
  ],
  "key_auths": [
    ["VIZ5hqSa4NkEZGAMUpoH5EaEr64mBJuMcPpGjvk8qb7hcPFTbXSQ9", 1]
  ]
}
FieldTypeDescription
weight_thresholduint32_tMinimum total weight required to satisfy authority
account_auths[[account_name, weight], ...]Account-based signers
key_auths[[public_key, weight], ...]Key-based signers

The sum of weights for the satisfied signers must be ≥ weight_threshold. An empty authority is { "weight_threshold": 0, "account_auths": [], "key_auths": [] }.

Authority levels

LevelUsed for
masterHighest security — changing keys, account recovery
activeToken operations — transfer, vesting, validator voting
regularSocial operations — content, awards, committee voting

beneficiary_route_type

Specifies a beneficiary and their reward share for content payouts.

json
{ "account": "alice", "weight": 2500 }
FieldTypeDescription
accountaccount_name_typeBeneficiary account
weightuint16_tShare in basis points (10000 = 100%)
  • The sum of all beneficiary weights must not exceed 10000.
  • Beneficiaries must be sorted by account name (ascending) in the array.
  • Each beneficiary account must exist on-chain.

extensions_type

Currently unused — always serialized as an empty array.

json
"extensions": []

versioned_chain_properties

A static variant holding one of the chain properties versions. Serialized as a 2-element array [type_index, object].

IndexType
0chain_properties_init
1chain_properties_hf4
2chain_properties_hf6
3chain_properties_hf9 (current)

See Chain Properties for the full field reference per version.


operation (static variant)

Every operation is serialized as a 2-element array: [type_id, operation_object].

Regular operations (user-broadcast)

IDOperation
0vote_operation (deprecated)
1content_operation (deprecated)
2transfer_operation
3transfer_to_vesting_operation
4withdraw_vesting_operation
5account_update_operation
6validator_update_operation
7account_validator_vote_operation
8account_validator_proxy_operation
9delete_content_operation (deprecated)
10custom_operation
11set_withdraw_vesting_route_operation
12request_account_recovery_operation
13recover_account_operation
14change_recovery_account_operation
15escrow_transfer_operation
16escrow_dispute_operation
17escrow_release_operation
18escrow_approve_operation
19delegate_vesting_shares_operation
20account_create_operation
21account_metadata_operation
22proposal_create_operation
23proposal_update_operation
24proposal_delete_operation
25chain_properties_update_operation
35committee_worker_create_request_operation
36committee_worker_cancel_request_operation
37committee_vote_request_operation
43create_invite_operation
44claim_invite_balance_operation
45invite_registration_operation
46versioned_chain_properties_update_operation
47award_operation
50set_paid_subscription_operation
51paid_subscribe_operation
54set_account_price_operation
55set_subaccount_price_operation
56buy_account_operation
58use_invite_balance_operation
60fixed_award_operation
61target_account_sale_operation

Virtual operations (blockchain-generated, not broadcastable)

IDOperation
26author_reward_operation
27curation_reward_operation
28content_reward_operation
29fill_vesting_withdraw_operation
30shutdown_validator_operation
31hardfork_operation
32content_payout_update_operation
33content_benefactor_reward_operation
34return_vesting_delegation_operation
38committee_cancel_request_operation
39committee_approve_request_operation
40committee_payout_request_operation
41committee_pay_request_operation
42validator_reward_operation
48receive_award_operation
49benefactor_award_operation
52paid_subscription_action_operation
53cancel_paid_subscription_operation
57account_sale_operation
59expire_escrow_ratification_operation
62bid_operation
63outbid_operation

Transaction Construction

A signed transaction contains:

FieldValue
ref_block_numhead_block_number & 0xFFFF
ref_block_prefixbytes 4–7 of block_id as little-endian uint32
expirationUTC time string; max ~60 s from broadcast time recommended
operationsArray of [type_id, object] pairs
extensionsAlways []
signaturesArray of compact hex-encoded ECDSA signatures

Signing: sha256(chain_id + serialized_transaction_body) → compact ECDSA signature over secp256k1.

Private keys: WIF format (base58check, version byte 0x80).


Energy System

Energy is used by award-type operations.

  • Stored in basis points: 0–10000 (0%–100%).
  • Regenerates at 100% per 24 hours (CHAIN_ENERGY_REGENERATION_SECONDS = 86400).
  • Current energy: min(10000, last_energy + elapsed_seconds × 10000 / 86400).

See also: Operations Overview, Virtual Operations, Chain Properties.