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.

This article examines ERC6358, a proposal for securely synchronizing token state across blockchains so that tokens can be treated as the same asset on every chain.

The following material is translated, summarized, and supplemented with explanations.

I have also covered various EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ERC6358 proposes a common interface for secure and verifiable asset interactions across blockchains. It aims to standardize cross-chain bridges operating at the smart contract layer independently of any particular consensus mechanism.

This mechanism makes it possible to define new global tokens operating across multiple chains based on existing standards such as ERC20 for tokens and ERC721 for NFTs. Tokens distributed across several blockchains can therefore be treated as a single unified token.

Architecture

image.png https://eips.ethereum.org/EIPS/eip-6358

The diagram shows the overall architecture of ERC6358. ERC6358 enables a global token protocol that records token state across multiple blockchains in a synchronized manner. Here, synchronization means keeping token state, such as ownership and balances, consistent across chains.

This synchronization is accomplished by trustless off-chain synchronizers. The mechanism allows all chains to share the same state without directly transferring assets between chains.

Motivation

Existing blockchain asset transfer mechanisms can fragment assets across token bridges. For example, if ETH is bridged to another blockchain and the destination chain stops operating or becomes corrupted, users may lose their assets.

The central idea of ERC6358 is synchronization rather than transfer. Instead of actually moving assets to another chain, it aims to make each chain share the same asset state. Under this model, even if all other chains stop operating, users do not lose their assets as long as Ethereum remains operational.

This approach offers the following benefits.

Problem Solution proposed by ERC6358
Assets fragmented by bridges Synchronization allows assets to be handled as a unified whole.
Asset loss due to destination chain failure The original assets remain protected because the mechanism synchronizes state instead of transferring assets.
Complex asset management across chains A unified token protocol simplifies management.

The goal is to resolve asset fragmentation and substantially improve the security of user assets across chains.

Specification

Omniverse Accounts

ERC6358 defines an Omniverse Account (o-account) to identify users globally. It serves as a common user identifier across all blockchains.

An o-account should preferably be represented by a public key generated using the secp256k1 elliptic curve. A mapping mechanism for associating this account across different blockchain environments is also recommended.

Data Structures

An Omniverse Transaction (o-transaction) is represented by the following data structure.

ERC6358TransactionData

javascript
/**
 * @notice Omniverse transaction data structure
 * @member nonce: The number of the o-transactions. If the current nonce of an omniverse account is `k`, the valid nonce of this o-account in the next o-transaction is `k+1`. 
 * @member chainId: The chain where the o-transaction is initiated
 * @member initiateSC: The contract address from which the o-transaction is first initiated
 * @member from: The Omniverse account which signs the o-transaction
 * @member payload: The encoded business logic data, which is maintained by the developer
 * @member signature: The signature of the above informations. 
 */
struct ERC6358TransactionData {
    uint128 nonce;
    uint32 chainId;
    bytes initiateSC;
    bytes from;
    bytes payload;
    bytes signature;
}

The basic struct representing an Omniverse Transaction. It contains all information required for an o-transaction. This struct enables consistent transaction data management and signature verification across chains.

Parameters

  • nonce
    • The transaction number. If the current o-account nonce is k, the next transaction uses k+1.
  • chainId
    • The identifier of the blockchain on which the transaction originated.
  • initiateSC
    • The address of the smart contract that initiated the transaction.
  • from
    • The Omniverse Account that signed the transaction.
  • payload
    • Encoded data for business logic defined by the developer.
  • signature
    • The signature over the information above.

Fungible Tokens

The transaction payload should preferably be encoded using the following data structure.

Fungible
javascript
struct Fungible {
    uint8 op;
    bytes exData;
    uint256 amount;
}

A struct representing fungible token operations. It contains the token operation data encoded in the payload. It stores the operation type (op), target account (exData), and amount.

Parameters

  • op
    • The operation type.
    • 0–31 are reserved, while 32–255 may be defined by developers.
    • 0 O-account from sends amount tokens to exData.
    • 1 O-account from mints amount tokens to exData.
    • 2 O-account from burns amount of its own tokens.
  • exData
    • Additional data for the operation. Its contents depend on the operation.
    • When op = 0 or 1 Contains the recipient account.
    • When op = 2 Empty.
  • amount
    • The number of tokens involved in the operation.

