Skip to content

Commit 58c26c1

Browse files
committed
ipip-428: editorials
1 parent 6d71cf0 commit 58c26c1

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

src/ipips/ipip-0428.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ editors:
1717
url: https://protocol.ai/
1818
relatedIssues:
1919
- https://github.com/ipfs/specs/issues/376
20+
- https://github.com/ipfs/boxo/pull/339
21+
- https://github.com/ipfs/kubo/pull/9932
22+
- https://github.com/ipfs/js-ipns/pull/234
2023
order: 428
2124
tags: ['ipips']
2225
---
@@ -92,7 +95,6 @@ We can get to that future in two steps:
9295
V2-only records that are protobuf with only two fields: Data
9396
CBOR+signatureV2.
9497

95-
9698
### User benefit
9799

98100
- End users: the main benefit for end user is the smaller size of IPNS Records and
@@ -133,30 +135,28 @@ included at the end of this IPIP.
133135
Describe alternate designs that were considered and related work.
134136

135137
1. Just switch to V2-only as the new default!
136-
137138
- No, this would be a breaking change. We have to do this in two steps,
138139
because we've rushed the way V2 was introduced in 2021, and STILL require
139140
field copying, even when `signatureV1` is missing. So technically there was
140141
never "V2", it was more like "V1.5". Only with this IPIP, we finally
141142
adjust validation to only care about CBOR values when there is no `signatureV1`.
142143

143144
2. Why keeping the outer protobuf envelope? Could we make IPNS DAG-CBOR-only?
144-
145145
- Due to how long it takes for decentralized network nodes to upgrade, we prefer evolution rather than revolution.
146-
- Protobuf is an useful envelope for two reasons:
147-
1. ensures the opaque V2-only record can be passed and stored in existing infrastructure
148-
2. allows us to evolve IPNS record ("V3") in the future without impacting existing infrastructure
146+
- Protobuf is a useful envelope for two reasons:
147+
1. Ensures the opaque V2-only record can be passed and stored in existing infrastructure.
148+
2. Allows us to evolve IPNS record ("V3") in the future without impacting existing infrastructure.
149149

150150
## Test fixtures
151151

152152
TODO: IPNS record that is valid for 100 years and
153153

154154
1. V1-only → record invalid
155155
1. V1+V2 (both signatures valid) → record valid
156-
1. V1+V2 (both signatures valid, but 'value' is different in V1) → record invalid
157-
1. V1+V2 (only V1 valid) → record invalid
158-
1. V1+V2 (only V2 valid, V1 missing signature) → record valid (because we do V1 validation only when signatureV1 is present in protobuf)
159-
1. V2-only (only V2 valid) → record valid
156+
1. V1+V2 (both signatures valid, but 'value' is different in V1 pb) → record invalid
157+
1. V1+V2 (only signatureV1 valid) → record invalid
158+
1. V1+V2 (only signatureV2 valid) → record valid
159+
1. V2-only (no V1 fields) → record valid
160160

161161
### Copyright
162162

src/ipns/ipns-record.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ IPNS implementations MUST support sending and receiving a serialized
239239
`IpnsEntry` less than or equal to **10 KiB** in size.
240240

241241
Records over the limit MAY be ignored. Handling records larger than the
242-
limit is not recommended so as to keep compatibility with implementations and
242+
limit is not recommended to keep compatibility with implementations and
243243
transports that follow this specification.
244244

245245
### Backward Compatibility
@@ -316,7 +316,7 @@ Creating a new IPNS record MUST follow the below steps:
316316
serialized copy in `IpnsEntry.pubKey`
317317

