Who are we?
Hugo Dias & Adin Schmahmann
Porto, Portugal & Boston, USA
IPFS Core Developers
ask who knows about IPFS, IPNS and DHT
IPNS
Inter-Planetary Naming System
IPFS is Immutable
> echo 'IPNS' > test.txt
> ipfs add test.txt
/ipfs/Qmcpr6B63t55cMni4zsZwdfsmc76bBWPgdP8fuoaGeat4x
> echo 'mutable' >> test.txt
> ipfs add test.txt
/ipfs/QmdfuCQQZG3ZknEcUs4vGuf8rWXFpZWD3eakTth74HbpNw
IPFS is powered by content-addressed data, which by nature is immutable: changing an object would change its hash, and consequently its address, making it a different object altogether.
However, there are several use cases where we benefit from having mutable data. This is where IPNS gets into the equation.
IPNS enables the creation of mutable pointers to a content path.
Each time a file is modified, its content address changes. As a consequence, the address previously used for getting that file needs to be updated by who is using it. As this is not pratical, IPNS was created to solve the problem.
IPNS is Mutable
> echo 'IPNS' > test.txt
> ipfs add test.txt
/ipfs/Qmcpr6B63t55cMni4zsZwdfsmc76bBWPgdP8fuoaGeat4x
> ipfs name publish /ipfs/Qmcpr6B63t55cMni4zsZwdfsmc76bBWPgdP8fuoaGeat4x
/ipns/QmcjrwMdCoLLSUk4bidy8PxFdDHFJLq4dq2i3k2Z3t8esv
> echo 'mutable' >> test.txt
> ipfs add test.txt
/ipfs/QmdfuCQQZG3ZknEcUs4vGuf8rWXFpZWD3eakTth74HbpNw
> ipfs name publish /ipfs/QmdfuCQQZG3ZknEcUs4vGuf8rWXFpZWD3eakTth74HbpNw
/ipns/QmcjrwMdCoLLSUk4bidy8PxFdDHFJLq4dq2i3k2Z3t8esv
IPNS is based on Self-certifying File System (SFS). It consists of a PKI namespace, where a name is simply the hash of a public key. As a result, whoever controls the private key has full control over the name. Accordingly, records are signed by the private key and then distributed across the network.
An IPNS record is a data structure containing the following fields:
value (eg. /ipfs/bafy … )
sequence
signature
public key
validity
validity type
ttl
value
It can be any path, such as a path to another IPNS record, a dnslink path (eg. /ipns/example.com) or an IPFS path (eg. /ipfs/Qm … )
validity
Expiration date of the record
Signature
Concatenate value, validity field and validity type. Sign the concatenation result with the provided private key.
Validity type
Allows us to define the conditions under which the record is valid.
Sequence
Represents the current version of the record (starts at 0)
Pubkey
Ttl
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.
Current Overview
Routing
DHT acts as a KV store and router
Right now PubSub works mostly to get faster updates
Multiple routers
We don't need to choose just one router!
DNS
MDNS
Workers
PubSub
DHT
Strategies: fastest, guaranteed of freshness, offline only.
IPNS over DNS
dig TXT bafybeicagsz6fho75fzralubljnhmvayrnkzgm4vtujedd7ldsojzn3xym.dns.ipns.dev
/ipfs/QmdfuCQQZG3ZknEcUs4vGuf8rWXFpZWD3eakTth74HbpNw
we built a package called ipns-ns
Nameservers for a domain (ipns.dev)
IPNS over DNS
Fast resolves < 100ms
Provides Origin Isolation in browser
Human readable names
DNS over HTTPS
Publishing is centralized
Resolving can be federated
Anyone can run nameservers
IPNS over MDNS
Works offline
MDNS annouces ipns.local
Browser can resolve ipns.local
IPNS over Cloudflare Workers
Just a HTTP API with GET and PUT
Prototype to understand how IPNS works
It's still self-certifying
Shows that any KV store can be used as a backend
Runs in the edges
IPNS over DHT
Put and Get IPNS records into DHT
Resolve/Publish decentralized
On resolve ask for multiple records to confirm we have the latest version
Slow resolves since we need to find multiple records
IPNS over PubSub
Publish/Resolve records to/from interested peers
Fast record updates
Discover peers with:
DHT
DNS or MDNS
Rendezvous servers
Resolve speed depends on peer discovery method
Enables advanced use cases (e.g. multiple writers)
Publish/Resolve records to/from interested peers
Decentralized given interested peers
Discover peers with:
Resolve speed depends on peer discovery method
DHT peer discovery much faster than DHT record search
Future work
Revocation and Rotation of IPNS keys
Multiple writers to a single IPNS key
Including access control/capabilities
Third-party republishing
Flexible strategies for multiple routers
Thank you!
You can find us online with the handles
@hugomrdias @aschmahmann
Resume presentation
Exploring ways to improve IPNS! slides: https://hackmd.io/@hugodias/ipns
{"metaMigratedAt":"2023-06-14T22:28:41.075Z","metaMigratedFrom":"YAML","title":"Exploring ways to improve ipns","breaks":true,"description":"View the slide with \"Slide Mode\".","slideOptions":"{\"spotlight\":{\"enabled\":true}}","contributors":"[{\"id\":\"7ba363de-22cd-4e16-bbfc-9f22623b6f32\",\"add\":7833,\"del\":4542}]"}