The raw data to be signed should preferably consist of the bytes of op, exData, and amount concatenated in that order.

Non-Fungible Tokens

NonFungible
javascript
struct NonFungible {
    uint8 op;
    bytes exData;
    uint256 tokenId;
}

A struct representing NFT (non-fungible token) operations. NFT operation data is stored in the payload. It includes the operation type (op), target account (exData), and token ID (tokenId).

Parameters

  • op
    • The operation type.
    • 0 from sends tokenId to exData.
    • 1 from mints tokenId to exData.
    • 2 from burns tokenId.
  • exData
    • The recipient account. Its contents depend on op.
  • tokenId
    • The identifier of the NFT involved in the operation.

The data to be signed should preferably be generated by concatenating the bytes of op, exData, and tokenId.

decodeData
javascript
function decodeData(bytes memory _data) internal pure returns (Fungible memory) {
    (uint8 op, bytes memory exData, uint256 amount) = abi.decode(_data, (uint8, bytes, uint256));
    return Fungible(op, exData, amount);
}

Converts byte data into a Fungible struct. It reconstructs the operation data (op, exData, amount) from the transaction's payload field.

Arguments

  • _data
    • The payload bytes.

Return Value

  • Fungible
    • The decoded token data structure.
getTransactionHash
javascript
function getTransactionHash(ERC6358TransactionData memory _data) public pure returns (bytes32) {
    Fungible memory fungible = decodeData(_data.payload);
    bytes memory payload = abi.encodePacked(fungible.op, fungible.exData, fungible.amount);
    bytes memory rawData = abi.encodePacked(_data.nonce, _data.chainId, _data.initiateSC, _data.from, payload);
    return keccak256(rawData);
}

Computes a hash of the entire transaction data. It concatenates the main transaction fields and hashes them with keccak256 for signature verification.

Arguments

  • _data
    • The ERC6358TransactionData transaction data structure.

Return Value

  • bytes32
    • The transaction hash.

Interface

All contracts complying with ERC6358 must implement the following IERC6358 interface.

IERC6358

javascript
interface IERC6358 {
    event TransactionSent(bytes pk, uint256 nonce);
    function sendOmniverseTransaction(ERC6358TransactionData calldata _data) external;
    function getTransactionCount(bytes memory _pk) external view returns (uint256);
    function getTransactionData(bytes calldata _user, uint256 _nonce) external view returns (ERC6358TransactionData memory, uint256);
    function getChainId() external view returns (uint32);
}
TransactionSent
javascript
event TransactionSent(bytes pk, uint256 nonce);

An event emitted when a transaction is submitted. When sendOmniverseTransaction is called, the signer's public key and transaction number are emitted in a log.

Parameters

  • pk
    • The signer's public key.
  • nonce
    • The transaction sequence number.
sendOmniverseTransaction
javascript
function sendOmniverseTransaction(ERC6358TransactionData calldata _data) external;

Submits an Omniverse Transaction. It verifies the transaction signature, nonce, and payload, then emits a TransactionSent event. Actual transaction processing should preferably take place in a separate function and may be asynchronous.

Arguments

  • _data
    • The ERC6358TransactionData transaction data structure.
getTransactionCount
javascript
function getTransactionCount(bytes memory _pk) external view returns (uint256);

Retrieves the number of transactions submitted by a specified o-account. This identifies the nonce to use in the next transaction.

Arguments

  • _pk
    • The Omniverse Account to query.

Return Value

  • uint256
    • The current transaction count (the next valid nonce).
getTransactionData
javascript
function getTransactionData(bytes calldata _user, uint256 _nonce) external view returns (ERC6358TransactionData memory, uint256);

Retrieves transaction information for a specific user and nonce. It retrieves the specified transaction's contents and timestamp.

Arguments

  • _user
    • The user's Omniverse Account.
  • _nonce
    • The transaction number to retrieve.

Return Values

  • ERC6358TransactionData
    • Detailed transaction data.
  • uint256
    • The timestamp at which the transaction occurred.
getChainId
javascript
function getChainId() external view returns (uint32);

Retrieves the identifier of the current blockchain. It returns the ID of the blockchain on which the contract operates.

Return Value

  • uint32
    • The chain ID.

Extensions

Fungible Token

javascript
interface IERC6358Fungible is IERC6358 {
    function omniverseBalanceOf(bytes calldata _pk) external view returns (uint256);
}
omniverseBalanceOf

