Protocol Specification
See: Main_Page, Developer_Guide
Contents
Common standards
Addresses
Standard Address
A standard address is a 30-character Base58 (See: https://en.wikipedia.org/wiki/Base58) string.
Algorithm:
- Generate an ECDSA public/private keypair
- Hash the X509-encoded public key with SHA-256, represent as Base58
- Concatenate ‘V’ + (first 24 characters of hash generated in step 2)
- Hash the result of step 3 with SHA-256, represent as Base58
- Concatenate the first 5 characters of the hash created in step 4 at the end of the result of step 3. The result is the standard address.
Multisig Address
A multsig address is a 30-character string with the first 29 characters being Base58 and the final character being 0.
VeriBlock supports M-of-N multisig transactions, up to M and N values of 58. Multisig addresses follow a special format which allows the M and N values to be obtained by inspection.
The algorithm for generating a VeriBlock multisig address is:
- Generate or Select N (where 1 < N <= 58) standard VeriBlock addresses which represent the desired members of the signing group
- Decide on a value M (where 0 < M <= N), which represents the threshold of unique members who have to sign a transaction for it to be considered valid
- Concatenate all String representations of the VeriBlock addresses (and store the order in which they were concatenated, note that the same standard address can be used multiple times)
- Hash the concatenation created in step 3 with SHA-256, represent as Base58
- Concatenate: ‘V’ + Base58Encode(M - 1) + Base58Encode(N - 1) + (first 22 characters of hash generated in step 4)
- Hash the result of step 5 with SHA-256, represent as Base58
- Concatenate the first 4 characters of the hash created in step 6 at the end of the result of step 5
- Append a ‘0’ to the end of the result of step 7. The result is the multisig address
Common structures
Block headers
The block header is 64 bytes long, and is formatted as follows:
Size (Bytes) | Data Type | Data |
---|---|---|
4 | int32 | Block Height |
2 | int16 | Version |
12 | string | Previous Block Hash (End) |
9 | string | First Previous Keystone Block Hash (End) |
9 | string | Second Previous Keystone Block Hash (End) |
16 | string | Merkle Root Hash |
4 | int32 | Timestamp |
4 | int32 | Difficulty |
4 | int32 | Nonce |
Visual example (block #22 on the VeriBlock mainnet):
PoP Publication Data
A PoP Transaction puts 80 byte of data in the BTC opreturn:
Size (Bytes) | Data Type | Data |
---|---|---|
64 | blockheader | block header (see: Protocol_Specification#Block_headers) |
16 | bytes | miner address: remove initial 'V', take next 16 bytes |
Block size
Normal Transactions and PoP Transactions are stored in separate containers.
- PoP Transactions --> allowed up to 256
- Normal Transactions --> VBK blocks are limited to 256KB of normal transactions (standard and multisig) unless they contain VBK->BTC PoP transactions, at which point they are allowed up to 384KB depending on how many PoP transactions they contain relative to the recent average.