TOR — a trustless universal hybrid off-chain ENS and DNS resolver contract and protocol.
- TheOffchainResolver.sol
- Test:
node test/test.js
- Mainnet:
0x7CE6Cf740075B5AF6b1681d67136B84431B43AbD
- Sepolia:
0x3c187BAb6dC2C94790d4dA5308672e6F799DcEC3
- Test:
bytes requestData
= calldata from CCIP-Readbytes responseData
= the answer to that requestbytes32 requestHash
= keccak256 ofrequestData
bytes32 responseHash
= keccak256 ofresponseData
uint64 expires
= expiration time in seconds (Ethereum time, since 1/1/1970)address resolver
= TOR contract address- use different endpoints to service multiple resolvers (main vs test, DNS vs ENS)
bytes signedData
= abi.encoded(resolver, expires, requestHash, responseHash)
bytes32 signedHash
= keccak256 ofsignedData
bytes signature
= signature ofsignedHash
with private keybytes data
= abi.encoded(signature, expires, signedData)
- reply with
data
- resolverworks/ezccip.js → Code (~5 lines)
SIGNER
=0x
-prefixed public address of signing keyethers.computeAddress(new ethers.SigningKey("..."))
ENDPOINT
= URL of your CCIP-Read server
- "I have a DNS name"
- DNS TXT =
ENS1 ${TheOffchainResolver} ${CONTEXT}
- Mainnet Example:
ezccip.raffy.xyz
- Context:
0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/
- For full wildcard coverage, set
@
(basename) and*
(descendents)
- Mainnet Example:
- DNS TXT =
- "I have an ENS name"
- ENS.setResolver() =
${TheOffchainResolver}
- setText(
"ccip.context"
) =CONTEXT
- Sepolia Example:
ezccip.eth
- Context:
0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/s
- Sepolia Example:
- ENS.setResolver() =
DNS part of TOR but uses standard ENS signing protocol that is compatible with official ENS Offchain Resolver.
- DNSTORWithENSProtocol.sol
- Test:
node test/dns.js
- Mainnet:
0x3CA097Edd180Ea2C2436BD30c021Ca20869087a0
/
- Test:
XOR — a trustless on-chain wildcard resolver contract that translates ENSIP-10 calls into non-ENSIP-10 calls.
- eXclusivelyOnchainResolver.sol
- Test: merged with TOR
- Goerli:
0x9b87849Aa21889343b6fB1E146f9F734ecFA9982
- Features
- works with any name
- supports
resolve(multicall())
Append .onchain.eth
to any ENS name and resolve!
- Example:
- Normal: on.fixed.onchain.eth (using TOR, on/off-chain mixture)
- Using XOR on.fixed.debug.eth.onchain.eth (only on-chain data)
An on-chain function registry for arbitrary CCIP-Read functions.
- OffchainTunnel.sol
node test/tunnel.js
- Sepolia:
0xCa71342cB02714374e61e400f172FF003497B2c2
When selector
is called with CCIP-Read, the calldata
is forwarded to the endpoint
and the response must be signed by signer
. The function selector
is associated with an (owner, index)
–pair which points to a (endpoint, signer)
–pair. The CCIP-Read exchange follows the TOR protocol.
claimAndSetContext(bytes4 selector, address signer, string calldata endpoint, uint96 index)
claim(bytes4 selector, uint256 index)
+setContext(address signer, string calldata endpoint, uint96 index)
call(address signer, string memory endpoint, bytes memory request)
does the same thing as above, except the (signer, endpoint)
–pair is provided.
All contracts have end-to-end adraffy/blocksmith tests.
foundryup
npm i
npm run test