Skip to content

Commit d3ce9ba

Browse files
Existing implementations use PascalCase for these CBOR fields.
1 parent 6a5bd43 commit d3ce9ba

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/ipns/ipns-record.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,23 @@ A logical IPNS record is a data structure containing the following fields:
112112

113113
- **Value** (bytes)
114114
- 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]`.
116116
- **Validity Type** (uint64)
117117
- Defines the conditions under which the record is valid.
118118
- 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]`.
120120
- **Validity** (bytes)
121121
- When `validityType = 0`
122122
- Expiration date of the record with nanoseconds precision. Expiration time should match the publishing medium's window.
123123
- 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.
124124
- 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]`.
126126
- **Sequence** (uint64)
127127
- 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]`.
129129
- **TTL** (uint64)
130130
- 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]`.
132132
- **Public Key** (bytes)
133133
- Public key used to sign this record.
134134
- 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 {
161161
EOL = 0;
162162
}
163163
164-
// deserialized copy of data[value]
164+
// deserialized copy of data[Value]
165165
optional bytes value = 1;
166166
167167
// legacy field, verify 'signatureV2' instead
168168
optional bytes signatureV1 = 2;
169169
170-
// deserialized copies of data[validityType] and data[validity]
170+
// deserialized copies of data[ValidityType] and data[Validity]
171171
optional ValidityType validityType = 3;
172172
optional bytes validity = 4;
173173
174-
// deserialized copy of data[sequence]
174+
// deserialized copy of data[Sequence]
175175
optional uint64 sequence = 5;
176176
177-
// record TTL in nanoseconds, a deserialized copy of data[ttl]
177+
// record TTL in nanoseconds, a deserialized copy of data[TTL]
178178
optional uint64 ttl = 6;
179179
180180
// 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:
253253

254254
1. Create `IpnsEntry` and set `value`, `validity`, `validityType`, `sequence`, and `ttl`
255255
- 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`
257257
- This is paramount: this CBOR will be used for signing.
258258
3. Store DAG-CBOR in `IpnsEntry.data`.
259259
- 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,
283283
- Unmarshall public key from Multihash digest
284284
4. Deserialize `IpnsEntry.data` as a DAG-CBOR document
285285
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]`
291291
6. Create bytes for signature verification by concatenating `ipns-signature:` prefix (bytes in hex: `69706e732d7369676e61747572653a`) with raw CBOR bytes from `IpnsEntry.data`
292292
7. Verify signature in `IpnsEntry.signatureV2` against concatenation result from the previous step.
293293

0 commit comments

Comments
 (0)