Test Vectors
Reference test vectors for INK v0.1 signing, encryption, replay protection and audit. These vectors use fixed key material and deterministic inputs so that two independent implementations can verify byte-for-byte correctness.
Files
| File | Description |
|---|---|
keys.json | Fixed Ed25519 and X25519 key pairs for Alice and Bob (hex-encoded) |
signing.json | Signature generation and verification test cases |
encryption.json | ECIES encryption/decryption test cases |
jcs.json | JCS canonicalization test cases |
replay.json | Replay protection acceptance/rejection test cases |
receipts-and-audit.json | Receipt signatures, audit query signatures, hash-chained events and fork detection |
Usage
- Load key material from
keys.json - Run each test case: construct the expected output from the inputs and compare
- All base64url values use no-padding encoding (RFC 4648 §5)
- All hex values are lowercase
Key Material
The test keys were generated deterministically from fixed seeds. They are NOT suitable for production use.
{ "alice": { "signing": { "publicKeyHex": "...", "privateKeyHex": "..." }, "encryption": { "publicKeyHex": "...", "privateKeyHex": "..." } }, "bob": { "signing": { "publicKeyHex": "...", "privateKeyHex": "..." }, "encryption": { "publicKeyHex": "...", "privateKeyHex": "..." } }}The full test vectors are available in the INK repository.
Signing Test Cases
Each signing test case provides:
input: The signature base components (method, path, recipientDid, body, timestamp)expectedSignatureBase: The concatenated string before signingexpectedSignature: The base64url-encoded Ed25519 signature
Encryption Test Cases
Each encryption test case provides:
input: Plaintext payload, sender/recipient info, deterministic ephemeral key and nonceexpectedEnvelope: The complete outer envelopeexpectedDecrypted: The decrypted plaintext (must match original)
Audit Chain Test Cases
Each audit chain test case provides:
events: Ordered list of audit events with their signaturesexpectedHashes: ThepreviousEventHashvalue for each event after the firstforkDetection: Cases where duplicate sequence numbers indicate a forked chain