Retrieves the global balance of a specified account. This allows the token balance across all blockchains to be checked as a unified value.

Arguments

  • _pk
    • The Omniverse Account whose balance is being queried.

Return Value

  • uint256
    • The account's global balance.

Non-Fungible Token

javascript
interface IERC6358NonFungible is IERC6358 {
    function omniverseBalanceOf(bytes calldata _pk) external view returns (uint256);
    function omniverseOwnerOf(uint256 _tokenId) external view returns (bytes memory);
}
omniverseBalanceOf

Retrieves the number of NFTs held. It returns the total number of NFTs owned by the specified Omniverse Account.

Arguments

  • _pk
    • The account identifier.

Return Value

  • uint256
    • The number of NFTs held.
omniverseOwnerOf

Retrieves the owner of a specified NFT. It returns the Omniverse Account that owns the NFT corresponding to tokenId.

Arguments

  • _tokenId
    • The NFT identifier.

Return Value

  • bytes
    • The owner's Omniverse Account.

Additional Details

Architecture

In ERC6358, smart contracts deployed on multiple chains execute the same o-transaction (Omniverse Transaction) in a synchronized manner through trustless off-chain synchronizers. Here, trustless means that the design does not require special trust in synchronizers. They transport signed data produced by others without having authority to modify its contents.

The ERC6358 contracts deployed on individual chains are called Abstract Nodes. Each Abstract Node maintains a copy of the same global state, with the copies eventually becoming consistent (eventual consistency). Temporary differences may therefore occur, but the states converge as synchronization progresses.

An off-chain synchronizer is a program that relays an o-transaction published to an Abstract Node on one chain to other chains. Because synchronizers merely transport signed o-transaction data, the Abstract Nodes on each chain perform verification (signatures, nonces, balances, and ownership checks). Security depends on those checks.

Main Components and Their Roles

Component Role
Abstract Node Maintains ERC6358 state on each chain and verifies, accepts, and executes o-transaction data.
Off-chain synchronizer A transport layer that relays signed o-transaction data to another chain.
o-account A global user identifier represented by a secp256k1 public key.
o-transaction A globally synchronized operation request containing a signature, nonce, payload, and other data.

Principles

The design centers on globally unique accounts (o-account), ordering through nonce values, and eventual consistency across chains.

First, an o-account identifies a user uniquely, so the same account has the same meaning on every chain. Two kinds of nonce then ensure consistency. One is the nonce in an o-transaction; the other is the per-account nonce maintained by each chain's Abstract Node (the account nonce). During synchronization, the node checks whether the o-transaction nonce matches the account nonce recorded on that chain, meaning the next value expected to be accepted. This prevents inconsistent transaction ordering and duplicate execution, allowing state on each chain to converge.

With this mechanism, balance (FT) and ownership (NFT) checks follow the same rules on all chains, providing consistent state management through synchronization.

Workflow

The following example uses user A to illustrate submission on Ethereum, synchronization across multiple chains, and eventual consistency. Here, nonce refers to the account nonce maintained by each chain for A's o-account.

  1. Preparing submission Given A's current account nonce, A calls IERC6358::sendOmniverseTransaction on an Ethereum Abstract Node. The nonce in the o-transaction must match the account nonce at that time, representing the next value to be accepted.

  2. Submission and verification on Ethereum The Ethereum Abstract Node verifies the o-transaction signature. It also checks for a sufficient FT balance or NFT ownership, as applicable, and checks whether the o-transaction nonce matches the account nonce. If verification succeeds, the o-transaction is published on Ethereum. However, rather than executing immediately, it is recommended to wait for a specified period. This provides a buffer for the message to reach every chain.

  3. Temporary inconsistency Immediately after submission, Ethereum records that A has submitted the latest nonce, while other chains have not yet received it. This creates temporary differences in nonce and state across chains.

  4. Delivery by synchronizers Off-chain synchronizers detect the newly published o-transaction on Ethereum and deliver it to other chains that have not received it. A reward mechanism may be provided. For example, an ERC6358 token deployer may design a mechanism based on distribution of service fees or a custom mining model. This creates incentives for synchronizers to compete to deliver messages promptly.

  5. Acceptance, verification, and execution on other chains Abstract Nodes on other chains verify the received o-transaction signature, balance or ownership, and nonce. They execute the same logic after the waiting period has elapsed. After execution completes, A's account nonce is incremented by +1 on each chain, and balances, ownership, and other state become consistent.

  6. Eventual consistency Once execution finishes on every chain, A's account nonce has the same value everywhere, and the balances and ownership of related accounts converge to the same global state. This achieves eventual consistency.

