Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

The original Mermaid diagrams are retained; some labels remain in Japanese.

Introduction

This article covers ERC7700, a proposal for securely routing L1 storage operations to L2 networks and off-chain databases, reducing gas costs while preserving verifiability.

This article translates, summarizes, and supplements the following proposal.

Overview

ERC7700 is a standard allowing smart contracts to route data storage operations to external systems. External systems in this context are storage environments other than Ethereum L1, including L2 chains and off-chain databases.

Writing data to storage on Ethereum L1 is very expensive in terms of gas. ERC7700 addresses this problem as follows.

  • Delegate the actual storage operation to external storage instead of L1.
  • Let the L1 smart contract handle only routing to and verification of the external storage.

The component responsible for writes to external storage is called a storage router. Although outside the L1 contract, a storage router behaves as if it were part of that contract. ERC7700 therefore treats storage routers as extensions of the L1 contract.

ERC7700 considers three types of storage routers.

Router type Description
L1 Storage on Ethereum mainnet
L2 Layer 2 chains such as optimistic rollups and ZK rollups
Database General-purpose off-chain databases

Data written to external storage through ERC7700 can be retrieved by contracts compliant with ERC3668 (CCIP-Read). This completes the workflow of writing data across chains and securely reading it from another chain or L1.

For more on ERC3668, see the following article.

[ERC3668] Accessing Off-Chain Data

Combined with ERC3668, ERC7700 thus covers the entire cross-chain data lifecycle.

  • Store data (Store)
  • Retrieve data (Read)

This mechanism is an important step toward secure and cost-efficient storage infrastructure for cross-chain environments.

Motivation

The role of ERC3668 (CCIP-Read)

ERC3668, also known as CCIP-Read, has been widely used as a standard enabling Ethereum L1 contracts to read cross-chain data.

Examples of its use include the following.

Use case Description
DeFi price feeds Use price information from other chains or off-chain sources on L1.
ENS records Store ENS name resolution information in external storage.

ENS in particular uses cross-chain and off-chain record storage because storing all data on L1 would be too expensive in terms of gas. This approach of reducing gas costs by storing data outside L1 has many potential applications beyond ENS.

Reading is straightforward, but writing is difficult

Reading cross-chain data through ERC3668 is relatively simple. This is because it operates under the following assumptions.

  • Data in external storage is retrieved through an HTTP gateway supporting CCIP-Read.
  • Both L2 chains and databases ultimately supply HTTP responses.

The L1 contract consequently only needs to verify data received over HTTP.

Writing data, on the other hand, had not been standardized. Each service using ERC3668 therefore had to implement the following independently.

  • A secure method for writing to external storage.
  • A mechanism for verifying data validity on L1.

Security differences between storage types

For L2 chains, the rollup mechanism itself incorporates a security model. Data validity verification can therefore rely on the design of the L2.

Database-based storage is different. Because databases are not blockchains, additional measures are required.

  • The ability to prove who wrote the data.
  • The ability to verify on L1 that the data has not been tampered with.

Implementing these mechanisms independently for each service places a substantial burden on both design and implementation.

Intended use cases

The problems ERC7700 aims to solve are particularly important for services such as the following.

Use case Description
Name management in external storage Treat namespaces stored on L2 or in databases as if they were native to L1, as with ENS.
Digital identities in external storage Operate digital identities as if they were stored in an L1 contract.

In these services, it is important that users and applications do not need to know where the data is stored.

Significance of ERC7700

ERC7700 abstracts the destination of storage writes through routers. Applications no longer need to concern themselves with the following.

  • Whether data is on L2.
  • Whether data is in a database.
  • Whether it will be migrated to different storage in the future.

This allows services to be designed independently of the underlying storage technology. By defining a standard for writes in cross-chain environments, ERC7700 (CCIP-Store) complements the read functionality provided by ERC3668.

Cross-chain storage routing overview https://eips.ethereum.org/EIPS/eip-7700

Specification

ERC7700 defines a mechanism allowing a smart contract to determine where data should be written and route the operation to external storage. The cross-chain storage router plays the central role in this specification.

The cross-chain storage router exists as logic within the L1 contract, but the actual storage operation is delegated to external systems such as the following.

Storage destination Description
L1 Ethereum mainnet
L2 Layer 2 chains such as rollups
Database Off-chain storage

