-
Notifications
You must be signed in to change notification settings - Fork 2
Data formats
Under construction
The vertical line symbol |
indicates concatenation, either string or byte array.
E.g.: "abcd"|"efgh" = "abcdefgh", and
{ 0x01, 0x02, 0x03 } | { 0x04, 0x05, 0x06} = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }
-
sha512(data) represents calculating a SHA-512 hash on the input
data
. -
sha512sq(data) represents calculating a SHA-512 hash twice on the input
data
- equivalent to sha512(sha512(data)). -
sha512qu(data) represents calculating a SHA-512 hash four times on the input
data
- equivalent to sha512(sha512(sha512(sha512(data)))). -
truncate(value, n) returns the first
n
elements ofvalue
. If thevalue
is an ASCII string, it returns the firstn
ASCII characters. Ifvalue
is a byte array, it returns the firstn
bytes.
DLT.Address
A v0 address always start with the byte 0. The address itself is represented by a truncated sha512qu hash of the wallet's public key (pubkey length may vary). The hash is truncated to 32 bytes. Finally, another sha512sq hash is calculated from the 33-byte array (version|address) and truncated to 3 bytes, which are appended to the address, thus yielding 36 total bytes for a complete address.
Length = 36 bytes
Format = version | raw_address | checksum
version = 1 byte, always 0x0 for addresses v0
raw_address = 32 bytes, `truncate(sha512qu(pubkey) , 32)`
checksum = 3 bytes, `truncate(sha512sq(version|raw_address), 3)`
For the primary address (the first address generated from a specific public key):
raw_address = 32 bytes, `truncate(sha512qu(public_key), 32)`
For subsequent addresses:
raw_address = 32 bytes, `truncate(sha512qu(primay_address|nonce), 32)`
The wallet's public key is used to generate a 44-byte truncated sha512sq hash, which is designated the primary address
. This address is implied to have a nonce
value of 0.
When a subsequent address is required for the same public key, the nonce
value is incremented and a new address is generated from the primary address
and the new nonce
value. Implementations might decide to use random nonce
values, rather than sequential, but make sure that nonce
values do not repeat - same nonce
value will produce the same address.
This enables Ixian to rapidly generate as many new addresses as required with a low computational impact. Verification of the new addresses requires the original public key, but since that may be cached, transactions need only include the primary address
and the nonce
value, reducing network requirements.
Length = 48 bytes
Format = version | raw_address | checksum
version = 1 byte, always 0x1 for addresses v1
raw_address = 44 bytes, `truncate(sha512sq(pubkey_or_address), 44)`
checksum = 3 bytes, `truncate(sha512sq(version|raw_address), 3)`
For the primary address (the first address generated from a specific public key):
raw_address = 44 bytes, `truncate(sha512sq(public_key), 44)`
For subsequent addresses:
raw_address = 44 bytes, `truncate(sha512sq(primay_address|nonce), 44)`
DLT.IxianKeyPair
DLT.CyrptoLib
The v0 public key does not have any headers and is always 523 bytes long (4096-bit keys)
Length = 523 bytes
Format = raw_pubkey (see v1 raw_pubkey)
v1 Pubkey includes the minimum version of address it is able to generate, as well as the version of the pubkey record.
Note: v0 and v1 pubkeys have exactly the same raw layout, the only difference is the prepended header for v1.
Length = variable
Format = address_version | pubkey_version | raw_pubkey
address_version = 1 byte, always 0x1 (future use)
pubkey_version = 4 bytes, always 0x0 (future use)
raw_pubkey = mod_len | modulus
| pub_exp_len | pub_exponent
The v0 private key does not have any headers. The length varies and is represented by an int
field before each data element.
Length = 523 bytes
Format = raw_privkey (see v1 raw_privkey)
v1 Privkey includes the minimum version of address it is able to generate, as well as the version of the privkey record.
Note: v0 and v1 privkeys have exactly the same raw layout, the only difference is the prepended header for v1.
Note: The beginning of the private and public key structures is exactly the same. Therefore, a public key can be quickly extracted from the private key.
Length = variable
Format = address_version | privkey_version | raw_privkey
address_version = 1 byte, always 0x1 (future use)
privkey_version = 4 bytes, always 0x0 (future use)
raw_privkey = mod_len | modulus
| pub_exp_len | pub_exponent
| p_len | p_prime
| q_len | q_prime
| dp_len | dp_exponent1
| dq_len | dq_exponent2
| iq_len | inverse_q
| d_len | d_private_exponent
DLT.PresenceList
DLT.Presence
Presences are how Ixian DLT network keeps track of which nodes and clients are online or offline.
Length = varies, depending on contents
Format = version
| wallet_len | wallet
| pubkey_len | pubkey
| meta_len | metadata
| num_addresses | address_record
| owner
Note: For a description of the address_record
format, see Presence Address in the next section.
DLT.PresenceAddress
A presence address represents a network endpoint on which the specific node or client device may be reached.
Length = varies, depending on contents
Format = version
| device
| address
| type
| nodeVersion
| lastSeenTime
| sig_len | signature
DLT.Transaction
DLT.Transction.Type
DLT.Transaction.MultisigWalletChangeType
DLT.Transaction.MultisigAddrAdd
DLT.Transaction.MultisigAddrDel
DLT.Transaction.MultisigChSig
DLT.Transaction.MultisigTxData
The Transction
object is the cornerstone of any DLT network. It represents a single, atomic operation in much the same way as a transactional database.
In most cases, a Transaction
represents the transfer of funds between two wallets, but it may also signify some other change in the network.
Length = varies, depending on contents
Format = version
| type
| amount
| fee
| to_list_count | to_list_entry[]
| from_list_count | from_list_entry[]
| data_len | data
| block_height
| nonce
| time_stamp
| checksum_len | checksum
| signature_len | signature
| pubkey_len | pubkey
to_list_entry = address_len | address | amount
from_list_entry = address_len | address | amount
Note: The amounts are sent as strings with decimal representation of IxiNumber values.
Note: address in to_list_entry or from_list_entry is either a full address or a special address nounce value. Use the functions in the class DLT.Address
to convert them into a proper format.
See also: Address Format
DLT.WalletType
DLT.Wallet
The Wallet
object contains primarily the amount of funds for a specific Ixian DLT wallet. This structure is held and synchronized by the DLT Master nodes and checked using the field walletStateChecksum
in the Block
object.
Length = varies, depending on contents
Format = id_len | id
| balance
| data_len | data
| type
| required_sigs
| num_allowed_signers | allowed_signer[]
| pubkey_len | pubkey
allowed_signer = address_len | address
Note: balance is encoded as a string with the decimal representation of IxiNumber.
API Commands
Add Transaction
Create Raw Transaction
Decode Raw Transaction
Sign Raw Transaction
Send Raw Transaction
Calculate Transaction Fee
Get Balance
Get Block
Get Last Blocks
Get Full Block
Get Transaction
My Wallet
My Public Key
Get Wallet
Presence List
Clients
Servers
Transaction list
Unapplied transaction list
Status
Miner stats
Block Height
Supply
Generate New Address
Add MultiSig Transaction
Add Multisig TX Signature
Add MultiSig Key
Delete MultiSig Key
Change MultiSig