Skip to content

7. Json hex

Nanocat edited this page Sep 14, 2017 · 2 revisions

jsonhex

Its data store protocol, which helps store data in blockchain without special symbols and with small size.

First 4 bytes from jsonhex its a version. In version 0.0.01 version is 0xf0f001f. Next 4 bytes is signature of jsonhex Sign its first 4 bytes from double sha256 bytes of jsonhex. Next bytes - jsonhex object, that contain another jsonhex primitives. Below description of jsonhex primitives.

jsonhex primitives

All jsonhex primitives have one structure:

1 byte type, var_str key, value

jsonhex primitive object

Byte order:

uint8 0xf4
var_str key
var_int count values
json_primitives[]

jsonhex primitive array

Byte order:

uint8 0xf4
var_str key
var_int count values
json_primitives[]

jsonhex primitive null

Byte order:

uint8 0xf0
var_str key
uint8 0

jsonhex primitive integer

Byte order:

uint8 0xf2
var_str key
var_int value

jsonhex primitive float

Byte order:

uint8 0xf6
var_str key
var_str value

jsonhex primitive function

Byte order:

uint8 0xf5
var_str key
var_str value