ERC7700 defines the following representative routers.

  • StorageRoutedToL1()
  • StorageRoutedToL2()
  • StorageRoutedToDatabase()

These are designed as revert errors indicating where a write should be routed. This design is important: rather than actually storing the data, the smart contract tells the client where to perform the write through a revert.

ERC7700 also anticipates future extensions. It adopts an extension model in which proposals defining new StorageRoutedTo__() errors can be added to support new chains and storage systems.

Possible examples include the following.

Router Storage destination
StorageRoutedToSolana() Solana
StorageRoutedToFilecoin() Filecoin
StorageRoutedToIPFS() IPFS
StorageRoutedToIPNS() IPNS
StorageRoutedToArweave() Arweave
StorageRoutedToArNS() ArNS
StorageRoutedToSwarm() Swarm

This makes ERC7700 an extensible standard independent of any particular storage technology.

L1 Router (StorageRoutedToL1())

How the L1 router works

StorageRoutedToL1() is the simplest storage router. It instructs the client to perform the actual storage operation in a different L1 contract.

There is only one prerequisite for an L1 router.

  • The calldata (function call data) must be identical before and after routing.

In other words, the client must behave as follows.

  1. Send a transaction to an L1 contract.
  2. Receive StorageRoutedToL1 through a revert.
  3. Resubmit the transaction to the specified alternative L1 contract using the same calldata.

L1 call lifecycle

The following illustrates the full workflow when using the L1 router.

sequenceDiagram
    participant Client
    participant L1_A as L1コントラクト(ルーター)
    participant L1_B as L1コントラクト(実体)

    Client->>L1_A: setValue(calldata)
    L1_A-->>Client: revert StorageRoutedToL1(contract)
    Client->>L1_B: setValue(calldata)
    L1_B-->>Client: response

L1 storage call lifecycle https://eips.ethereum.org/EIPS/eip-7700

In this workflow, the initially called contract L1_A does not perform the storage operation. L1_A returns the address of the destination L1 contract (L1_B) through a revert.

The actual storage operation takes place in L1_B. This design clearly separates routing logic from storage logic.

js
// Define revert event
error StorageRoutedToL1(
    address contractL1
);

// Generic function in a contract
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    // Get metadata from on-chain sources
    (
        address contractL1, // Routed contract address on L1; may be globally constant
    ) = getMetadata(node); // Arbitrary code
    // contractL1 = 0x32f94e75cde5fa48b6469323742e6004d701409b
    // Route storage call to L1 router
    revert StorageRoutedToL1( 
        contractL1
    );
};

Events

StorageRoutedToL1
javascript
error StorageRoutedToL1(
    address contractL1
);

An error raised when a storage write is routed to L1. It informs the client that the currently executing contract will not perform the storage operation and that the operation must be executed again in the specified alternative L1 contract using identical calldata. By using revert, the on-chain state remains unchanged and control returns to the client.

Parameters

  • contractL1
    • Address of the L1 contract that should actually execute the operation.

Functions

setValue
javascript
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    (
        address contractL1
    ) = getMetadata(node);

    revert StorageRoutedToL1( 
        contractL1
    );
};

Delegates a storage operation to another L1 contract through the L1 router. The purpose of this function is not to store data directly. First, getMetadata determines the L1 contract to which the operation should be delegated. The function then reverts with StorageRoutedToL1, explicitly indicating the destination contract to the client.

This design allows the contract itself to handle only the routing decision, fully separating the storage logic.

Arguments

  • node
    • Identifier representing the node or namespace being managed.
  • key
    • Key under which the data is stored.
  • value
    • Value to store.

setValue (destination L1 contract)

javascript
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    // Some code storing data mapped by node & msg.sender
    ...
}

Actually stores data on L1. This function belongs to the concrete storage contract specified by the originating router. The client calls the function using exactly the same calldata as the call to the originating contract. Internally, the actual storage update is performed using keys such as node and msg.sender.

Arguments

  • node
    • Node or namespace being managed.
  • key
    • Key under which the data is stored.
  • value
    • Value to store.

L2 Router (StorageRoutedToL2())

Overview

The L2 router in ERC7700 is a mechanism for delegating storage writes to a contract on an L2 chain instead of Ethereum L1. Because L1 storage writes have high gas costs, moving the actual storage to L2 reduces costs.

StorageRoutedToL2() is defined as the minimal router for this purpose.

How the L2 router works

A minimal L2 router requires only the following two pieces of information.