Reference Implementation

Omniverse Account

An Omniverse Account is a common user identifier across chains, represented by a secp256k1 public key. The following samples are provided for reference.

  • Public key (example representation of an o-account) 3092860212ceb90a13e4a288e444b685ae86c63232bcb50a064cb3d25aa2c88a24cd710ea2d553a20b4f2f18d2706b8cc5a9d4ae4a50d475980c2ba83414a796

  • Corresponding private key (sample for verification) cdfa0e50d672eb73bc5de00cc0799c70f15c5be6b6fca4a1c82c35c7471125b6

The sample values below are reproduced as constants. Never use them in production.

OMNIVERSE_PUBLIC_KEY_EXAMPLE
javascript
const OMNIVERSE_PUBLIC_KEY_EXAMPLE =
  "3092860212ceb90a13e4a288e444b685ae86c63232bcb50a064cb3d25aa2c88a24cd710ea2d553a20b4f2f18d2706b8cc5a9d4ae4a50d475980c2ba83414a796";

A sample secp256k1 public key representing an Omniverse Account. The public key identifies the same user across chains. It is used to verify signatures, allowing contracts on each chain to confirm their authenticity.

Parameters

  • String (hex)
    • A secp256k1 public key represented as a hexadecimal string.
OMNIVERSE_PRIVATE_KEY_EXAMPLE
javascript
const OMNIVERSE_PRIVATE_KEY_EXAMPLE =
  "cdfa0e50d672eb73bc5de00cc0799c70f15c5be6b6fca4a1c82c35c7471125b6";

A sample secp256k1 private key corresponding to the public key above. This private key is used to generate signatures. Production private keys must never be disclosed. This example is included only to explain the specification.

Parameters

  • String (hex)
    • A secp256k1 private key represented as a hexadecimal string.

Mapping Across Different Environments

A simple implementation uses two mappings. One maps a secp256k1 public key to an account address in the target environment, and the other maps a target environment account address to a secp256k1 public key. This enables bidirectional lookup between the global o-account and chain-specific address schemes.

pkToAddress / addressToPk
javascript
// 環境ごとの対応例(ダミー)
const pkToAddress = {
  // "secp256k1 公開鍵(hex)": "環境固有のアカウントアドレス"
  "3092860...a796": "0xAbCd...1234"
};

const addressToPk = {
  // "環境固有のアカウントアドレス": "secp256k1 公開鍵(hex)"
  "0xAbCd...1234": "3092860...a796"
};

Simple mappings for bidirectional lookup between secp256k1 public keys and account addresses in a particular environment. They associate the o-account global identifier with each chain's address scheme. Contracts and related tools can convert from either representation to the other.

Parameters

  • pkToAddress
    • A mapping from secp256k1 public keys (hex) to environment-specific addresses.
  • addressToPk
    • A mapping from environment-specific addresses to secp256k1 public keys (hex).

Mapping in Flow

