Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test Vectors

This appendix contains byte-level packet examples. All values are hexadecimal, and multi-byte numeric fields are big-endian.

Conventions

The generated examples use fixed Ed25519 private keys so the appendix covers the full path from private key to public key to X25519 ECDH to packet bytes.

  • Node A private key: 1112 1314 1516 1718 191A 1B1C 1D1E 1F20 2122 2324 2526 2728 292A 2B2C 2D2E 2F30
  • Node A public key: ED54 A59F B1AC 3A51 2393 5136 2941 B868 E85A 60E3 D7B2 485D 8288 21DC 7A69 C279
    • Source hint: ED 54 A5
  • Node B private key: 3132 3334 3536 3738 393A 3B3C 3D3E 3F40 4142 4344 4546 4748 494A 4B4C 4D4E 4F50
  • Node B public key: 6C28 FD05 8C18 C88C 6CCE 2AF9 81D2 D11C 851B 123E D5B6 9B78 7677 3ED0 99EA 3F83
    • Destination hint: 6C 28 FD
  • Pairwise shared secret: 5ADD 834F C109 FAD5 2F04 1C5A F84A 7966 526D 364D 1895 AFFC D794 E044 F3A9 DB14
    • Derived from the two private keys via the implementation’s Ed25519-to-X25519 conversion and X25519 ECDH.
  • Channel key: 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A 5A5A
  • Derived channel identifier: B0 8D

FCF Bit Layout Reference

  7   6   5   4   3   2   1   0
+-------+-----------+---+---+---+
| VER   | PKT TYPE  | S | O | H |
+-------+-----------+---+---+---+

SCF Bit Layout Reference

  7   6   5   4   3   2   1   0
+---+-------+---+---------------+
| E |  MIC  | S |   RESERVED    |
+---+-------+---+---------------+

Example 1: Broadcast Beacon (S=0)

A minimal beacon with a 3-byte source hint and no payload.

FieldValueHex
FCFVER=3, TYPE=0 (broadcast), S=0, O=0, H=0C0
SRCNode A hintED 54 A5
C0 ED 54 A5

Total: 4 bytes.

Example 2: Broadcast Beacon (S=1)

A first-contact beacon carrying the sender’s full 32-byte public key.

FieldValueHex
FCFVER=3, TYPE=0 (broadcast), S=1, O=0, H=0C4
SRCNode A full keyED 54 A5 9F B1 AC 3A 51 23 93 51 36 29 41 B8 68 E8 5A 60 E3 D7 B2 48 5D 82 88 21 DC 7A 69 C2 79
C4 ED 54 A5 9F B1 AC 3A 51 23 93 51 36 29 41 B8
68 E8 5A 60 E3 D7 B2 48 5D 82 88 21 DC 7A 69 C2
79

Total: 33 bytes.

Example 3: Encrypted Unicast (S=0)

An encrypted unicast from Node A to Node B using source hints and frame counter 42.

FieldValueHex
FCFVER=3, TYPE=2 (unicast), S=0, O=0, H=0D0
DSTNode B hint6C 28 FD
SRCNode A hintED 54 A5
SCFE=1, MIC=3 (16-byte), S=0E0
Frame Counter4200 00 00 2A
PayloadEncrypted 48 65 6C 6C 6F ("Hello")4F A0 84 B2 92
MIC16 bytesEA 32 F4 91 09 E8 D4 E6 01 16 73 C1 5B 31 84 F0
D0 6C 28 FD ED 54 A5 E0 00 00 00 2A 4F A0 84 B2
92 EA 32 F4 91 09 E8 D4 E6 01 16 73 C1 5B 31 84
F0

Total: 33 bytes.

Example 4: Encrypted Unicast with Ack Requested (S=1)

A first-contact encrypted unicast from Node A to Node B requesting a MAC acknowledgement. The full 32-byte source key is included.

