curl -L https://foundry.paradigm.xyz | bash && source ~/.bashrc && foundryup
forge install foundry-rs/forge-std --no-commit --no-git
forge test --fork-url https://rpc.ankr.com/eth_goerli -vvvv --fork-block-number 8897000
IPFS2.eth ("IPFS-To-ETH") is a proof-of-concept IPFS gateway-like framework with an ENS CCIP-Read Resolver wrapped in a base32 and base36 decoder. IPFS2.eth is capable of resolving IPFS and IPNS (and IPLD) contenthashes as subdomains *.ipfs2.eth when queried as ENS subdomain or via public ENS gateway services such as *.IPFS2.eth.limo
Syntax: b<base32>.ipfs2.eth
https://bafybeiftyo7xm6ktvsmijtwyzcqavotjybnmsiqfxx3fawxvpr666r6z64.ipfs2.eth.limo
Syntax: k<base36>.ipfs2.eth
https://k51qzi5uqu5dkgt2xdmfcyh6058cl8fa6tfnj06u6vdf510260imor3yak48fv.ipfs2.eth.limo
https://bafyreie2nochynilsdmcyqpxid7d2dzdle4dbptvep65kujtg2uywm7jre.ipfs2.eth.limo
Syntax: f<prefix>.<bytes16>.<bytes16>.ipfs2.eth
Syntax: <prefix>.<bytes16>.<bytes16>.ipfs2.eth
Several centralised providers offer public gateways for IPFS/IPNS resolution such as https://dweb.link and https://ipfs.io. IPFS2 is a service similar to these public IPFS gateways but it uses an ENS CCIP-Read Resolver and public ENS gateways (eth.limo, eth.link etc). IPFS2 uses eth.limo as its default CCIP gateway to read specific ENS records and is designed to fallback to secondary gateways.
IPFS2 architecture is as follows:
Resolution of <CIDv1-base32>.ipfs2.eth will decode and resolve <CIDv1-base32> via CCIP as ABI-encoded contenthash. This functionality supports both IPNS and IPFS (and IPLD) contenthashes in base32 format.
let wallet = new BrowserProvider(window.ethereum);
const resolver = await wallet.getResolver("bafybeiftyo7xm6ktvsmijtwyzcqavotjybnmsiqfxx3fawxvpr666r6z64.ipfs2.eth");
let contenthash = await resolver.getContentHash();
console.log(contenthash);Goerli : 0xaa3d2c2811141ba4eb0ad0a369cb472151e49089
Mainnet : Code audit in progress
IPFS2 CCIP contracts are available on GitHub
