Note: This is PoC/draft for feedback…
Intro
*Tldr: IPLD is linked json/data stored in IPFS.
IPLD is InterPlanetary Linked Data
, “IPLD is the data model of the content-addressable web. It allows us to treat all hash-linked data structures as subsets of a unified information space, unifying all data models that link data with hashes as instances of IPLD”.
It’s one of core features in IPFS clients to store linked json/data as DAG. ENS already supports IPFS and IPNS, supporting IPLD contenthash doesn’t require any major changes in ENS compatible wallet and services.
Use Cases
- Static data storage providers
- IPLD as CCIP gateways
- Dynamic data storage with IPNS and CCIP.
Compatibility issues
- IPNS technically supports IPLD. We can publish IPLD hash in IPNS but it doesn’t resolve like IPFS hash set in IPNS. ?Possibly a bug in IPFS clients/not implemented yet.
- IPLD returns JSON/data as plaintext without proper headers
Example
e.g, ipldx.eth
generates an IPLD contenthash and set that on ipldx.eth
.
ipld hash : bafyreiggi4ce7wy7eya4smhdewu4dur6hvtemfh2uhlahzq3ir3ltr6u3i
contenthash :e20101711220c647044fdb1f2601c930e325a9c1d23e3d664614faa1d603e61b4476b9c7d4da
ipldx.eth.limo
: https://dweb.link/api/v0/dag/get?arg=bafyreiggi4ce7wy7eya4smhdewu4dur6hvtemfh2uhlahzq3ir3ltr6u3i/
Note :ens
,index
,ipns
andnamehash
fields are linked data, used for example only.
{
"ens":"ipldx.eth",
"index":{"/":"bafyreict4bntpopkmecqztpflnioiur33ltbjpemlqnyhq5w3g66x44jlm"},
"ipns":{"/":"bafyreidwkly54277n6j2mgxz4z7khp27elk4zursn7dfxcvsimyxvvd63e"},
"namehash":{"/":"bafyreiek2zgr3lxz3sivi3doyfubpymwqh3qaxbcxbixcas2r4ecw4b6ru"}
}
ipldx.eth.limo/ens
: https://dweb.link/api/v0/dag/get?arg=bafyreiggi4ce7wy7eya4smhdewu4dur6hvtemfh2uhlahzq3ir3ltr6u3i/ens returns
"ipldx.eth"
ipldx.eth.limo/index
: https://dweb.link/api/v0/dag/get?arg=bafyreiggi4ce7wy7eya4smhdewu4dur6hvtemfh2uhlahzq3ir3ltr6u3i/index returns
[
"/ipfs/QmTQU81h63qA7KocVtEEjsqLsua1AGVe2ff3sw5EJbW4Mm",
//....
]
ipldx.eth.limo/index/0
: https://dweb.link/api/v0/dag/get?arg=bafyreiggi4ce7wy7eya4smhdewu4dur6hvtemfh2uhlahzq3ir3ltr6u3i/index/0 returns
"/ipfs/QmTQU81h63qA7KocVtEEjsqLsua1AGVe2ff3sw5EJbW4Mm"
js-ipfs basic example,
Note: might not resolve globally with latest out-of-box js-ipfs client after recent breaking changes.
let _post = await ipfs.dag.put({
title: 'DAOs are not corporations: where decentralization in autonomous organizations matters',
published: 1663635754,
author: "vitalik.eth",
address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
//...
tags: ["DAO", "DEFI", "BDFL"],
url: "https://vitalik.eth.casa/general/2022/09/20/daos.html",
preview: "Recently, there has been a lot of discourse around the idea that highly decentralized DAOs do not work, and DAO governance should start to more closely resemble that of traditional corporations in order to remain competitive....."
})
console.log("ipld://" + _ipld.toString());
//> ipld://bafyreidive2wt564rh254vxuy7rqtgllt3eaautla6wbn6evpievgzffou