Nyzo techData formatsNyzo string

Nyzo string

A Nyzo string is an encoding used for data in the Nyzo system. The following types of data are supported.

type
prefix
prefix bytes (hex)
description
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.

field
number of bytes
description
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.

hex
00
01
02
03
04
05
06
07
encoded
0
1
2
3
4
5
6
7
hex
08
09
0a
0b
0c
0d
0e
0f
encoded
8
9
a
b
c
d
e
f
hex
10
11
12
13
14
15
16
17
encoded
g
h
i
j
k
m
n
o
hex
18
19
1a
1b
1c
1d
1e
1f
encoded
p
q
r
s
t
u
v
w
hex
20
21
22
23
24
25
26
27
encoded
x
y
z
A
B
C
D
E
hex
28
29
2a
2b
2c
2d
2e
2f
encoded
F
G
H
I
J
K
L
M
hex
30
31
32
33
34
35
36
37
encoded
N
P
Q
R
S
T
U
V
hex
38
39
3a
3b
3c
3d
3e
3f
encoded
W
X
Y
Z
-
.
~
_