diff options
| author | bndw <ben@bdw.to> | 2026-03-08 22:07:14 -0700 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-03-08 22:07:14 -0700 |
| commit | 3ff2bc0530bb98da139a5f68202c8e119f9d4775 (patch) | |
| tree | bcca197dee7f13823ac17d2b5ec1b62b94b897a8 /testdata/vectors.json | |
| parent | 53b10eab74d83522dd90af697773e32279469b30 (diff) | |
feat: implement Phase 1 Axon protocol core package
Adds the foundational Go package implementing the full Axon protocol
signing and crypto spec per PROTOCOL.md:
- Event/Tag structs and all kind constants (KindProfile through KindJobFeedback)
- Byte-exact canonical_payload construction per the PROTOCOL.md layout table
- Tag sorting and canonical_tags SHA256 hash (duplicate detection included)
- Ed25519 sign/verify, challenge sign/verify
- X25519 key conversion from Ed25519 keypair (RFC 8032 §5.1.5 clamping +
birational Edwards→Montgomery map for pubkeys)
- ChaCha20-Poly1305 encrypt/decrypt for DMs (nonce prepended)
- MessagePack encode/decode for events and wire messages
Test vectors written first in testdata/vectors.json covering canonical_tags,
canonical_payload, event_id, and signature verification — all deterministic
known-input → known-output pairs for cross-language validation in Phase 4.
13 tests, all passing.
Diffstat (limited to 'testdata/vectors.json')
| -rw-r--r-- | testdata/vectors.json | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testdata/vectors.json b/testdata/vectors.json new file mode 100644 index 0000000..7325fa5 --- /dev/null +++ b/testdata/vectors.json | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | { | ||
| 2 | "tags_input": [ | ||
| 3 | { | ||
| 4 | "name": "p", | ||
| 5 | "values": [ | ||
| 6 | "alice" | ||
| 7 | ] | ||
| 8 | }, | ||
| 9 | { | ||
| 10 | "name": "e", | ||
| 11 | "values": [ | ||
| 12 | "root-id", | ||
| 13 | "root" | ||
| 14 | ] | ||
| 15 | }, | ||
| 16 | { | ||
| 17 | "name": "e", | ||
| 18 | "values": [ | ||
| 19 | "reply-id", | ||
| 20 | "reply" | ||
| 21 | ] | ||
| 22 | } | ||
| 23 | ], | ||
| 24 | "canonical_tags_hex": "00030001650002000000087265706c792d6964000000057265706c79000165000200000007726f6f742d696400000004726f6f74000170000100000005616c696365", | ||
| 25 | "canonical_tags_hash": "2813b33f953e03e88160c651cbd4feb000c37a9b25690cad22fa26eb272bc9e6", | ||
| 26 | "seed_hex": "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", | ||
| 27 | "pubkey_hex": "79b5562e8fe654f94078b112e8a98ba7901f853ae695bed7e0e3910bad049664", | ||
| 28 | "created_at": 1700000000, | ||
| 29 | "kind": 1000, | ||
| 30 | "content_hex": "68656c6c6f2061786f6e", | ||
| 31 | "canonical_payload": "002079b5562e8fe654f94078b112e8a98ba7901f853ae695bed7e0e3910bad049664000000006553f10003e80000000a68656c6c6f2061786f6e2813b33f953e03e88160c651cbd4feb000c37a9b25690cad22fa26eb272bc9e6", | ||
| 32 | "event_id": "16744a01674a332bab4e8814500b56b4a3c907c154dca01099ba6ed3aaba24df", | ||
| 33 | "sig_hex": "0706e27133980aedb544b3618b4afc63d234fad37e80e67018132dac7aad6c12a0923b1494390103ef301b2066a7e62870a623c91f0d21c3d1af1f9ac322ff08" | ||
| 34 | } \ No newline at end of file | ||
