You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ipns/ipns-record.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,23 +112,23 @@ A logical IPNS record is a data structure containing the following fields:
112
112
113
113
-**Value** (bytes)
114
114
- It can be any path, such as a `/ipns/{ipns-key}` path to another IPNS record, a [DNSLink](https://dnslink.dev/) path (`/ipns/example.com`) or an immutable IPFS path (`/ipfs/baf...`).
115
-
- Implementations MUST include this value in both `IpnsEntry.value` and inside the DAG-CBOR document in `IpnsEntry.data[value]`.
115
+
- Implementations MUST include this value in both `IpnsEntry.value` and inside the DAG-CBOR document in `IpnsEntry.data[Value]`.
116
116
-**Validity Type** (uint64)
117
117
- Defines the conditions under which the record is valid.
118
118
- The only supported value is `0`, which indicates the `validity` field contains the expiration date after which the IPNS record becomes invalid.
119
-
- Implementations MUST support `validityType = 0` and include this value in both `IpnsEntry.validityType` and inside the DAG-CBOR document at `IpnsEntry.data[validityType]`.
119
+
- Implementations MUST support `validityType = 0` and include this value in both `IpnsEntry.validityType` and inside the DAG-CBOR document at `IpnsEntry.data[ValidityType]`.
120
120
-**Validity** (bytes)
121
121
- When `validityType = 0`
122
122
- Expiration date of the record with nanoseconds precision. Expiration time should match the publishing medium's window.
123
123
- For example, IPNS records published on the DHT should have an expiration time set to within 48 hours after publication. Setting the expiration time to longer than 48 hours will not have any effect, as DHT peers only keep records for up to 48 hours.
124
124
- Represented as an ASCII string that follows notation from :cite[rfc3339] (`1970-01-01T00:00:00.000000001Z`).
125
-
- Implementations MUST include this value in both `IpnsEntry.validity` and inside the DAG-CBOR document at `IpnsEntry.data[validity]`.
125
+
- Implementations MUST include this value in both `IpnsEntry.validity` and inside the DAG-CBOR document at `IpnsEntry.data[Validity]`.
126
126
-**Sequence** (uint64)
127
127
- Represents the current version of the record (starts at 0).
128
-
- Implementations MUST include this value in both `IpnsEntry.sequence` and inside the DAG-CBOR document at `IpnsEntry.data[sequence]`.
128
+
- Implementations MUST include this value in both `IpnsEntry.sequence` and inside the DAG-CBOR document at `IpnsEntry.data[Sequence]`.
129
129
-**TTL** (uint64)
130
130
- A hint for how long the record should be cached before going back to, for instance the DHT, in order to check if it has been updated.
131
-
- Implementations MUST include this value in both `IpnsEntry.ttl` and inside the DAG-CBOR document at `IpnsEntry.data[ttl]`.
131
+
- Implementations MUST include this value in both `IpnsEntry.ttl` and inside the DAG-CBOR document at `IpnsEntry.data[TTL]`.
132
132
-**Public Key** (bytes)
133
133
- Public key used to sign this record.
134
134
- If public key is small enough to fit in IPNS name (e.g., Ed25519 keys inlined using `identity` multihash), `IpnsEntry.pubKey` field is redundant and MAY be skipped to save space.
@@ -161,20 +161,20 @@ message IpnsEntry {
161
161
EOL = 0;
162
162
}
163
163
164
-
// deserialized copy of data[value]
164
+
// deserialized copy of data[Value]
165
165
optional bytes value = 1;
166
166
167
167
// legacy field, verify 'signatureV2' instead
168
168
optional bytes signatureV1 = 2;
169
169
170
-
// deserialized copies of data[validityType] and data[validity]
170
+
// deserialized copies of data[ValidityType] and data[Validity]
171
171
optional ValidityType validityType = 3;
172
172
optional bytes validity = 4;
173
173
174
-
// deserialized copy of data[sequence]
174
+
// deserialized copy of data[Sequence]
175
175
optional uint64 sequence = 5;
176
176
177
-
// record TTL in nanoseconds, a deserialized copy of data[ttl]
177
+
// record TTL in nanoseconds, a deserialized copy of data[TTL]
178
178
optional uint64 ttl = 6;
179
179
180
180
// in order for nodes to properly validate a record upon receipt, they need the public
@@ -253,7 +253,7 @@ Creating a new IPNS record MUST follow the below steps:
253
253
254
254
1. Create `IpnsEntry` and set `value`, `validity`, `validityType`, `sequence`, and `ttl`
255
255
- If you are updating an existing record, remember to increase values in `sequence` and `validity`
256
-
2. Create a DAG-CBOR document with the same values for `value`, `validity`, `validityType`, `sequence`, and `ttl`
256
+
2. Create a DAG-CBOR document with the same values for `Value`, `Validity`, `ValidityType`, `Sequence`, and `TTL`
257
257
- This is paramount: this CBOR will be used for signing.
258
258
3. Store DAG-CBOR in `IpnsEntry.data`.
259
259
- If you want to store additional metadata in the record, add it under unique keys at `IpnsEntry.data`.
@@ -283,11 +283,11 @@ Record's data and signature verification MUST be implemented as outlined below,
283
283
- Unmarshall public key from Multihash digest
284
284
4. Deserialize `IpnsEntry.data` as a DAG-CBOR document
285
285
5. Confirm values in `IpnsEntry` protobuf match deserialized ones from `IpnsEntry.data`:
286
-
-`IpnsEntry.value` must match `IpnsEntry.data[value]`
287
-
-`IpnsEntry.validity` must match `IpnsEntry.data[validity]`
288
-
-`IpnsEntry.validityType` must match `IpnsEntry.data[validityType]`
289
-
-`IpnsEntry.sequence` must match `IpnsEntry.data[sequence]`
290
-
-`IpnsEntry.ttl` must match `IpnsEntry.data[ttl]`
286
+
-`IpnsEntry.value` must match `IpnsEntry.data[Value]`
287
+
-`IpnsEntry.validity` must match `IpnsEntry.data[Validity]`
288
+
-`IpnsEntry.validityType` must match `IpnsEntry.data[ValidityType]`
289
+
-`IpnsEntry.sequence` must match `IpnsEntry.data[Sequence]`
290
+
-`IpnsEntry.ttl` must match `IpnsEntry.data[TTL]`
291
291
6. Create bytes for signature verification by concatenating `ipns-signature:` prefix (bytes in hex: `69706e732d7369676e61747572653a`) with raw CBOR bytes from `IpnsEntry.data`
292
292
7. Verify signature in `IpnsEntry.signatureV2` against concatenation result from the previous step.
0 commit comments