Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC: Cross-chain Storage Router Protocol #404

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sshmatrix
Copy link

The following proposal is a superior version of EIP-5559: Cross Chain Write Deferral Protocol, aka CCIP-Write, replacing Ethereum L1 storage with L2 chains and cryptographically secure databases with an aim to cut gas costs and further privacy while retaining the secure aspects of on-chain storage. Methods in this document specifically target security and cost-effectiveness of write deferrals in context of databases. The cross-chain data written with these methods can be retrieved by generic EIP-3668-compliant contracts completing the cross-chain data life cycle.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Apr 30, 2024

File ERCS/erc-7700.md

Requires 1 more reviewers from @axic, @g11tech, @SamWilsn, @xinbenlv

@github-actions github-actions bot added the w-ci label Apr 30, 2024
@eip-review-bot eip-review-bot changed the title New ERC: Cross-chain Storage Router Protocol Add ERC: Cross-chain Storage Router Protocol Apr 30, 2024
ERCS/erc-____.md Outdated Show resolved Hide resolved
ERCS/erc-____.md Outdated Show resolved Hide resolved
Copy link

The commit ac5889c (as a parent of 2bdf989) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label May 23, 2024
@github-actions github-actions bot removed the w-ci label May 23, 2024
@sshmatrix sshmatrix marked this pull request as ready for review May 23, 2024 02:09
---

## Abstract
The following standard provides a superior mechanism to [EIP-5559](./eip-5559), aka CCIP-Write, by which smart contracts can route storage to external providers. In particular, protocols can reduce the gas fees associated with storing data on mainnet by routing the handling of storage operations to another system or network. These storage routers act as an extension to the core L1 contract. Methods in this document specifically target security and cost-effectiveness of storage routing to three router types: L1, L2 and databases. The cross-chain data written with these methods can be retrieved by generic [EIP-3668](./eip-3668)-compliant contracts, thus completing the cross-chain data life cycle. This document, nicknamed CCIP-Store, alongside [EIP-3668](./eip-3668), is a meaningful step toward a secure infrastructure for cross-chain storage routers and data retrievals.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI, if you link to EIP-5559 you won't be able to progress beyond its status. Not a problem if that's what you'd like.


## Specification
### Overview
The following specification revolves around the structure and description of a cross-chain storage router tasked with the responsibility of writing to an L2 or database storage. This draft introduces `StorageRoutedToL2()` and `StorageRoutedToDatabase()` storage routers, and proposes that new `StorageRoutedTo__()` reverts be allowed through new EIPs that sufficiently detail their interfaces and designs. Some foreseen examples of new storage routers include `StorageRoutedToSolana()` for Solana, `StorageRoutedToFilecoin()` for Filecoin, `StorageRoutedToIPFS()` for IPFS, `StorageRoutedToIPNS()` for IPNS, `StorageRoutedToArweave()` for Arweave, `StorageRoutedToArNS()` for ArNS, `StorageRoutedToSwarm()` for Swarm etc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This draft [...]

You should write as if the proposal were already final. It's just too easy to miss these kind of references when going through the stages, then we end up with weird sentence structure in the immutable document at the end of the process.

}
```

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer SVG diagrams, if you can provide them.

This `keygen()` function requires three variables: `username`, `password` and `sigKeygen`. Their definitions are given below.

##### `username`
CAIP-10 identifier `username` is auto-derived from the connected wallet's checksummed address `wallet` and `chainId` using [EIP-155](./eip-155).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CAIP-10 identifier `username` is auto-derived from the connected wallet's checksummed address `wallet` and `chainId` using [EIP-155](./eip-155).
[CAIP-10](https://github.com/ChainAgnostic/CAIPs/blob/ad0cfebc45a4b8368628340bf22aefb2a5edcab7/CAIPs/caip-10.md) identifier `username` is auto-derived from the connected wallet's checksummed address `wallet` and `chainId` using [EIP-155](./eip-155).

where `dataType` parameters are protocol-specific and formatted as object keys delimited by `/`. For instance, if the off-chain data is nested in keys as `a > b > c > field > key`, then the equivalent `dataType` is `a/b/c/field/key`. For example, in order to update off-chain ENS record `text > avatar` and `address > 60`, `dataType` must be formatted as `text/avatar` and `address/60` respectively.

#### 3. Approve Data Signer
To further save on gas costs, we do not store the `dataSigner` on L1. Instead, the clients must
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To further save on gas costs, we do not store the dataSigner on L1.

This content belongs in the Rationale section. Keep the Specification section as focused as possible to make it easier for implementers to follow.

3. Clients must immediately purge the `password` from local storage after usage in the `keygen()` function.

## Copyright
Copyright and related rights waived via [`CC0`](../LICENSE.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copyright and related rights waived via [`CC0`](../LICENSE.md).
Copyright and related rights waived via [CC0](../LICENSE.md).

Use the exact text from the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants