Skip to content

Commit 05b9083

Browse files
committed
ipns: include test vectors section
1 parent 80c24c6 commit 05b9083

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/ipns/ipns-record.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,28 @@ Value from `IpnsEntry.value` MUST never be used unless it is the same as signed
421421

422422
## Appendix: Notes for Implementers
423423

424+
### Test Vectors
425+
426+
Below are test vectors in [Record Serialization Format](#record-serialization-format),
427+
along with the expected verification results. The records are valid for 100
428+
years, making them safe for use in CI tests.
429+
430+
1. [V1-only](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5dm4tm0wt8srkg9h9suud4wuiwjimndrkydqm81cqtlb5ak6p7ku_v1.ipns-record) → record invalid
431+
2. [V1+V2](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5dlkw8pxuw9qmqayfdeh4kfebhmreauqdc6a7c3y7d5i9fi8mk9w_v1-v2.ipns-record) (both signatures valid) → record valid, value points at `/ipfs/bafkqaddwgevxmmraojswg33smq`
432+
3. [V1+V2](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5dlmit2tuwdvnx4sbnyqgmvbxftl0eo3f33wwtb9gr7yozae9kpw_v1-v2-broken-v1-value.ipns-record) (both signatures valid, but 'value' is different in V1 pb vs V2 CBOR) → record invalid
433+
4. [V1+V2](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5diamp7qnnvs1p1gzmku3eijkeijs3418j23j077zrkok63xdm8c_v1-v2-broken-signature-v2.ipns-record) (only signatureV1 valid) → record invalid
434+
5. [V1+V2](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5dilgf7gorsh9vcqqq4myo6jd4zmqkuy9pxyxi5fua3uf7axph4y_v1-v2-broken-signature-v1.ipns-record) (only signatureV2 valid) → record valid, value points at `/ipfs/bafkqahtwgevxmmrao5uxi2bamjzg623fnyqhg2lhnzqxi5lsmuqhmmi`
435+
6. [V2-only](https://dweb.link/ipfs/bafybeifkipmlz2fehxda6y7x752uolfed7bdd46jzdammpfga5zrnkq33u/k51qzi5uqu5dit2ku9mutlfgwyz8u730on38kd10m97m36bjt66my99hb6103f_v2.ipns-record) (no V1 fields) → record valid
436+
437+
:::note
438+
439+
Implementers can either write own tests against the above test vectors, or run
440+
[gateway-conformance](https://github.com/ipfs/gateway-conformance/) test suite,
441+
which includes tests for these vectors since
442+
[gateway-conformance/pull/157](https://github.com/ipfs/gateway-conformance/pull/157).
443+
444+
:::
445+
424446
### Integration with IPFS
425447

426448
Below are additional notes for implementers, documenting how IPNS is integrated within IPFS ecosystem.

0 commit comments

Comments
 (0)