318318
- This step SHOULD be skipped for Ed25519, and any other key types that are
319-
small enough (32 bytes) to be inlined inside of [IPNS Name](#ipns-name) itself.
319+
small enough (32 bytes) to be inlined inside [IPNS Name](#ipns-name) itself.
320320

321321
5. Create `IpnsEntry.signatureV2`
322322

@@ -327,10 +327,9 @@ Creating a new IPNS record MUST follow the below steps:
327327
- Sign concatenated bytes from the previous step using the private key, and
328328
store the signature in `IpnsEntry.signatureV2`
329329

330-
7. Confirm that the serialized `IpnsEntry` bytes sum to less than or equal to
330+
6. Confirm that the serialized `IpnsEntry` bytes sum to less than or equal to
331331
[the size limit](#record-size-limit).
332332

333-
334333
Created `IpnsEntry` protobuf includes signed `data` CBOR and optional public key:
335334

336335
```protobuf
@@ -357,14 +356,14 @@ the [DAG-CBOR specification](https://ipld.io/specs/codecs/dag-cbor/spec/):
357356
}
358357
```
359358

360-
#### Record Creation: V1+V2 with Legacy V1 Signature
359+
#### Record Creation with Legacy SignatureV1
361360

362361
:::warning
363362

364363
Fields related to `signatureV1` has been deprecated since 2021.
365364
V1 signatures are no longer used during record validation.
366365

367-
However it may be necessary to create a V1+V2 record that allows legacy
366+
However, it may be necessary to create a V2+V1 record that allows legacy
368367
software to use IPNS to upgrade itself to the latest version which supports V2
369368
signatures. In such case, follow the steps below.
370369

@@ -378,7 +377,7 @@ signatures. In such case, follow the steps below.
378377
- If you want to store additional metadata in the record, add it under unique keys at `IpnsEntry.data`.
379378
- The order of fields impacts signature verification. If you are using an alternative CBOR implementation, make sure the CBOR field order follows :cite[rfc7049] sorting rules: length and then bytewise. The order of fields impacts signature verification.
380379
4. If your public key can't be inlined inside the IPNS Name, include a serialized copy in `IpnsEntry.pubKey`
381-
- This step SHOULD be skipped for Ed25519, and any other key types that are inlined inside of [IPNS Name](#ipns-name) itself.
380+
- This step SHOULD be skipped for Ed25519, and any other key types that are inlined inside [IPNS Name](#ipns-name) itself.
382381
5. Create `IpnsEntry.signatureV2`
383382
- Create bytes for signing by concatenating `ipns-signature:` prefix (bytes in hex: `69706e732d7369676e61747572653a`) with raw CBOR bytes from `IpnsEntry.data`
384383
- Sign concatenated bytes from the previous step using the private key, and store the signature in `IpnsEntry.signatureV2`
@@ -420,11 +419,13 @@ Implementations MUST ensure `IpnsEntry.signatureV2` is used instead.
420419

421420
Value from `IpnsEntry.value` MUST never be used unless it is the same as signed `IpnsEntry.data[Value]`.
422421

423-
## Integration with IPFS
422+
## Appendix: Notes for Implementers
423+
424+
### Integration with IPFS
424425

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

427-
### Local Record
428+
#### Local Record
428429

429430
This record is stored in the peer's repo datastore and contains the **latest** version of the IPNS record published by the provided key. This record is useful for republishing, as well as tracking the sequence number.
430431
A legacy convention that implementers MAY want to follow is to store serialized `IpnsEntry` under:
@@ -433,7 +434,7 @@ A legacy convention that implementers MAY want to follow is to store serialized
433434

434435
Note: Base32 according to the :cite[rfc4648].
435436

436-
### Routing Record
437+
#### Routing Record
437438

438439
The routing record is spread across the network according to the available routing systems.
439440
The two routing systems currently available in IPFS are the [libp2p Kademlia DHT](https://github.com/libp2p/specs/tree/master/kad-dht) and :cite[ipns-pubsub-router].
@@ -445,7 +446,11 @@ The two routing systems currently available in IPFS are the [libp2p Kademlia DHT
445446

446447
As the `pubsub` topics must be `utf-8` for interoperability among different implementations, IPNS over PubSub topics use additional wrapping `/record/base64url-unpadded(key)`
447448

448-
### Implementations
449+
#### Reference Implementations
450+
451+
When language-specific nuances are not covered by this specification, consider
452+
below reference implementations as the baseline for making decisions around
453+
interoperability.
449454

450455
- <https://github.com/ipfs/boxo/tree/main/ipns>
451456
- <https://github.com/ipfs/js-ipns>

0 commit comments

Comments
 (0)