Nyzo tech→Data formats→Nyzo string
Nyzo string
A Nyzo string is an encoding used for data in the Nyzo system. The following types of data are supported.
Micropay
pay_
60a87f
several fields bundled to support 1st-generation Micropay
prefilled data
pre_
61a3bf
receiver identifier and sender-data field
private seed
key_
50e87f
32-byte (256-bit) seed for the private key for a Nyzo wallet
public identifier
id__
48dfff
32-byte (256-bit) public identifier for a Nyzo wallet
signature
sig_
6d243f
64-byte (512-bit) Ed25519 signature
transaction
tx__
720fff
full Nyzo transaction; supports all types of transactions
Nyzo strings are composed of the following fields.
prefix
3
one of the prefixes from the above table; denotes the type of Nyzo string
content length
1
a value from 0 to 255, inclusive, denoting the number of content bytes to follow
content
variable; minimum of 0, maximum of 255
the bytes encoding the object this string represents; the meaning varies by string type
checksum
variable; minimum of 4, maximum of 6
the first 4 to 6 bytes of the double SHA-256 of all preceding bytes of the string
When Nyzo strings are encoded, the checksum length is calculated to ensure that the number of bytes encoded by the
Nyzo string, including the checksum, is divisible by 3. When decoding, the checksum must be a minimum of 4 and a
maximum of 6 bytes long, but the total number of bytes represented by the Nyzo string is not required to be
divisible by 3. This means that a string encoded with a 6-byte checksum will still decode properly if either 1 or 2
bytes is dropped from the string before decoding.