Information Description
contractL2 Address of the L2 contract that actually performs the operation
chainId Chain ID of the target L2 chain

The L1 contract returns this information to the client through a revert. Importantly, the client must ensure that calldata is exactly identical on L1 and L2.

In other words, the function called on L1 and the function executed again on L2 must match in all the following respects.

  • Function name.
  • Argument types and order.
  • The calldata byte sequence.

L2 call lifecycle

The following illustrates the processing flow when using the L2 router.

sequenceDiagram
    participant Client
    participant L1 as L1コントラクト(ルーター)
    participant L2 as L2コントラクト(保存先)

    Client->>L1: setValue(calldata)
    L1-->>Client: revert StorageRoutedToL2(contractL2, chainId)
    Client->>L2: setValue(calldata)
    L2-->>Client: response

L2 storage call lifecycle https://eips.ethereum.org/EIPS/eip-7700

The initially called L1 contract does not perform the storage operation. Instead, it returns a revert instructing the client to execute the operation in contractL2 on the L2 chain identified by chainId.

The client uses this information to call the L2 contract with the same calldata. The actual data storage occurs in that L2 contract.

js
// Define revert event
error StorageRoutedToL2(
    address contractL2, 
    uint256 chainId
);

// Generic function in a contract
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    // Get metadata from on-chain sources
    (
        address contractL2, // Contract address on L2; may be globally constant
        uint256 chainId // L2 ChainID; may be globally constant
    ) = getMetadata(node); // Arbitrary code
    // contractL2 = 0x32f94e75cde5fa48b6469323742e6004d701409b
    // chainId = 21
    // Route storage call to L2 router
    revert StorageRoutedToL2( 
        contractL2,
        chainId
    );
};

Events

StorageRoutedToL2
javascript
error StorageRoutedToL2(
    address contractL2, 
    uint256 chainId
);

An error raised when a storage write is routed to L2. It informs the client that the currently executing L1 contract will not perform the operation and that it must be executed again using identical calldata in a contract on the specified L2 chain. Using revert leaves L1 state unchanged and returns control to the client.

Parameters

  • contractL2
    • Address of the L2 contract that should actually perform the operation.
  • chainId
    • Chain ID of the target L2 chain.

Functions

setValue (L1 contract)
javascript
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    (
        address contractL2,
        uint256 chainId
    ) = getMetadata(node);

    revert StorageRoutedToL2( 
        contractL2,
        chainId
    );
};

Delegates a storage operation to an L2 contract through the L2 router. This function is not intended to store data on L1. Through getMetadata, it obtains the contract and L2 chain to which the operation should be delegated. It then reverts with StorageRoutedToL2, explicitly indicating the L2 destination to the client.

With this design, the L1 contract only makes the routing decision and does not need to contain the actual storage.

Arguments

  • node
    • Identifier representing the node or namespace being managed.
  • key
    • Key under which the data is stored.
  • value
    • Value to store.

setValue (L2 contract)

javascript
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    // Some code storing data mapped by node & msg.sender
    ...
}

Actually stores data on L2. This function belongs to the concrete storage contract specified by the L1 router. The client calls it using exactly the same calldata as on L1.

Internally, data is stored on L2 using keys such as node and msg.sender. Using L2 enables storage operations at substantially lower cost than on L1.

Arguments

  • node
    • Node or namespace being managed.
  • key
    • Key under which the data is stored.
  • value
    • Value to store.

Database Router

Database router overview

The Database Router described here under ERC7694 delegates write operations from Ethereum smart contracts to off-chain databases.

It uses an approach very similar to delegating storage to Ethereum L2. The difference is that the destination is not a blockchain but a database accessed over HTTP.

With the database router, the Ethereum contract does not write any data. It only returns information identifying the gateway to which the operation should be forwarded.

Minimal database router configuration

The Database Router has comparable characteristics to the L2 router in the following two respects.

Item Description
gatewayUrl URL of the HTTP gateway responsible for off-chain storage operations
User signature Verify data validity using a signature generated with eth_sign

Importantly, in ERC7694, the only information stored on L1 is gatewayUrl. Actual data, signatures, and key information are all managed off-chain.

The storage router is therefore designed to return only gatewayUrl when reverting.

The StorageRoutedToDatabase error

The Database Router returns control to the client through a normal revert. The error used for this purpose is StorageRoutedToDatabase.

