# IPNS records as IPLD objects → in CAR archives?

**URL:** <https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853>\
**Category:** Protocol\
**Created:** [January 18, 2023, 2:13pm UTC](https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853 "2023-01-18T14:13:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jphastings](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jphastings/32/7359_2.png) [@jphastings](https://discuss.ipfs.tech/u/jphastings)\
**Post date:** [January 18, 2023, 2:13pm UTC](https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853/1 "2023-01-18T14:13:21Z")

</div>

It looks as though the [CAR spec](https://ipld.io/specs/transport/car/carv1/) allows CAR archives to hold any (supported) IPLD objects. I would find it very helpful if [IPNS records](https://github.com/ipfs/specs/blob/main/ipns/IPNS.md) could be recorded as IPLD objects, so they could be stored in CAR files as a transport mechanism too.

This would be helpful for me so that I could create a CAR file containing an updated website (IPFS records), and proof that it’s the ‘same site’ (the IPNS record), then deliver it via SD card/sneakernet. The receiving (and, let’s say, airgapped) Kubo instance would be able to update their latest known version of the website, trusting the signature of the IPNS record.

I can’t see any other easy way to operate a non-internet connected Kubo instance with trusted dynamic websites today; am I missing something?

---

<div class="post-metadata">

**Author:** ![lidel](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/lidel/32/9853_2.png) [@lidel](https://discuss.ipfs.tech/u/lidel)\
**Post date:** [January 24, 2023, 12:40am UTC](https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853/2 "2023-01-24T00:40:47Z")

</div>

Agree, this would be useful for various use cases, offline/sneakernet, but also reducing round-trips in verifiable HTTP contexts.

Implementation of [IPIP-351: IPNS Signed Records Response Format on HTTP Gateways](https://github.com/ipfs/specs/pull/351) is planned to ship with Kubo 0.19. It will get you half-way there: will return raw IPNS record, allowing a custom light client to verify IPNS read via sneakernet, without having to run DHT client.

Since ipns-record protobuf record is just a binary blob, it could be placed in a CAR as an additional `raw` block, but we would need a custom codec to indicate it has a special meaning to allow clients to act on it in a standardized way.

If you want to follow this or help with design, remaining work is tracked in (wrote more there):

> <https://github.com/ipfs/specs/issues/369>
>
> \[IPIP-351: IPNS Signed Records Response Format on HTTP Gateways\](https://github.…com/ipfs/specs/pull/351) will return a raw IPNS record, allowing a custom light client to verify IPNS without having to run DHT client.
> 
> Users \[asked\](https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853) for the ability to export both CIDs and IPNS record into a CAR, transport over sneakernet and load this on airgapped node, which is a good use case.
> 
> Another use case is Decentralized Gateway WG, which could benefit from the ability to have a single round-trip that includes full \[or partial\](https://github.com/ipfs/specs/issues/348) CAR with content + ipns-record. 
> 
> Broad strokes UX we want to accommodate:
> 
> \`\`\`console
> $ curl http://gateway.foo/ipns/{id}?format=car&something \> ipns-site-dump.car
> $ ipfs import ipns-site-dump.car # imaginary command that goes beyond DAGs 
> $ ipfs resolve /ipns/{id} # works, even in offline mode
> $ ipfs dag stat /ipns/{id} # works, even in offline mode
> \`\`\`
> 
> Initial notes: 
> \- need to add a new \`ipns-record\` codec, to indicate special meaning of this additional block. 
> - prior art: we have \`libp2p-peer-record\` (0x0301) already, \`ipns-record\` near that one sounds sensible
> \- decide what \`something is to include \`ipns-record\` block at the beginning of the CAR returned by \`/ipns/{id}?format=car&something\` 
> \- Kubo CLI should have top level \`import\` / \`export\` that operate on content paths (instead of raw dags like \`ipfs dag\` versions), and be smart enough to use \`ipns-record\` if present
> 
> cc @hacdias (for now just fyi, tbd if this is something we need to prioritize for Saturn work any time soon)

Update:

Code for `ipns-record` (0x0300) serialization format registered:

> <https://github.com/multiformats/multicodec/pull/312>
>
> This PR proposes adding \`ipns-record\`, like we already have one for \`libp2p-peer…-record\`. https://github.com/ipfs/specs/issues/369
> 
> Rationale / potential uses:
> 
> \- Main one: we should add a dedicated codec for IPNS Record, otherwise people will use \`ipns\`(0xe5) code which would be invalid, as it indicates IPNS "namespace".
> \- \[IPIP-351\](https://github.com/ipfs/specs/pull/351) will ship in Kubo 0.19 and will allow fetching signed (verifiable) IPNS Record.
> - In the future \`/ipns/{id}?format=car\` could return a CAR with \`ipns-record\` as an additional block.
> \- IPNI wants to support IPNS Records, but need codec (https://github.com/ipni/specs/pull/4)

---

<div class="post-metadata">

**Author:** ![jphastings](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jphastings/32/7359_2.png) [@jphastings](https://discuss.ipfs.tech/u/jphastings)\
**Post date:** [January 26, 2023, 6:44am UTC](https://discuss.ipfs.tech/t/ipns-records-as-ipld-objects-in-car-archives/15853/3 "2023-01-26T06:44:34Z")

</div>

Thank you, this looks superb! I’m currently travelling/away from laptops until May, but I’d love to get involved — I’ll see what I can offer from a phone/iPad until then!
