Skip to content

Commit

Permalink
ipip-0351: final editorial fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel authored and hacdias committed May 9, 2023
1 parent 4cae71c commit 1ac8ecb
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/ipips/ipip-0351.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ editors:
- name: Henrique Dias
github: hacdias
url: https://hacdias.com/
- name: Marcin Rataj
github: lidel
url: https://lidel.org/
relatedIssues:
- https://github.com/ipfs/specs/issues/320
- https://github.com/ipfs/specs/pull/351
Expand Down Expand Up @@ -33,15 +36,29 @@ under the `/ipns` namespace.

In this IPIP, we propose adding :cite[ipns-record] as a response
format to the gateway under the `/ipns` namespace, allowing for trustless
retrieval of IPNS records.
retrieval of IPNS records over HTTP as [application/vnd.ipfs.ipns-record](https://www.iana.org/assignments/media-types/application/vnd.ipfs.ipns-record) content type (multicodec `0x0300`).

## Detailed design

The solution is to allow the Gateway to provide an IPNS signed record by
requesting it using either the `Accept` HTTP header or the `format` URL query.
- :cite[trustless-gateway] can now provide a signed IPNS record upon request for `/ipns/{ipns-name}` path.
- To request the IPNS record, use one of the following methods:
- Include the `Accept: application/vnd.ipfs.ipns-record` HTTP header in the request.
- Include the `format=ipns-record` query parameter in the request URL.
- The HTTP response containing the verifiable IPNS record will have the following format:
- Header: `Content-Type: application/vnd.ipfs.ipns-record`
- Body: :cite[ipns-record] serialized as the `IpnsEntry` protobuf.

## Test fixtures

This IPIP got ratified before
[gateway-conformance](https://github.com/ipfs/gateway-conformance) existed.


The [reference implementation in Kubo 0.19](https://github.com/ipfs/kubo/blob/master/docs/changelogs/v0.19.md#signed-ipns-record-response-format)
provides reusable [assertions](https://github.com/ipfs/kubo/blob/v0.19.2/test/sharness/t0124-gateway-ipns-record.sh).

:::issue
Until vendor-agnostic fixtures are added to the conformance test suite ([tracking issue](https://github.com/ipfs/gateway-conformance/issues/3)),
IPNS records for testing can be generated in Kubo by creating an IPNS record:

```bash
Expand All @@ -53,6 +70,7 @@ Published to k51Key: /ipfs/bafyHash

$ ipfs routing get /ipns/k51Key > key.pb
```
:::

## Design rationale

Expand Down

0 comments on commit 1ac8ecb

Please sign in to comment.