js
error StorageRoutedToDatabase(
    string gatewayUrl
);

This error signals that the write should be submitted to the specified gatewayUrl for processing instead of being performed on-chain.

Example contract-side processing

The following is a minimal example of a contract using the Database Router.

js
function setValue(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    (
        string gatewayUrl // Gateway URL; may be globally constant
    ) = getMetadata(node);

    // Route storage call to database router
    revert StorageRoutedToDatabase( 
        gatewayUrl
    );
}

The important points about this function are as follows.

  • It does not perform a write.
  • It returns gatewayUrl through a revert.

The Ethereum contract only makes the routing decision, leaving the actual storage operation entirely to the client and gateway.

Database call lifecycle

After the contract reverts, the client follows these steps.

  1. Generate a key for signing data (Data Signer).
  2. Sign the data to be sent off-chain.
  3. Obtain a signature authorizing the Data Signer.
  4. POST the CCIP-Read-compatible payload to the gateway.

1. Generating the Data Signer

Data Signer generation https://eips.ethereum.org/EIPS/eip-7700

What is a Data Signer?

A Data Signer is a dedicated key pair used exclusively for signing off-chain data. It is derived deterministically without directly using the Ethereum wallet's private key.

This provides the following advantages.

  • The user is not asked to sign every time.
  • The key can be regenerated.
  • Its scope can be restricted.
keygen

Generation of the Data Signer is represented by the following pseudocode.

javascript
function keygen(
  username,
  sigKeygen,
  spice
) {
  let inputKey = sha256(sigKeygen);
  let salt = sha256(`${username}:${spice}:${sigKeygen}`);
  let hashKey = hkdf(sha256, inputKey, salt, username, 42);
  return secp256k1(hashKey);
}

Here, a secp256k1 key pair is generated using an Ethereum signature as input.

username

username is an account identifier represented in CAIP10 format.

For more on CAIP10, see the following article.

[CAIP10] Uniform Account Identification Across Blockchains

javascript
const caip10 = `eip155:${chainId}:${wallet}`;

CAIP10 is a standard format that uniquely identifies an address on a particular chain.

spice

spice is a secret value based on an arbitrary password entered by the user. This allows different Data Signers to be generated even for the same wallet.

javascript
const password = 'key1';

The password is not used directly; it is stretched using PBKDF2.

javascript
let pepper = keccak256(abi.encodePacked(username));
let iterations = 500000;

let spice = pbkdf2(
    password, 
    pepper, 
    iterations
);

PBKDF2 deliberately increases computational cost to resist brute-force attacks.

sigKeygen

sigKeygen is a dedicated key generation message that the Ethereum wallet signs.

The signature message has the following format.

text
Requesting Signature To Generate Keypair(s)

Origin: ${username}
Protocol: ${protocol}
Extradata: ${extradata}

extradata is calculated as follows.

js
bytes32 extradata = keccak256(
    abi.encodePacked(
        spice,
        wallet
    )
);

protocol is an identifier restricting the scope to a particular contract.

javascript
const protocol = `eth:${chainId}:${contract}`;

This signature produces a Data Signer dedicated to a particular protocol.

Signing off-chain data

The generated Data Signer can sign multiple data items together.

  • Updates to multiple keys.
  • Updates to multiple nodes.

Both can be performed without additional user interaction.

The signature message has the following format.

text
Requesting Signature To Update Off-Chain Data

Origin: ${username}
Data Type: ${dataType}
Data Value: ${dataValue}

dataType represents a hierarchy using / separators.

Actual data dataType
text > avatar text/avatar
address > 60 address/60

3. Authorizing the Data Signer

The Data Signer is not stored on L1. It therefore requires an authorization signature from the owner or manager.

The authorization message has the following format.

text
Requesting Signature To Approve Data Signer

Origin: ${username}
Approved Signer: ${dataSigner}
Approved By: ${caip10}

Through this signature, a CCIP-Read-compatible contract can verify who explicitly authorized which Data Signer.

4. Generating a CCIP-Read-compatible payload

Finally, the off-chain data is encoded in a format compatible with ERC3668.

js
bytes encodedData = abi.encode(['bytes'], [dataValue]);
bytes funcSelector = callback.signedData.selector; // 0x2b45eb2b

bytes data = abi.encode(
    ['bytes4', 'address', 'bytes32', 'bytes32', 'bytes'],
    [funcSelector, dataSigner, dataSig, approval, encodedData]
);

