Skip to content

Commit

Permalink
chore: readmes updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Julink-eth committed Jul 8, 2024
1 parent a9c7996 commit 00df3cb
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 23 deletions.
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
# Linea ENS

This repository contains smart contracts and a Node.js Gateway server that allow storing ENS names on Linea using [EIP 3668](https://eips.ethereum.org/EIPS/eip-3668) and [ENSIP 10](https://docs.ens.domains/ens-improvement-proposals/ensip-10-wildcard-resolution).
Also contain a frontend adapted from [ENS's frontend](https://github.com/ensdomains/ens-app-v3) to interact with the deployed contract, to create and manage domains on Linea.
They have been adapted from ENS's [EVM gateway](https://github.com/ensdomains/evmgateway) and [ENS crosschain resolver](https://github.com/ensdomains/ens-evmgateway/tree/master/crosschain-resolver)

It also implements a proof verifier that allows L1 smart contracts to fetch and verify any state from Linea.
It also contain a frontend adapted from [ENS's frontend](https://github.com/ensdomains/ens-app-v3) to interact with the deployed contract, to create and manage domains on Linea.

- Anyone can operate their own gateway, but...
- Only one gateway needs to be operated, regardless of the applications requesting data from it.
- Gateways do not need to be trusted; their responses are fully verified on L1.
- Contracts can fetch Linea state using a simple builder interface and callbacks.
- Contracts can change targets just by swapping out the address of a verifier contract for another.
Thanks to ccip-read the domains created on Linea can also be resolved on Ethereum.

While this functionality is written primarily with read calls in mind, it also functions for transactions; using a compliant
library like Ethers, a transaction that includes relevant Linea proofs can be generated and signed.
## CCIPRead process

## Usage
![alt text](./media/LineaENSCCIPRead.png?raw=true)

1. Have your contract extend `EVMFetcher`.
2. In a view/pure context, use `EVMFetcher` to fetch the value of slots from another contract (potentially on another chain). Calling `EVMFetcher.fetch()` terminates execution and generates a callback to the same contract on a function you specify.
This schema describes how a client application can resolve a domain name stored on Linea L2 from Ethereum L1 using CCIP Read.

## Generic Usage

This repository focuses on the ENS use case but the gateway and Verifier contracts are generic, this means that they can be reused for any other use cases
that need to fetch data stored on Linea from Ethereum in a trustless way.

The same Fetcher, Verifier contracts and gateway can be used without redeploying them.

To implement your own contract you simply need to:

1. Have your own contract extend `EVMFetcher` (In the Linea ENS case this is the L1Resolver contract).
2. In a view/pure context, use `EVMFetcher` to fetch the value of slots from another contract stored on Linea. Calling `EVMFetcher.fetch()` terminates execution and generates a callback to the same contract on a function you specify.
3. In the callback function, use the information from the relevant slots as you see fit.

## Example
Expand Down Expand Up @@ -73,13 +79,13 @@ contract TestL1 is EVMFetchTarget {

### linea-ens-resolver

The linea-ens-resolver contract that is built on top of [linea-state-verifier](./packages/packages/linea-state-verifier) and verify Linea ENS data (domain names, metadata etc).
The linea-ens-resolver contract intented to be deployed on L1 that is built on top of [linea-state-verifier](./packages/packages/linea-state-verifier) and verifies Linea ENS data (domain names, metadata etc).

More documentation available in [linea-ens-resolver/README.md](./packages/linea-ens-resolver/README.md)

### linea-ens-contracts

The linea-ens-contracts contracts intented to be deployed on L2 (Linea) stores and returns the data necessary to resolve an domain name and more data related to ENS.
The linea-ens-contracts contracts intented to be deployed on L2 (Linea) stores and returns the data necessary to resolve a domain name and more data related to ENS.

More documentation available in [linea-ens-contracts/README.md](./packages/linea-ens-contracts/README.md)

Expand All @@ -89,7 +95,7 @@ A node-based gateway server that answers queries from L1 Gateway function calls

### linea-ens-app

The Linea ENS frontend forked from [ens-app-v3](https://github.com/ensdomains/ens-app-v3)
The Linea ENS frontend adapted from [ens-app-v3](https://github.com/ensdomains/ens-app-v3)

### linea-ens-subgraph

Expand All @@ -101,7 +107,7 @@ The linea state verifier contracts are responsible for checking values using spa

### poh-signer-api

A NestJS API responsible for signing a message aknowledging an address has passed the POH process, the signature created is then checked by the poh signer api in the linea-ens-contracts.
A NestJS API responsible for signing a message aknowledging an address has passed the POH process, the signature created is then checked by the PohVerifier contract in the linea-ens-contracts.

## Deployed contracts

Expand Down
Binary file added media/LineaENSCCIPRead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/linea-ens-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pnpm denv --save

2. Deploy the subgraph

After the deploy scripts have run, you can deploy the subgraph. Assuming you are in the [linea-ens-subgraph](https://github.com/Consensys/linea-resolver/tree/main/packages/linea-ens-subgraph) repo, you can use:
After the deploy scripts have run, you can deploy the subgraph. Assuming you are in the [linea-ens-subgraph](https://github.com/Consensys/linea-enstree/main/packages/linea-ens-subgraph) repo, you can use:

```bash
yarn setup
Expand Down
2 changes: 1 addition & 1 deletion packages/linea-ens-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A few specifities:
- A POH linked to the account registering is needed to be able to register
- Registration is free using POH
- One registration by account using POH is allowed
- Is supported on L1 resolution thanks to [linea-state-verifier](https://github.com/Consensys/linea-resolver/tree/main/packages/linea-state-verifier)
- Is supported on L1 resolution thanks to CCIP

## Contracts

Expand Down
2 changes: 1 addition & 1 deletion packages/linea-ens-resolver/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# linea-ens-resolver: Linea ENS crosschain resolver

Linea ENS resolver contracts adapted from ENS's crosschain-resolver[https://github.com/ensdomains/ens-evmgateway/tree/master/crosschain-resolver] specifically for ENS's implementation on Linea.
Linea ENS crosschain resolver contracts adapted from ENS's crosschain-resolver[https://github.com/ensdomains/ens-evmgateway/tree/master/crosschain-resolver] specifically for ENS's implementation on Linea.

## Tests

Expand Down
2 changes: 1 addition & 1 deletion packages/linea-ens-subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linea ENS Subgraph

This Subgraph sources events from the ENS contracts. This includes the ENS registry, the Auction Registrar, and any resolvers that are created and linked to domains. The resolvers are added through dynamic data sources. More information on all of this can be found at [The Graph Documentation](https://thegraph.com/docs/developer/quick-start/).
This Subgraph sources events from the Linea ENS contracts. This includes the ENS registry, the Auction Registrar, and any resolvers that are created and linked to domains. The resolvers are added through dynamic data sources. More information on all of this can be found at [The Graph Documentation](https://thegraph.com/docs/developer/quick-start/).

# Example Queries

Expand Down
2 changes: 1 addition & 1 deletion packages/linea-ens-subgraph/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ specVersion: 0.0.4
description: A secure & decentralized way to address resources on and off the
blockchain using simple, human-readable names. Access domains and transfer
history.
repository: https://github.com/Consensys/linea-resolver/tree/main/packages/linea-ens-subgraph
repository: https://github.com/Consensys/linea-enstree/main/packages/linea-ens-subgraph
schema:
file: ./schema.graphql
dataSources:
Expand Down
4 changes: 2 additions & 2 deletions packages/linea-state-verifier/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# linea-state-verifier

A Solidity library that verifies state proofs generated by a [linea-ccip-gateway](https://github.com/Consensys/linea-resolver/tree/main/packages/linea-ccip-gateway) instance. This library implements all the functionality required to make CCIP-Read calls to a linea-ccip-gateway and verify the responses, except for verifying the root of the proof. This library is intended to be used specifacilly to resolve any Linea storage state on L1.
A Solidity library that verifies state proofs generated by a [linea-ccip-gateway](https://github.com/Consensys/linea-enstree/main/packages/linea-ccip-gateway) instance. This library implements all the functionality required to make CCIP-Read calls to a linea-ccip-gateway and verify the responses, except for verifying the root of the proof. This library is intended to be used specifacilly to resolve any Linea storage state on L1.
It has been greatly inspired by the ENS [evm-gateway](https://github.com/ensdomains/evmgateway/) but needed some custom changes to be compatible with Linea's prooving system that uses SparseMerkleTree instead of the standard Patricia Merkle Tree.

For a detailed readme and usage instructions, see the [monorepo readme](https://github.com/Consensys/linea-resolver/tree/main).
For a detailed readme and usage instructions, see the [monorepo readme](https://github.com/Consensys/linea-enstree/main).

## Installation

Expand Down

0 comments on commit 00df3cb

Please sign in to comment.