Flow natively provides a mechanism for mapping an account address to a public key. Public keys are bound to accounts (Flow's built-in data structure) and can be retrieved directly from the address. For the reverse lookup, public key to address, a mapping such as {String: Address} can use a public key (represented as a string) as the key and a Flow address as the value.

flowPkToAddress
javascript
// Flow 向けの公開鍵→アドレスの対応例(型イメージ)
const flowPkToAddress /* : { [publicKeyString: string]: Address } */ = {
  // "公開鍵(文字列)": Address
  "3092860...a796": "0x1cf0e2f2f715450"
};

An example mapping for looking up addresses from public keys in Flow. Flow natively provides a mechanism for retrieving public keys from an address. Maintaining the reverse lookup in the application makes resolution starting from an o-account easier.

Parameters

  • flowPkToAddress
    • A map whose keys are public keys represented as strings and whose values are Flow addresses.

ERC6358 Tokens

ERC6358 tokens can be implemented using the previously described interfaces (IERC6358, IERC6358Fungible, and IERC6358NonFungible). They can also be combined with existing ERC20 and ERC721 standards. This combines multi-chain operation based on state synchronization with the asset representation of existing token standards.

The following implementation examples are provided for reference (the article does not reproduce their source code).

These implementations incorporate core ERC6358 requirements such as signature and nonce verification and cross-chain synchronization (including waiting periods and off-chain delivery assumptions). When combined with ERC20 or ERC721, asset operations such as transfers, minting, and burning are encoded in the o-transaction payload and executed according to the interface's verification procedures so that contracts on all chains converge to the same result.

Security

Attack Vector Analysis

ERC6358 defines two distinct roles.

Role Description
Common user A party issuing an o-transaction (Omniverse Transaction).
Synchronizer Detects differences across chains and relays o-transaction data to other chains.

The following examines potential attacks involving each role.

Can Synchronizers Act Dishonestly?

The Synchronizer's Role

Synchronizers have no authority to create transactions and only transport signed data belonging to others. Producing signatures requires each user's private key, so synchronizers cannot forge other users' signatures. Any such fraudulent signed transaction would therefore originate from the common user who supplied the signature, rather than from a synchronizer acting alone.

Synchronizer Operation and Verification

A receiving contract must verify the signature on the o-transaction data delivered by a synchronizer. If a synchronizer attempts to alter or forge data, the signature will not match and the transaction will be rejected. Rewards are granted only for delivering valid o-transaction data with a correct signature, so such fraudulent activity would neither succeed nor generate rewards.

Synchronizer Behavior

Synchronizers act under the following conditions.

Condition Action
The account nonce on chain A is smaller than the nonce published on chain B Deliver chain B's o-transaction to chain A.
Different transaction data exists for the same nonce Detect the inconsistent signed data and notify or relay it to both sides.

These actions automatically help reconcile state across chains.

Can Common Users Act Dishonestly?

Attack Scenario (Attempted Double Spend)

Theoretically, a common user could submit different transactions using the same nonce on multiple chains, attempting a double-spend attack. Consider the following scenario.

Situation Details
User A's account nonce is identical on all chains For example, nonce = 5
Token holdings 100 X (an ERC6358 token)
  1. A issues a transaction (ot-P-ab) on a Polkadot parachain to send 10 X to B. The nonce is 6, and the transaction is published on Polkadot after signing and verification.
  2. At the same time, A creates another transaction (ot-E-ac) on Ethereum, sending 10 X to C with the same nonce = 6.

At first glance, A appears to have sent the same assets twice, creating different balances on Polkadot and Ethereum.

System Response and Defense

In this scenario, synchronizers perform the following actions.

  • Deliver ot-P-ab published on Polkadot to Ethereum.
  • Deliver ot-E-ac published on Ethereum to Polkadot.

Because both signatures are valid, the first synchronizer to submit each transaction receives a reward. The contracts on both chains detect different transactions with the same nonce and identify A's attempted fraud. A cannot repudiate the transactions because the signatures are A's own.

Furthermore, ERC6358 prohibits immediate execution and introduces a waiting period. This delay provides time to detect and block inconsistencies or fraud before cross-chain synchronization completes. Thus, even if A submits transactions simultaneously to multiple chains, ultimately only one is activated and the other is invalidated or rolled back.

Handling Extreme Cases

Even if all synchronizers fail because of a network outage or similar problem, the following fail-safe mechanisms are provided.

Situation Response
Some synchronizers are connected to malicious nodes Connect to multiple native nodes to diversify risk.
All synchronizer network connections are interrupted Automatically resume synchronization after network recovery.
A fraudulent transaction executes after the waiting period Identify the relevant history using the nonce mismatch and roll back to the original state.

Developers and token issuers can also impose punitive measures on fraudulent users, such as locking accounts. These measures depend on each token project's tokenomics.

Citation

Shawn Zheng (@xiyu1984), Jason Cheng chengjingxx@gmail.com, George Huang (@virgil2019), Kay Lin (@kay404), "ERC-6358: Cross-Chain Token States Synchronization [DRAFT]," Ethereum Improvement Proposals, no. 6358, January 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6358.

Conclusion

This article covered ERC6358, a proposal for securely synchronizing token state across blockchains so tokens can be treated as the same asset on every chain. I hope you found it useful.

If you have questions, feel free to contact me by direct message on Twitter.

Twitter @cardene777

I also share information on other platforms, so feel free to explore them.

https://chaldene.net/