This format allows an Ethereum contract to verify the following.

  • Whether the Data Signer is authorized.
  • Whether dataSig is a valid signature.

It then treats encodedData as the authoritative result.

POST request format

Finally, the client sends a POST request to gatewayUrl in the following format.

typescript
type Post = {
  node: string
  preimage: string
  chainId: number
  approval: string
  payload: {
    ...
  }
}

For each field, the payload contains the following.

  • Value
  • Signature
  • Timestamp
  • CCIP-Read data

The ENS update example in the proposal demonstrates that multiple records can be updated securely at once.

Additional notes

Overview of an ENS implementation combining L2 and database storage

ERC7700 is particularly well suited to name resolution systems such as ENS. ENS has many types of records that are frequently updated, making it expensive to store all of them on L1.

In this implementation example, different ENS record types use different storage destinations.

ENS operation Storage destination Reason
Ethereum address Database Updated infrequently and requires flexible management
Text records (avatar, etc.) L2 Updated frequently and requires inexpensive writes

ERC7700 makes it possible to build a system that appears to ENS as a single Resolver while the actual storage is distributed across destinations.

L1 contract (ENS Resolver)

The L1 contract serves only as the entry point for the ENS Resolver. It does not perform the actual storage operation, instead indicating where the data should be stored through a revert.

gatewayUrl
javascript
string public gatewayUrl = "https://post.namesys.xyz";

URL of the gateway accepting writes to an off-chain database. It is the destination to which the client sends POST requests. All data intended for database storage, such as ENS address records, is managed through this gateway.

chainId
javascript
uint256 public chainId = uint(21);

Chain ID of the L2 chain serving as the storage destination. This is a chain identifier based on EIP155, used by the client to determine the L2 chain to which it should send the transaction.

For more on EIP155, see the following article.

[EIP155] Replay Protection on Ethereum Networks

contractL2
javascript
address public contractL2 = "0x839B3B540A9572448FD1B2335e0EB09Ac1A02885";

Address of the contract that actually stores data on L2. This contract receives the calldata routed from the L1 Resolver without modification and performs the storage update.

StorageRoutedToL2
javascript
error StorageRoutedToL2(
    uint chainId,
    address contractL2
);

An error raised when a storage operation is routed to L2. It informs the client that the operation will not be completed on L1 and that identical calldata must be sent to the specified L2 contract.

Parameters

  • chainId
    • Identifier of the target L2 chain.
  • contractL2
    • Address of the L2 contract that actually performs the operation.
StorageRoutedToDatabase
javascript
error StorageRoutedToDatabase(
    string gatewayUrl
);

An error raised when a storage operation is routed to an off-chain database. It instructs the client to POST signed data to the specified gateway.

Parameters

  • gatewayUrl
    • HTTP endpoint for database writes.
authorised
javascript
authorised(node)

A modifier restricting execution to the owner or manager of the ENS node. It queries the ENS registry and verifies that the caller is authorized to operate on the target node. This is essential for preventing unauthorized record updates.

Parameters

  • node
    • namehash of the ENS domain.
setAddr
javascript
function setAddr(
    bytes32 node,
    address addr
) authorised(node) {
    revert StorageRoutedToDatabase(
        gatewayUrl
    );
}

Sets the Ethereum address associated with an ENS node. This function stores nothing on L1 and delegates the operation to the database router. Because address records are not changed frequently, database storage is selected to allow flexible management.

Arguments

  • node
    • namehash of the ENS domain to update.
  • addr
    • Ethereum address to set.
setText
javascript
function setText(
    bytes32 node,
    string key,
    string value
) external {
    require(authorised(node), "NOT_ALLOWED");

    revert StorageRoutedToL2(
        chainId, 
        contractL2
    );
}

Sets a text record associated with an ENS node. Text records are stored on L2 because they are updated frequently. L1 only performs the authorization check, while the actual storage is delegated to the L2 contract.

Arguments

  • node
    • namehash of the ENS domain to update.
  • key
    • Text record key.
  • value
    • Value to set.

L2 contract

setText
javascript
function setText(
    bytes32 node,
    bytes32 key,
    bytes32 value
) external {
    records[keccak256(abi.encodePacked(node, msg.sender))]["text"][key] = value;
}