FieldValueHex
FCFVER=3, TYPE=3 (unicast ack-req), S=1, O=0, H=0DC
DSTNode B hint6C 28 FD
SRCNode A full keyED 54 A5 9F B1 AC 3A 51 23 93 51 36 29 41 B8 68 E8 5A 60 E3 D7 B2 48 5D 82 88 21 DC 7A 69 C2 79
SCFE=1, MIC=3 (16-byte), S=0E0
Frame Counter100 00 00 01
PayloadEncrypted 68 65 79 ("hey")68 CF 7B
MIC16 bytes96 3F CE BA 86 8C 92 96 DD E2 E5 0F 5B 54 42 3F
DC 6C 28 FD ED 54 A5 9F B1 AC 3A 51 23 93 51 36
29 41 B8 68 E8 5A 60 E3 D7 B2 48 5D 82 88 21 DC
7A 69 C2 79 E0 00 00 00 01 68 CF 7B 96 3F CE BA
86 8C 92 96 DD E2 E5 0F 5B 54 42 3F

Total: 60 bytes.

Example 5: Encrypted Multicast (E=1)

An encrypted multicast from Node A on channel B08D. The encrypted body contains the source hint followed by the plaintext payload.

FieldValueHex
FCFVER=3, TYPE=4 (multicast), S=0, O=0, H=0E0
CHANNELDerived channel identifierB0 8D
SCFE=1, MIC=3 (16-byte), S=0E0
Frame Counter500 00 00 05
Encrypted dataENCRYPT(`SRC
MIC16 bytes30 35 87 B0 01 F2 17 98 7A 08 1C F5 6E DC 85 36
E0 B0 8D E0 00 00 00 05 9B B6 F2 5E C7 DA 95 D2
30 35 87 B0 01 F2 17 98 7A 08 1C F5 6E DC 85 36

Total: 32 bytes.

Example 6: Authenticated Multicast (E=0)

An authenticated but unencrypted multicast from Node A carrying payload type 03 followed by "Hello".

FieldValueHex
FCFVER=3, TYPE=4 (multicast), S=0, O=0, H=0E0
CHANNELDerived channel identifierB0 8D
SCFE=0, MIC=3 (16-byte), S=060
Frame Counter300 00 00 03
SRCNode A hintED 54 A5
Payload`03
MIC16 bytes7C 9A 9C 4B C0 DD B4 96 65 6A 9D F1 5F 5B 9C C4
E0 B0 8D 60 00 00 00 03 ED 54 A5 03 48 65 6C 6C
6F 7C 9A 9C 4B C0 DD B4 96 65 6A 9D F1 5F 5B 9C
C4

Total: 33 bytes.

Example 7: Encrypted Unicast with Options and Flood Hops

An encrypted unicast with a region code option, an empty trace-route option, and flood hop limit 4.

Options encoding:

OptionNumberDeltaLengthEncoding
Trace Route22020
Region Code119292 then value 78 53
End markerFF
FieldValueHex
FCFVER=3, TYPE=2 (unicast), S=0, O=1, H=1D3
OptionsTrace route + region code + end marker20 92 78 53 FF
FHOPSFHOPS_REM=4, FHOPS_ACC=040
DSTNode B hint6C 28 FD
SRCNode A hintED 54 A5
SCFE=1, MIC=3 (16-byte), S=0E0
Frame Counter1000 00 00 0A
PayloadEncrypted 68 65 79 ("hey")AB 87 DC
MIC16 bytes83 07 00 18 AA 22 DB FC 93 86 B8 D1 F0 74 85 39
D3 20 92 78 53 FF 40 6C 28 FD ED 54 A5 E0 00 00
00 0A AB 87 DC 83 07 00 18 AA 22 DB FC 93 86 B8
D1 F0 74 85 39

Total: 37 bytes.

Example 8: Blind Unicast (S=0)

A blind unicast on channel B08D. The destination hint and source hint are encrypted together in ENC_DST_SRC, while the payload is encrypted with the blind-unicast payload keys.

FieldValueHex
FCFVER=3, TYPE=6 (blind unicast), S=0, O=0, H=0F0
CHANNELDerived channel identifierB0 8D
SCFE=1, MIC=3 (16-byte), S=0E0
Frame Counter700 00 00 07
ENC_DST_SRCENCRYPT(`DST
ENC_PAYLOADENCRYPT("Hello")1A 3B 73 CD 1B
MIC16 bytes42 9D E6 DD 47 AD 3A 6B E5 FF 89 BB 16 15 E8 7A
F0 B0 8D E0 00 00 00 07 9C A3 DF 8D F8 A6 1A 3B
73 CD 1B 42 9D E6 DD 47 AD 3A 6B E5 FF 89 BB 16
15 E8 7A

Total: 35 bytes.