Actually stores ENS text records on L2. This function receives the calldata routed from L1 without modification and stores records using the node and sender as keys. The design takes advantage of the inexpensive storage available on L2.

Arguments

  • node
    • namehash of the ENS domain.
  • key
    • Text record key.
  • value
    • Value to store.

Client-side implementation

Role of the client

The client plays a particularly important role in ERC7700. It receives the L1 revert and completes the operation at the appropriate storage destination according to the error contents.

Example client-side processing
javascript
let signer = keygen(username, sigKeygen, spice);

let post: Post = signData(node, addr, signer.priv);

await fetch(gatewayUrl, {
  method: "POST",
  body: JSON.stringify(post)
});

Client-side processing for writing to an off-chain database. Using a Data Signer deterministically derived from a wallet signature, the client signs the calldata and POSTs it to the gateway. The signature information is verified during subsequent reads through ERC3668.

Additional notes

Technical similarities between L2 and databases

ERC7700 treats routing to L2 and routing to a database as technically similar operations. Both move processing to a different execution environment instead of completing it on Ethereum L1.

The differences are summarized below.

Storage destination Actual operation
L2 Route eth_call to another EVM (L2).
Database Derive eth_sign from eth_call and send signed data externally.

For L2, the storage destination is also an EVM and has the same execution model as Ethereum. The client therefore only needs to call the L2 contract using the same calldata.

A database, on the other hand, is not an EVM. ERC7700 therefore takes the following approach.

  • Use the L1 contract's eth_call as a trigger for signature generation.
  • Store that signature (eth_sign) with the data in a form that can be verified later.

This allows even off-chain data to be securely verified from L1 through ERC3668 (CCIP-Read).

The role of routing

The methods described in ERC7700 do more than simply change the storage destination.

What matters is that they meet both of the following requirements.

  • Delegate storage operations externally.
  • Enable later verification on L1.

L2 relies on the chain's own security model, while database storage performs explicit verification using signatures and authorization.

ERC7700's routing design abstracts these differences.

Improving user experience through the Data Signer

The database router uses a derived Data Signer to sign data. This substantially improves the user experience.

Specifically, the number of signature requests displayed by the wallet is fixed at two.

Signature type Purpose
Signature for Keygen Generate the Data Signer's key
Authorization signature Authorize use of the Data Signer

After these two signatures have been obtained, the following operations can be performed without additional user interaction.

  • Updating multiple records for a single node.
  • Updating multiple nodes in a batch.

This is particularly important in use cases such as ENS, where multiple records may be updated together. Moreover, this improvement in user experience is achieved without additional cost.

Design enabling batch updates

The derived Data Signer has the following characteristics.

  • Unique per wallet.
  • Independent of the number of nodes or records.
  • Can sign in the background.

The client can therefore sign multiple data items together and submit them to the gateway in a single POST request.

This design makes scalable off-chain writes practical under ERC7700.

Security

Handling the derived signer's private key

With the database router, the derived Data Signer's private key is used temporarily on the client. This private key must be discarded immediately after signing is complete.

Leaving it in local storage or memory introduces risks such as the following.

  • Unintended data signing.
  • Data tampering through impersonation.

It must therefore be deleted immediately after signing.

Handling sigKeygen

sigKeygen is crucial information for deterministically generating the Data Signer. Both the signature message and the resulting signature value must be treated as secret information.

If this information leaks, a third party could regenerate the same Data Signer.

Both of the following must therefore be discarded immediately after the keygen() function completes.

  • Signature message.
  • sigKeygen.

Handling password and spice

Password and spice are supplementary secrets used to generate the Data Signer. In particular, spice is generated at high computational cost through PBKDF2, which provides additional security but also makes the consequences of exposure significant.

The client must strictly observe the following rules.

  • Do not persist password.
  • Do not persist spice.
  • Delete them immediately after keygen completes.

Failure to follow these rules can enable regeneration or unauthorized use of the Data Signer.

References

Avneet Singh (@sshmatrix), 0xc0de4c0ffee (@0xc0de4c0ffee), Nick Johnson (@arachnid), Makoto Inoue (@makoto), "ERC-7700: Cross-chain Storage Router Protocol [DRAFT]," Ethereum Improvement Proposals, no. 7700, April 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7700.

Conclusion

This article covered ERC7700, a proposal for securely routing L1 storage operations to L2 chains and off-chain databases, reducing gas costs while preserving verifiability. I hope it was useful.