# Native Account Abstraction (Legacy Chain) Source: https://docs.sophon.xyz/architecture/account-abstraction Account abstraction in the Sophon v1 chain This page describes account abstraction in the legacy Sophon v1 chain. The chain is being wound down; see the [migration guide](/migration) for current actions. Sophon v1 inherited native account abstraction from the ZK Stack. Unlike an ERC-4337 overlay, the ZK Stack transaction model treated programmable accounts and paymasters as protocol-level capabilities. The legacy design supported: * custom signature and authorization logic; * multisignature and recovery patterns; * application-specific transaction restrictions; * paymasters that could sponsor gas or accept alternative fee tokens; * a unified transaction flow for externally owned and smart-contract accounts. This page is an architectural summary, not current deployment guidance. The separate [Sophon Account](/sophon-account/intro) section documents the account SDK and connectors that remain in this repository. # Paymasters (Legacy Chain) Source: https://docs.sophon.xyz/architecture/paymasters Gas sponsorship in Sophon v1 This page describes paymasters in the legacy Sophon v1 chain. Do not begin a new production deployment on Sophon; see the [migration guide](/migration) for current actions. Paymasters were ZK Stack smart contracts that could pay or customize gas fees for a Sophon transaction. Applications used them to sponsor user activity, set allowance rules, grant NFT-based fee benefits, or accept an ERC-20 token in place of SOPH. The implementation guide is retained for teams maintaining a legacy deployment during the wind-down: [Setting Up Paymasters](/build/setting-up-paymasters). # Validium Architecture (Legacy) Source: https://docs.sophon.xyz/architecture/validiums How Sophon v1 used offchain data availability This page documents the legacy Sophon v1 chain architecture. The Sophon Chain is being wound down; see the [migration guide](/migration) for current actions. Sophon v1 was implemented as a Validium built with the ZK Stack. A Validium keeps transaction data outside Ethereum while publishing validity proofs to Ethereum, reducing data costs while retaining proof-based verification of chain state. Sophon used [Avail](https://www.availproject.org/) as its external data-availability layer. Avail stored the data needed to reconstruct state, while Ethereum verified the validity proofs associated with transaction batches. This architecture is retained as historical context only; it is not a roadmap for a new Sophon chain deployment. # ZK Stack Architecture (Legacy) Source: https://docs.sophon.xyz/architecture/zk-stack The ZK Stack foundations of Sophon v1 This page documents the legacy Sophon v1 chain architecture. The Sophon Chain is being wound down; see the [migration guide](/migration) for current actions. Sophon v1 was a ZK Stack chain. The original architecture used ZKsync components to execute transactions on Sophon, prove chain state to Ethereum, and participate in the broader Elastic Chain design. Sophon ZK Stack architecture ## Original design goals * **Scalability:** execute consumer-application transactions outside Ethereum. * **Validity proofs:** use zero-knowledge proofs to verify batched state transitions on Ethereum. * **External data availability:** store reconstructable chain data through Avail. * **Interoperability:** align with ZKsync's Elastic Chain architecture for movement between ZK chains. These points explain the technical thesis behind the legacy chain. Sophon's current direction is product-led, with new applications built on Base rather than a new general-purpose Sophon chain. # Early Partners Program Source: https://docs.sophon.xyz/build/early-partners This is legacy Sophon v1 documentation. The chain is being wound down; do not apply for or begin a new Sophon Chain deployment through this programme. To use Sophon, you'll need our native token (**SOPH**), just like with any blockchain. ## Gas Fees & Paymaster Since the SOPH TGE happened on May 28th, we'll be winding down our ecosystem-wide paymaster two weeks after the launch. Until then, our Paymaster will cover your deployment transactions and contract interactions. Gas costs for L1 to L2 native bridging and transactions done within Sophon Home will still be sponsored by us. Here's how the Paymaster works: * Only whitelisted addresses can deploy new contracts * Anyone can interact with contracts deployed by whitelisted addresses Want to get on the whitelist? Just fill out this [form](https://forms.gle/j3BTuHJUL2apBT8d9) and we'll reach out to help you get started. Deployments will still be permissioned to only whitelisted addresses. Curious about paymasters in general? Check out the [Paymasters](/architecture/paymasters) page for more details. Once you're onboarded, you can follow our [Hardhat](/build/interact/hardhat) or [Foundry](/build/interact/foundry) guides to deploy your contracts. ## Set Up Your Own Paymaster As a partner, you'll be able to run your own paymaster. This means you can sponsor your users' transactions and contract interactions, using your own rules and budgets. Even after our paymaster sunsets, contract deployments will still be limited to whitelisted addresses. Want to set up your own paymaster? Check out our [How to set up a Paymaster](/build/setting-up-paymasters) guide for a step-by-step walkthrough. # zkVM vs EVM Differences Source: https://docs.sophon.xyz/build/evm-compatibility/differences Core differences between Sophon's native zkVM and Ethereum's EVM This is a legacy Sophon v1 technical reference. The chain is being wound down and should not be used for a new production deployment. # zkVM vs EVM Differences Sophon's native zkVM is fundamentally different from Ethereum's EVM as it's designed to generate zero-knowledge proofs while executing smart contracts. While the EVM Bytecode Interpreter enables EVM compatibility (see [limitations](/build/evm-compatibility/evm-interpreter#limitations)), here are the core differences between zkVM and EVM: ## Execution Model * **Proof Generation**: zkVM operations must be ZK-proof friendly, affecting how certain operations work * **Gas Model**: Uses "ergs" instead of gas, with different cost calculations for operations * **State Management**: Different approach to handling state changes due to ZK-proof requirements ## EVM Instruction Differences To check what opcodes differ in behavior between Sophon and Ethereum, see the official [EVM Instructions](https://docs.zksync.io/zksync-protocol/differences/evm-instructions) page. ## Native Features ### Account Abstraction Unlike EVM which requires EIP-4337 for AA, Sophon's zkVM: * Has native account abstraction built into the VM * Provides better performance for AA operations * Handles nonces differently for AA accounts [Learn more about AA differences](https://docs.zksync.io/zksync-protocol/differences/native-vs-eip4337) ### Paymasters zkVM has native support for paymasters: * Built-in paymaster functionality * More efficient fee abstraction * Different gas accounting for sponsored transactions ### System Contracts * Additional precompiled contracts specific to zkVM * Different handling of system-level operations * Native multi-transaction support [Learn more about precompile differences](https://docs.zksync.io/zksync-protocol/differences/pre-compiles) ## State and Storage ### Nonce Handling * Separate nonces for deployments and transactions * Different nonce management for smart contract accounts * Unique nonce behavior for batched transactions [Learn more about nonce differences](https://docs.zksync.io/zksync-protocol/differences/nonces) ### Storage Layout * Different storage slot calculation * Unique handling of immutable references * Modified library linking process [Learn more about storage differences](https://docs.zksync.io/zksync-protocol/differences/libraries) ## Contract Lifecycle ### Deployment * Different bytecode format for native zkVM contracts * Unique contract creation flow * Modified CREATE/CREATE2 behavior for zkVM contracts [Learn more about deployment differences](https://docs.zksync.io/zksync-protocol/differences/contract-deployment) ### Code Execution * Different handling of contract calls * Modified return data handling * Unique error propagation model [Learn more about execution differences](https://docs.zksync.io/zksync-protocol/differences/evm-instructions) # EVM Bytecode Interpreter Source: https://docs.sophon.xyz/build/evm-compatibility/evm-interpreter How Sophon's EVM equivalence module works This is a legacy Sophon v1 technical reference. The chain is being wound down and should not be used for a new production deployment. # EVM Bytecode Interpreter The **EVM Bytecode Interpreter** is a key component of Sophon's **v27 upgrade**, enabling true **EVM equivalence** by allowing the direct execution of unmodified EVM bytecode on Sophon's zkEVM. ## What is EVM Equivalence? **EVM equivalence** means that a blockchain can execute standard EVM bytecode directly, providing: * **Identical behavior** to Ethereum's EVM in all aspects * **Identical address derivation** for contract deployments * **Full compatibility** with standard Ethereum development tools * **No requirement** for special compilation or adaptation This is different from mere "EVM compatibility," which typically requires specialized tooling or compilation steps. For more details, see the official [EVM Interpreter](https://docs.zksync.io/zksync-era/unique-features/evm-interpreter/evm-interpreter) page. ## How the EVM Bytecode Interpreter Works The **EVM Bytecode Interpreter** serves as a crucial system contract that enables the execution of standard EVM bytecode on Sophon's zkEVM, ensuring EVM equivalence. This involves: 1. **Effortless Contract Deployment**: Deploy contracts just as you would on Ethereum, using transactions without a `to` field and embedding contract initialization code as calldata. This process guarantees identical address derivation and behavior as on Ethereum. 2. **Comprehensive Tool Compatibility**: Utilize standard Ethereum development tools like Hardhat and Foundry without needing additional plugins or modifications. 3. **Transparent Execution**: The interpreter operates behind the scenes, invoked automatically by the protocol. Contracts deployed in this manner are flagged as EVM bytecode and executed through the EVM interpreter. During execution, the contract's EVM opcodes are translated into the ZKsync VM's instruction set and executed by the ZKsync VM. Contract Deployment ## Versioned Contract Storage Contracts in Sophon are identified through their **"versioned hash"** in the `AccountCodeStorage`: * **zkEVM contracts**: Version `0x01` * **EVM contracts**: Version `0x02` You can check if a contract was deployed with EVM bytecode by calling the `isAccountEVM(address)` function on the `AccountCodeStorage` system contract at `0x0000000000000000000000000000000000008002`. ## Benefits for Developers **EVM equivalence** provides significant advantages for developers: * **Standard Solidity/Vyper Deployment**: Deploy contracts compiled with standard Solidity/Vyper compilers * **Same Address Derivation**: Get the same contract addresses from `create` and `create2` as on Ethereum * **Familiar Debugging**: Use standard Ethereum debugging tools with deployed contracts * **Cross-VM Interoperability**: EVM and zkEVM contracts can interact (with some limitations) * **Simplified Migration**: Move existing Ethereum contracts to Sophon without code changes * **Code Reuse**: Leverage existing libraries and patterns without modification ## Limitations ### EVM Version Support The EVM Bytecode Interpreter targets the **Cancun** EVM version. This means it includes Cancun's opcodes and features, but may not include future Ethereum upgrades immediately. ### Unsupported Opcodes The following opcodes are not supported due to underlying limitations of ZKsync VM: * `CALLCODE` * `SELFDESTRUCT` * `BLOBHASH` * `BLOBBASEFEE` ### Gas Handling * **Block Gas Limit**: `block.gaslimit` returns `1125899906842624n`, which differs from EVM chains (`36000000n`) * **Gas Conversion**: A fixed ratio (5:1) is used to convert between EVM gas and native zkEVM gas (ergs) * **Higher Costs**: EVM contracts have 150-400% higher gas fees than native zkEVM contracts * **Out-of-Gas Behavior**: If an EVM contract runs out of native zkEVM gas, it triggers a revert of the entire EVM call stack ### Contract Interactions * **EVM-zkEVM Interaction**: Standard calls between EVM and zkEVM contracts work, but `delegatecall` operations are not supported ### Tools and Verification * **Foundry Scripts**: Require the `--skip-simulation` flag due to gas model differences * **Contract Verification**: Must use Sophon's native block explorer API ## The Road to Full EVM Equivalence While the **v27 upgrade** with the **EVM Bytecode Interpreter** brings Sophon much closer to true EVM equivalence, complete equivalence is expected with the next proving system. The current implementation covers most developers' needs but does have some limitations due to the underlying zkEVM architecture. ## zkEVM: The Foundation Sophon's zkEVM is a specialized virtual machine designed to execute smart contracts while generating zero-knowledge proofs of execution. It: * Maintains compatibility with most Ethereum smart contracts * Optimizes operations for efficient ZK-proof generation * Extends functionality with features like paymasters and account abstraction The EVM Bytecode Interpreter builds on this foundation to provide true EVM equivalence while maintaining the benefits of the underlying zkEVM architecture. # Overview Source: https://docs.sophon.xyz/build/evm-compatibility/index Understanding how Sophon's EVM implementation compares to Ethereum This is a legacy Sophon v1 technical reference. The chain is being wound down and should not be used for a new production deployment. # EVM Compatibility While Sophon is EVM compatible and you can use familiar development tools from the Ethereum ecosystem, it provides two ways to deploy contracts: * Native zkEVM contracts (optimized for performance and lower gas costs) * Standard EVM contracts (through the EVM Bytecode Interpreter) ## Key Benefits * **EVM Compatibility**: Most Ethereum smart contracts will work on Sophon * **Familiar Development Tools**: Use the same development tools like Hardhat and Foundry * **Extended Functionality**: Access to additional features like Paymasters * **Dual Execution Models**: Support for both zkEVM native contracts and EVM bytecode contracts ## Recommended Best Practices When developing for Sophon, consider the following: 1. **Test thoroughly on Sophon testnet** before deploying to mainnet 2. Be aware of **gas model differences** between Ethereum and Sophon 3. Understand **limitations in contract interactions** between EVM and zkEVM contracts 4. Take advantage of **zkEVM-specific features** like paymasters and account abstraction ## Core Differences and Implementations Learn about the zkEVM and how it differs from standard Ethereum EVM. How Sophon's EVM Bytecode Interpreter works and enables EVM equivalence. Specific differences between Sophon's zkVM and Ethereum EVM, including opcode and precompile differences. ## Getting Started If you're unfamiliar with developing or deploying on the ZK Stack, check out: * [Start Building](/build/start-building) * [Network Information](/build/network-information) * [Mainnet Information](/build/mainnet) * [Setting Up Paymasters](/build/setting-up-paymasters) * [Your First Contract](https://docs.zksync.io/build/start-coding/quick-start/deploy-your-first-contract) ## Additional Resources Below are some important resources to help you understand Sophon's EVM compatibility: * [Hello ZKsync](https://docs.zksync.io/build/zksync-101/hello-zksync) * [Getting Started: Hardhat](https://docs.zksync.io/zksync-era/tooling/hardhat/guides/getting-started) * [Paymaster](https://docs.zksync.io/zksync-era/unique-features/paymaster) * [EVM Bytecode Interpreter](https://docs.zksync.io/zksync-era/unique-features/evm-interpreter/evm-interpreter) * [zkEVM ↔ EVM Contract Interactions](https://docs.zksync.io/zksync-protocol/evm-interpreter/era-evm-interactions) * [EVM Bytecode Interpreter Documentation](https://docs.zksync.io/zksync-era/unique-features/evm-interpreter/evm-interpreter) * [zkEVM ↔ EVM Contract Interactions](https://docs.zksync.io/zksync-protocol/evm-interpreter/era-evm-interactions) * [EVM Bytecode Interpreter FAQ](https://docs.zksync.io/zksync-era/unique-features/evm-interpreter/faq) # Foundry Source: https://docs.sophon.xyz/build/interact/foundry This guide is retained only for maintaining an existing Sophon v1 deployment. Do not start a new production deployment on the chain. ## Installing Foundry On your command line, run: ``` curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash ``` You can find more info on the official [ZKsync Foundry](https://foundry-book.zksync.io/getting-started/installation) website. ## Create a New Project ``` forge init forge build --zksync ``` This will create a new simple Foundry project with a `Counter` contract. ## Set Configs A full baseline Foundry example can be found on our GitHub [here](https://github.com/sophon-org/hello-foundry-template). Set your `foundry.toml` and `.env` as follows: ```.toml foundry.toml theme={null} # The Default Profile [profile.default] solc_version = "0.8.24" zksolc_version = "1.5.11" src = "src" out = "out" libs = ["lib"] remappings = [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", ] [etherscan] sepoliaTestnet = { key = "${ETHERSCAN_API_KEY}", url = "${SEPOLIA_VERIFIER_URL}", chain = 11155111 } testnet = { key = "${ETHERSCAN_API_KEY}", url = "${SOPHON_TESTNET_VERIFIER_URL}", chain = 531050104 } sophon = { key = "${ETHERSCAN_API_KEY}", url = "${SOPHON_VERIFIER_URL}", chain = 50104 } ethereum = { key = "${ETHERSCAN_API_KEY}", url = "${VERIFIER_URL}", chain = 1 } [rpc_endpoints] sepoliaTestnet = "${SEPOLIA_RPC_URL}" testnet = "${SOPHON_TESTNET_RPC_URL}" sophon = "${SOPHON_RPC_URL}" ethereum = "${RPC_URL}" # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options ``` ```.env .env theme={null} PRIVATE_KEY="" # YOUR_PRIVATE_KEY your developer private key here ETHERSCAN_API_KEY="YOUR_ETHERSCAN_API_KEY" # your Sophscan API gey obtained from sophscan PAYMASTER_ADDRESS=0x98546B226dbbA8230cf620635a1e4ab01F6A99B2 # the paymaster address you want to use # ethereum sepolia SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/sp2BM_VFMURcKWMWg8HDVSBgvnm75_NS SEPOLIA_VERIFIER_URL=https://api.etherscan.io/api SEPOLIA_CHAIN_ID="11155111" # ethereum RPC_URL=https://ethereum-rpc.publicnode.com VERIFIER_URL=https://api.etherscan.io/api CHAIN_ID="1" # sophon testnet SOPHON_TESTNET_RPC_URL=https://rpc.testnet.sophon.xyz SOPHSCAN_TESTNET_VERIFIER_URL="https://api-sepolia.etherscan.io/api" SOPHON_TESTNET_VERIFIER_URL=https://api-explorer-verify.testnet.sophon.xyz/contract_verification SOPHON_TESTNET_CHAIN_ID="531050104" # sophon SOPHON_RPC_URL=https://rpc.sophon.xyz SOPHSCAN_MAINNET_VERIFIER_URL="https://api.sophscan.xyz/api" SOPHON_VERIFIER_URL=https://verification-explorer.sophon.xyz/contract_verification SOPHON_CHAIN_ID="50104" ``` In order to obtain a Sophscan API Key, you need to create an account and get an API Key [here](https://docs.sophscan.xyz/getting-started/viewing-api-usage-statistics). ## Counter Contract Deployment ### Basic Deployment If you run into deployment or interaction issues, always check for possible short-circuit errors caused by environment variables not being properly exposed to the foundry script. You can do so by running `source .env` before running the script or check the variable in your env by running `echo $VARIABLE_NAME`. ``` source .env && forge create ./src/Counter.sol:Counter \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync ``` ### Deployment and Verification Same as [Basic Deployment](#basic-deployment) but you append the `--verify` flag and use the `--verifier zksync` flag to specify the verifier to use the Sophon Explorer or `--verifier etherscan` to use Sophscan. This will only verify on **Sophscan** ``` source .env && forge create ./src/Counter.sol:Counter --rpc-url testnet \ --private-key $PRIVATE_KEY --zksync --verifier zksync \ --verifier-url $TESTNET_VERIFIER_URL ``` ### Deployment Using Paymaster Same as [Basic Deployment](#basic-deployment) but you append the `--zk-paymaster-address` flag The paymaster allows you to perform gasless transactions, so there's no need to have a SOPH balance ``` source .env && forge create ./src/Counter.sol:Counter \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync \ --zk-paymaster-address $PAYMASTER_ADDRESS \ --zk-paymaster-input $(cast calldata "general(bytes)" "0x") ``` ### Deployment With Paymaster and Verification (All-in-One) ``` source .env && forge create ./src/Counter.sol:Counter \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync \ --zk-paymaster-address $PAYMASTER_ADDRESS \ --zk-paymaster-input $(cast calldata "general(bytes)" "0x") --verify \ --verifier zksync --verifier-url $TESTNET_VERIFIER_URL ``` ## Deploy Contracts Using Foundry Scripts ### Deployment Using Script ``` source .env && forge script ./script/Counter.s.sol \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync --broadcast ``` ### Deployment Using Script and Verification Same as [Deployment Using Script](#deployment-using-script) but you append the `--verify` flag This will only verify on **Sophscan** ``` source .env && forge create ./src/Counter.sol:Counter \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync --verify \ --verifier zksync --verifier-url $TESTNET_VERIFIER_URL ``` ### Deployment Using Script With Paymaster Same as [Deployment Using Script](#deployment-using-script) but you append the `--zk-paymaster-address` flag This will only verify on **Sophscan** To use the paymaster within a script, you have 2 options: using a **cheatcode** or making a **low-level** call: #### Using a Foundry Cheatcode * Install [forge-zksync-std library](https://foundry-book.zksync.io/zksync-specifics/forge-zksync-std) * Use the [vmExt.zkUsePaymaster](https://foundry-book.zksync.io/zksync-specifics/cheatcodes/zk-use-paymaster) cheatcode * For your convenience, you can copy-paste the following script: ```solidity theme={null} // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; import {Script, console} from "forge-std/Script.sol"; import {Counter} from "../src/Counter.sol"; import {TestExt} from "lib/forge-zksync-std/src/TestExt.sol"; contract CounterScript is Script, TestExt { Counter public counter; function setUp() public {} function run() public { vm.startBroadcast(); // Encode paymaster input bytes memory paymaster_encoded_input = abi.encodeWithSelector( bytes4(keccak256("general(bytes)")), bytes("0x") ); vmExt.zkUsePaymaster(vm.envAddress("PAYMASTER_ADDRESS"), paymaster_encoded_input); counter = new Counter(); vm.stopBroadcast(); } } ``` You can now run the following command ``` source .env && forge script ./script/Counter.s.sol \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync --broadcast ``` #### Using a Low-Level Call (in Case You Can't Install the Cheatcode Library) For your convenience, you can copy-paste the following script: Here we use `address(vm).call` ```solidity theme={null} // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; import {Script, console} from "forge-std/Script.sol"; import {Counter} from "../src/Counter.sol"; import {TestExt} from "lib/forge-zksync-std/src/TestExt.sol"; contract CounterScript is Script, TestExt { Counter public counter; function setUp() public {} function run() public { vm.startBroadcast(); // Encode paymaster input bytes memory paymaster_encoded_input = abi.encodeWithSelector( bytes4(keccak256("general(bytes)")), bytes("0x") ); (bool success, ) = address(vm).call( abi.encodeWithSignature( "zkUsePaymaster(address,bytes)", vm.envAddress("PAYMASTER_ADDRESS"), paymaster_encoded_input ) ); require(success, "zkUsePaymaster() call failed"); counter = new Counter(); vm.stopBroadcast(); } } ``` You can now run the following command: ``` source .env && forge script ./script/Counter.s.sol \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync --broadcast ``` ### Deployment Using Script With Paymaster and Verification Same as [Deployment Using Script With Paymaster](#deployment-using-script-with-paymaster) but you append the `--verify` flag This will only verify on **Sophscan** ``` source .env && forge script ./script/Counter.s.sol \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync --broadcast --verify \ --verifier etherscan --verifier-url $SOPHSCAN_TESTNET_VERIFIER_URL ``` ## Contract Verification If you want to verify an already deployed contract, you can do so on [Sophscan](https://sophscan.xyz) (an Etherscan-like explorer) and/or on [Sophon's Explorer](https://explorer.sophon.xyz). **On Sophscan** ``` source .env && forge verify-contract COUNTER_CONTRACT_ADDRESS \ ./src/Counter.sol:Counter:Counter --watch --rpc-url testnet --zksync \ --verifier zksync --verifier-url $SOPHSCAN_TESTNET_VERIFIER_URL ``` **On Sophon's Explorer** ``` forge verify-contract COUNTER_CONTRACT_ADDRESS ./src/Counter.sol:Counter \ --watch --verifier zksync --verifier-url $SOPHON_VERIFIER_URL --zksync ``` ### Using Libraries If your contract relies on external libraries, you need to build it with the linked libraries during deployment. For example: If you deploy a library via the EVM Equivalence Module, you can't link it to a zkEVM contract. We advise to keep your libraries inline, in possible. Check how to compile non-inlinable libraries [here](https://docs.zksync.io/zksync-era/tooling/hardhat/guides/compiling-libraries). ``` forge build --zksync --libraries ./contracts/util/SignatureChecker.sol:SignatureChecker:0xb0A2cf27Bf984bd0c56dCFb37C9DA0F2c5028844 ``` This ensures the library is properly linked during the build and deploy process, enabling verification to succeed. ### Contracts With Constructor Params If your contract receives constructor params, you can use the `--constructor-args` flag: Modify your Counter contract to receive a constructor param: ```solidity theme={null} // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; contract Counter { uint256 public number; constructor(uint256 _number) { number = _number; } function setNumber(uint256 newNumber) public { number = newNumber; } function increment() public { number++; } } ``` You can now run: ```shell theme={null} forge create ./src/CounterWithConstructorParams.sol:Counter \ --rpc-url testnet --private-key $PRIVATE_KEY --zksync \ --constructor-args "$(cast abi-encode "constructor(uint256)" "123")" ``` To verify or use the paymaster, you can use the flags `--verify` and/or `----zk-paymaster-address` as explained above. ## Check if a contract is whitelisted by the paymaster Before making calls to a newly deployed contract using a paymaster, it's important to verify that the contract has been added to the paymaster's whitelist. Our automated contract whitelisting service typically takes 2-3 seconds to whitelist new contracts under normal network conditions. While optional, checking the whitelist status before proceeding makes deployment scripts more robust by ensuring contracts are ready to interact with the paymaster. The code below provides a reference implementation for checking the whitelist status: ```solidity theme={null} // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; import {Script, console} from "forge-std/Script.sol"; import {Counter} from "../src/Counter.sol"; import {TestExt} from "lib/forge-zksync-std/src/TestExt.sol"; interface IRestrictionContract { function contractWhitelist(address) external view returns (bool); } contract CounterScript is Script, TestExt { Counter public counter; function setUp() public {} function run() public { vm.startBroadcast(); address restrictionContractAddress = vm.envAddress("RESTRICTION_CONTRACT"); address paymasterAddress = vm.envAddress("PAYMASTER_ADDRESS"); uint256 waitTime = 5_000; // wait time in milliseconds uint256 maxAttempts = 5; bool isWhitelisted = false; uint256 attempts = 0; if (restrictionContractAddress != address(0)) { IRestrictionContract restrictionContract = IRestrictionContract(restrictionContractAddress); while (!isWhitelisted && attempts < maxAttempts) { try restrictionContract.contractWhitelist(address(this)) returns (bool whitelisted) { isWhitelisted = whitelisted; if (isWhitelisted) { console.log("Contract is whitelisted on restriction contract!"); break; } else { attempts++; if (attempts < maxAttempts) { console.log("Contract not yet whitelisted. Waiting before retrying..."); vm.sleep(waitTime); } else { console.log("Contract still not whitelisted after max attempts. Proceeding anyway."); } } } catch { console.log("Error checking whitelist status. Retrying..."); attempts++; if (attempts < maxAttempts) { vm.sleep(waitTime); } } } } // Encode paymaster input bytes memory paymaster_encoded_input = abi.encodeWithSelector( bytes4(keccak256("general(bytes)")), bytes("0x") ); (bool success, ) = address(vm).call( abi.encodeWithSignature( "zkUsePaymaster(address,bytes)", paymasterAddress, paymaster_encoded_input ) ); require(success, "zkUsePaymaster() call failed"); counter = new Counter(); vm.stopBroadcast(); } } ``` # Hardhat/Ethers Source: https://docs.sophon.xyz/build/interact/hardhat Learn about how to develop on Sophon using Hardhat This guide is retained only for maintaining an existing Sophon v1 deployment. Do not start a new production deployment on the chain. ## Getting Started ### Project Setup We recommend scaffolding your project using the [zksync-cli](https://github.com/matter-labs/zksync-cli). ### Configuration In order to obtain a Sophscan API Key, you need to create an account and get an API Key [here](https://docs.sophscan.xyz/getting-started/viewing-api-usage-statistics). Set up your project with the following configuration: ```typescript hardhat.config.ts theme={null} import type { HardhatUserConfig } from "hardhat/config"; import "@matterlabs/hardhat-zksync"; import * as dotenv from "dotenv"; // Load environment variables from .env file dotenv.config(); const config: HardhatUserConfig = { defaultNetwork: "sophonTestnet", networks: { hardhat: { zksync: true, }, sophonMainnet: { url: "https://rpc.sophon.xyz", ethNetwork: "mainnet", verifyURL: "https://verification-explorer.sophon.xyz/contract_verification", browserVerifyURL: "https://explorer.sophon.xyz/", enableVerifyURL: true, zksync: true, accounts: [process.env.WALLET_PRIVATE_KEY as string], }, sophonTestnet: { url: "https://rpc.testnet.sophon.xyz", ethNetwork: "sepolia", verifyURL: "https://api-explorer-verify.testnet.sophon.xyz/contract_verification", browserVerifyURL: "https://explorer.testnet.sophon.xyz/", enableVerifyURL: true, zksync: true, accounts: [process.env.WALLET_PRIVATE_KEY as string], }, }, zksolc: { version: "latest", settings: {}, }, solidity: { version: "0.8.27", }, etherscan: { enabled: true, apiKey: { sophonTestnet: process.env.ETHERSCAN_SOPHON_API_KEY as string, sophonMainnet: process.env.ETHERSCAN_SOPHON_API_KEY as string, }, customChains: [ { network: "sophonTestnet", chainId: 531050104, urls: { apiURL: "https://api-testnet.sophscan.xyz/api", browserURL: "https://testnet.sophscan.xyz", }, }, { network: "sophonMainnet", chainId: 50104, urls: { apiURL: "https://api.sophscan.xyz/api", browserURL: "https://sophscan.xyz", }, }, ], }, }; export default config; ``` ```env .env theme={null} WALLET_PRIVATE_KEY=your_private_key_here ETHERSCAN_SOPHON_API_KEY=your_sophscan_api_key_here ``` ## Contract Deployment ### Basic Deployment Here's how to deploy a contract without using the paymaster: ```typescript theme={null} import { utils } from "zksync-ethers"; const deployer = new Deployer(hre, wallet); const artifact = await deployer.loadArtifact("Your_Contract"); const contract = await deployer.deploy(artifact, constructorArguments || []); ``` ### Deployment with Paymaster During the alpha stage, you'll need to use our Paymaster to sponsor transactions. Here's how to deploy using the paymaster: ```typescript theme={null} import { Provider, Wallet, utils } from "zksync-ethers"; import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; import { HardhatRuntimeEnvironment } from "hardhat/types"; export default async function (hre: HardhatRuntimeEnvironment) { const provider = new Provider(hre.network.config.url); const wallet = new Wallet(process.env.WALLET_PRIVATE_KEY!, provider); const deployer = new Deployer(hre, wallet); const artifact = await deployer.loadArtifact("your_contract"); const params = utils.getPaymasterParams( "0x98546B226dbbA8230cf620635a1e4ab01F6A99B2", // Paymaster address { type: "General", innerInput: new Uint8Array(), } ); const contract = await deployer.deploy( artifact, [], // Constructor arguments undefined, // Deployment type (use undefined for regular contract deployment) { customData: { paymasterParams: params, gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT, }, } ); } ``` ### Proxy Deployment To deploy proxy contracts with paymaster support: ```typescript theme={null} import { utils } from "zksync-ethers"; const deployer = new Deployer(hre, wallet); const artifact = await deployer.loadArtifact("Your_Contract"); await hre.zkUpgrades.deployProxy(deployer.zkWallet, artifact, [initializerArgs], { initializer: "initialize", paymasterProxyParams: params, paymasterImplParams: params, }); ``` ## Contract Interaction To interact with deployed contracts using the paymaster: ```typescript theme={null} import { utils } from "zksync-ethers"; const paymasterParams = utils.getPaymasterParams("0x98546B226dbbA8230cf620635a1e4ab01F6A99B2", { type: "General", innerInput: new Uint8Array(), }); const tx = await contract.yourFunction(params, { customData: { gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT, paymasterParams: paymasterParams, }, }); ``` ## Contract Verification You can verify contracts on both Sophscan and Sophon's explorer: ```bash theme={null} npx hardhat verify --network sophonTestnet DEPLOYED_CONTRACT_ADDRESS constructor_arguments ``` ## Check if a contract is whitelisted by the paymaster Before making calls to a newly deployed contract using a paymaster, it's important to verify that the contract has been added to the paymaster's whitelist. Our automated contract whitelisting service typically takes 2-3 seconds to whitelist new contracts under normal network conditions. While optional, checking the whitelist status before proceeding makes deployment scripts more robust by ensuring contracts are ready to interact with the paymaster. The code below provides a reference implementation for checking the whitelist status: ```typescript theme={null} const restrictionContractAddress = (hre.network.config as unknown as CustomNetworkConfig) ?.restrictionContract; if (restrictionContractAddress && usePaymaster) { const contractAddress = await contract.getAddress(); logger.info( `Checking if ${contractName} (${contractAddress}) is whitelisted on restriction contract...` ); // Create interface for the restriction contract const restrictionContractABI = [ { inputs: [ { internalType: "address", name: "", type: "address", }, ], name: "contractWhitelist", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, ]; const provider = hre.ethers.provider; const restrictionContract = new hre.ethers.Contract( restrictionContractAddress, restrictionContractABI, provider ); let isWhitelisted = false; let attempts = 0; const maxAttempts = 5; while (!isWhitelisted && attempts < maxAttempts) { try { isWhitelisted = await restrictionContract.contractWhitelist(contractAddress); if (isWhitelisted) { logger.info(`${contractName} is now whitelisted on restriction contract!`); } else { attempts++; if (attempts < maxAttempts) { logger.info( `${contractName} is not yet whitelisted. Waiting ${ waitTime / 1000 } seconds before retry (attempt ${attempts}/${maxAttempts})...` ); await new Promise((resolve) => setTimeout(resolve, waitTime)); } else { logger.warn( `${contractName} is still not whitelisted after ${maxAttempts} attempts. Proceeding anyway, but paymaster transactions might fail.` ); } } } catch (error) { logger.error(`Error checking whitelist status: ${error}`); attempts++; if (attempts < maxAttempts) { await new Promise((resolve) => setTimeout(resolve, waitTime)); } } } } ``` # SDKs Source: https://docs.sophon.xyz/build/interact/sdks This section will explain how to use popular SDKs with Sophon and provide all the relevant external links This SDK guide is retained for legacy Sophon v1 deployments. Do not use it to start a new production deployment on the chain. **Sophon** is compatible with ZKsync Era SDKs, providing developers with powerful tools to build their applications. These SDKs offer features like enhanced scalability, security, and improved user experience through **Paymaster** support and **Account Abstraction**. For detailed documentation and guides, visit [ZKsync's SDK Documentation](https://sdk.zksync.io/). ## JavaScript/TypeScript Recommended SDK for Ethers.js integration, supporting both v5 and v6. Perfect for existing Ethereum projects. Modern TypeScript-first Ethereum library with excellent developer experience and type safety. Popular Web3 library integration for developers familiar with the Web3.js ecosystem. To understand better how to use our Paymaster for contract interactions, check our detailed **viem & wagmi with Sophon** [page](/build/interact/viem-wagmi). ## Other Languages Full-featured SDK for Go developers with comprehensive blockchain integration capabilities. Python integration for blockchain development, perfect for data-driven applications. Enterprise-grade Java SDK for building robust blockchain applications. Native iOS development support for building mobile blockchain applications. Systems programming SDK with Rust for high-performance blockchain applications. # Tenderly Source: https://docs.sophon.xyz/build/interact/tenderly This integration guide is retained for legacy Sophon v1 deployments. Verify any service endpoint directly before relying on it during the chain wind-down. ## Overview [Tenderly](https://tenderly.co/) has fully integrated with Sophon, providing developers with a suite of tools to streamline smart contract development, testing, and monitoring. This integration enables seamless debugging, simulation, and infrastructure support for dApps deployed on the Sophon network, both on mainnet as well as on testnet. ## Key Features ### Virtual TestNets Tenderly Virtual TestNets allow developers to create forked environments of the Sophon mainnet or testnet for safe and controlled testing. These environments can be configured to stay up-to-date with the latest mainnet transactions, ensuring that developers work with the most recent blockchain state. **Benefits:** * Real-time synchronisation with mainnet * Safe testing without affecting on-chain data * Improved contract iteration speed For more details, refer to the [Sophon Testnet RPC Reference](https://docs.tenderly.co/node/rpc-reference/sophon-testnet). ### Node RPC Tenderly provides high-performance RPC endpoints for both the Sophon mainnet and testnet, allowing developers to interact with the blockchain reliably and at scale. **RPC Endpoints:** * **Mainnet RPC Reference:** `https://sophon.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY` * **Testnet RPC Reference:** `https://sophon-testnet.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY` #### Example Configuration: ```javascript theme={null} const provider = new ethers.providers.JsonRpcProvider('https://sophon.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY'); ``` Replace `$TENDERLY_NODE_ACCESS_KEY` with your actual access key obtained from the Tenderly dashboard. For this you need to sign up [here](https://dashboard.tenderly.co/register). ### Smart Contract Debugging Developers can leverage Tenderly’s real-time debugging tools to inspect transaction execution, variables, and state changes. This significantly improves the debugging process and helps identify contract issues before deployment. **Debugging Features:** * **Transaction Replays:** Re-execute failed transactions to diagnose issues. * **Real-time Debugger:** Step through contract execution and inspect variables. * **Gas Profiling:** Analyse gas consumption and optimize contract efficiency. For detailed usage, see the [debug\_traceCall reference](https://docs.tenderly.co/node/rpc-reference/sophon/debug_traceCall). ### Simulation and Testing Tenderly enables developers to simulate transactions before execution, reducing the risk of unexpected behaviour. **Simulation Capabilities:** * **Transaction Simulator:** Preview transaction outcomes before submission. * **Forking Capabilities:** Create isolated forks of the Sophon mainnet for testing. * **Unit Testing:** Execute smart contract tests in a controlled environment. #### Example usage: * **Mainnet Simulation:** [tenderly\_simulateTransaction](https://docs.tenderly.co/node/rpc-reference/sophon/tenderly_simulateTransaction) * **Testnet Simulation:** [tenderly\_simulateTransaction](https://docs.tenderly.co/node/rpc-reference/sophon-testnet/tenderly_simulateTransaction) ### Gas Estimation Tenderly provides advanced gas estimation to optimise transaction costs. For more details, check out the [tenderly\_estimateGas reference](https://docs.tenderly.co/node/rpc-reference/sophon/tenderly_estimateGas). ### Monitoring and Alerting Tenderly offers robust monitoring and alerting solutions, allowing developers to track the performance and security of their smart contracts. **Monitoring Features:** * **Real-time Alerts:** Notifications for failed transactions, gas spikes, and security threats. * **Webhook Integrations:** Connect alerts with Slack, Discord, Telegram, or other tools. * **Custom Metrics:** Monitor specific contract activities and dApp performance. ### Infrastructure Services Tenderly provides essential infrastructure services to support developers in deploying and maintaining dApps on Sophon. **Available Services:** * **Tenderly Node:** High-performance RPC with built-in simulation and debugging tools. * **Event Streaming:** Subscribe to real-time contract events. * **Gas Estimation API:** Optimize gas fees for transactions. ## Getting Started ### 1. Set Up Your Tenderly Account 1. Sign up or log in to [Tenderly](https://dashboard.tenderly.co/) 2. Navigate to the **Sophon** integration page 3. Generate your **TENDERLY\_NODE\_ACCESS\_KEY** ### 2. Configure RPC in Your Project ```javascript theme={null} const provider = new ethers.providers.JsonRpcProvider('https://sophon.gateway.tenderly.co/YOUR_ACCESS_KEY'); ``` ### 3. Fork the Sophon Mainnet/Testnet ```bash theme={null} curl -X POST 'https://api.tenderly.co/api/v1/fork' \ -H 'Authorization: Bearer YOUR_ACCESS_KEY' \ -d '{"network_id":"sophon-mainnet"}' ``` ### 4. Debug Transactions ```bash theme={null} curl -X POST 'https://api.tenderly.co/api/v1/debug' \ -H 'Authorization: Bearer YOUR_ACCESS_KEY' \ -d '{"hash":"0xYourTransactionHash"}' ``` ## Supported SDKs Sophon is compatible with multiple programming languages and frameworks, including: * **JavaScript/TypeScript:** Ethers.js, Viem * **Go, Python, Java, Swift, Rust** ## Additional Resources * [Tenderly Documentation](https://docs.tenderly.co/) * [Sophon Documentation](https://docs.sophon.xyz/build/interact/sdks) * [Tenderly Blog on Sophon Integration](https://blog.tenderly.co/creating-engaging-dapps-on-sophon-with-tenderly/) By leveraging Tenderly’s tools, developers can enhance their workflow, improve contract reliability, and create high-quality dApps on the Sophon blockchain. # Viem/Wagmi Source: https://docs.sophon.xyz/build/interact/viem-wagmi This guide is retained only for maintaining an existing Sophon v1 integration. Do not start a new production integration on the chain. The popular Viem + Wagmi frontend setup can be used with Sophon. This section will provide a working PoC repository, relevant code snippets, and some cool gotchas that will help you working with this stack. Check out our simple PoC [repository](https://github.com/sophon-org/hello-paymaster-wagmi-viem) that demonstrates how to use **Viem** and **Wagmi** together with the **Paymaster** . # Using `Viem` with a Paymaster When building dApps on **Sophon**, it's important to correctly integrate our **Paymaster** to sponsor transactions, especially before **SOPH** is distributed. This guide provides a working pattern, using `Viem` and `Wagmi`, for sending contract calls with Paymaster support on **Sophon**. ## ✅ Working Code Snippet ```ts theme={null} "use client"; import { getAccount, getPublicClient, switchChain, writeContract } from "@wagmi/core"; import { Abi, AbiItemArgs, Address, createWalletClient, custom, encodeFunctionData, Hash, Hex, } from "viem"; import { Config } from "Wagmi"; import { eip712WalletActions, getGeneralPaymasterInput } from "viem/zksync"; import { sophonTestnet, sophonMainnet } from "viem/chains"; export default async function sendTransaction( wagmiConfig: Config, chainId: number, address: Address, abi: Abi, functionName: string, args: AbiItemArgs, value?: bigint ): Promise { const account = getAccount(wagmiConfig); if (!account.address) throw new Error("No account connected."); if (account.chainId !== chainId) await switchChain(wagmiConfig, { chainId }); const publicClient = getPublicClient(wagmiConfig, { chainId }); if (!publicClient) throw new Error("No public client available."); const estimateGas = await publicClient.estimateContractGas({ account: account.address, address, abi, functionName, args, value, }); // const nextNonce = await publicClient.getTransactionCount({ // address: account.address, // }); // Handle Sophon-specific logic if (chainId === 50104 || chainId === 531050104) { const walletClient = createWalletClient({ chain: chainId === 50104 ? sophonMainnet : sophonTestnet transport: custom(window.ethereum!), }).extend(eip712WalletActions()); const paymaster: Address = "0x98546B226dbbA8230cf620635a1e4ab01F6A99B2"; const paymasterInput: Hex = getGeneralPaymasterInput({ innerInput: "0x", }); const txData = encodeFunctionData({ abi, functionName, args }); const hash = await walletClient.sendTransaction({ account: account.address, to: address, data: txData, value, gas: estimateGas, chain, paymaster, paymasterInput, // nonce: nextNonce, enable if you want to use a specific nonce }); return hash; } // Fallback for non-ZKsync chains return await writeContract(wagmiConfig, { address, chainId, abi, functionName, args, value, gas: estimateGas, }); } ``` ## **⚠️ Key Gotchas to Watch Out For** ### **1. Missing paymasterInput or incorrect format** `paymasterInput` **must** be passed, even if it’s an empty `0x` using: ``` getGeneralPaymasterInput({ innerInput: "0x" }). ``` Manually hardcoding `paymasterInput = "0x"` will not work. ### **2. Use ZKsync wallet extensions** Extend your wallet client with `eip712WalletActions()` to support `sendTransaction` with Paymasters. ```typescript theme={null} const walletClient = createWalletClient({ chain: sophonTestnet, // or `sophonMainnet` transport: custom(window.ethereum!), }).extend(eip712WalletActions()); ``` ### **3. Pre-calculating the nonce is possible, but optional** Based on your personal use-cases, you can pre-calculate nonces, but this is also handled internally by Wagmi's `publicClient` **provider wrapper**. ```typescript theme={null} const publicClient = getPublicClient(wagmiConfig, { chainId }); const nextNonce = await publicClient.getTransactionCount({ address: account.address, }); const hash = await walletClient.sendTransaction({ account: account.address, to: address, data: txData, value, gas: estimateGas, chain: sophonTestnet, // chain client that is connected paymaster, paymasterInput, nonce: nextNonce, }); ``` # ZKsync CLI Source: https://docs.sophon.xyz/build/interact/zksync-cli This guide is retained only for maintaining an existing Sophon v1 deployment. Do not start a new production deployment on the chain. The [ZKsync CLI](https://github.com/matter-labs/zksync-cli) is a powerful tool designed to simplify the setup, development, testing, and deployment of contracts on ZK Chains. It also provides a way to scaffold dApps using templates leveraging various frontend and web3 libraries. **ZKsync CLI** is published on npm as [**`zksync-cli`**](https://www.npmjs.com/package/zksync-cli). Commands are invoked using `npx zksync-cli` in the terminal. **Prerequisites** * [Node.js v18 or higher](https://nodejs.org/en) * [Git](https://git-scm.com/downloads) * [Docker](https://www.docker.com/get-started/) (for `zksync-cli dev` commands) ## Usage You can run commands without installation: `npx zksync-cli` (For example: `npx zksync-cli dev start`). ## Available Commands To learn more about the available commands in ZKsync CLI, see the [**CLI reference**](https://docs.zksync.io/zksync-era/tooling/zksync-cli/reference). Here are the main command categories and their common use cases: ### Bridge Transfer assets between L1 and L2. ```bash theme={null} npx zksync-cli bridge deposit # Move funds from Ethereum (L1) to ZKsync (L2) npx zksync-cli bridge withdraw # Initiate withdrawal from L2 to L1 npx zksync-cli bridge withdraw-finalize # Complete the withdrawal process to L1 ``` ### Config Chains Manage custom chain configurations. ```bash theme={null} npx zksync-cli config chains add # Add a new custom chain npx zksync-cli config chains edit # Modify existing chain settings ``` ### Contract Interact with smart contracts. ```bash theme={null} npx zksync-cli contract read # Execute read-only contract methods npx zksync-cli contract write # Send transactions to contracts npx zksync-cli contract encode # Generate calldata from contract methods ``` ### Create Bootstrap new projects using templates. ```bash theme={null} npx zksync-cli create # Create new projects with various templates: # - Frontend (Vue, React, Next.js, Nuxt, Vite) # - Contracts (Hardhat with Solidity/Vyper) # - Scripting (Node.js automation) ``` ### Dev Manage local development environment. ```bash theme={null} npx zksync-cli dev start # Start local dev environment npx zksync-cli dev clean # Clean data for configured modules npx zksync-cli dev config # Select modules to run locally ``` ### Transaction Query transaction details. ```bash theme={null} npx zksync-cli transaction info # Get detailed information about a transaction ``` ### Wallet Manage wallet operations. ```bash theme={null} npx zksync-cli wallet balance # Check token balance for an address npx zksync-cli wallet transfer # Send funds on L2 to another account ``` # Mainnet Source: https://docs.sophon.xyz/build/mainnet These contracts belong to the legacy Sophon Chain, which is being wound down. They are retained for existing integrations and withdrawal support only. Do not use the former `LzOftHelper` as a current bridge route; Sophon is no longer on LayerZero. ### Chain Contracts | Name | Address | Comment | | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | BridgeHub Proxy | `0x303a465B659cBB0ab36eE643eA362c509EEb5213` ([link](https://etherscan.io/address/0x303a465B659cBB0ab36eE643eA362c509EEb5213)) | Acts as a hub for bridges, so that they have a single point of communication with all ZK chain contracts ([reference](https://docs.zksync.io/zk-stack/components/shared-bridges#components-bridgehub)) | | Diamond Proxy | `0x05eDE6aD1f39B7A16C949d5C33a0658c9C7241e3` ([link](https://etherscan.io/address/0x05eDE6aD1f39B7A16C949d5C33a0658c9C7241e3)) | The main contract uses [EIP-2535](https://eips.ethereum.org/EIPS/eip-2535) diamond proxy pattern ([reference](https://docs.zksync.io/build/developer-reference/era-contracts/l1-contracts#diamondproxy)) | | Governance | `0xE1eeA4D6443b19D373Fe99De838b930Ef0ac2Ad3` ([link](https://etherscan.io/address/0xE1eeA4D6443b19D373Fe99De838b930Ef0ac2Ad3)) | Deployer and Admin multi-sig for ZK chains | | Shared Bridge | L1: `0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB` ([link](https://etherscan.io/address/0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB))
L2: `0x954ba8223a6BFEC1Cc3867139243A02BA0Bc66e4` ([link](https://explorer.sophon.xyz/address/0x954ba8223a6BFEC1Cc3867139243A02BA0Bc66e4)) | Bridges assets between L1 and hyperchains, supporting both ETH and ERC20 tokens ([reference](https://docs.zksync.io/zk-stack/components/shared-bridges)) | | Verifier | `0xc2eE6b6af7d616f6e27ce7F4A451Aedc2b0F5f5C` ([link](https://etherscan.io/address/0xc2eE6b6af7d616f6e27ce7F4A451Aedc2b0F5f5C)) | ZK proof verifier contract | ### Useful Contracts | Name | Address | Comment | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Sophon Global Paymaster | L2: `0x98546B226dbbA8230cf620635a1e4ab01F6A99B2` ([link](https://explorer.sophon.xyz/address/0x98546B226dbbA8230cf620635a1e4ab01F6A99B2)) | Sponsors all transactions | | Multicall | `0x5f4867441d2416cA88B1b3fd38f21811680CD2C8` ([link](https://explorer.sophon.xyz/address/0x5f4867441d2416cA88B1b3fd38f21811680CD2C8)) | Enables more efficient contract querying: [https://github.com/mds1/multicall](https://github.com/mds1/multicall) | | Disperse | `0x7853Fa386191EF961e6448dEBE4C3E205F7A4215` ([link](https://explorer.sophon.xyz/address/0x7853Fa386191EF961e6448dEBE4C3E205F7A4215)) | Enables batch transfers for tokens and SOPH : [https://github.com/sophon-org/disperse](https://github.com/sophon-org/disperse) | | TimestampAsserter | `0x3070e0Ff401098d250D78D4aeAF6fC85C6bD29ff` ([link](https://explorer.sophon.xyz/address/0x3070e0Ff401098d250D78D4aeAF6fC85C6bD29ff)) | Verifies if the current block timestamp falls within a specified range | | Permit2 | `0xb8e9B994102309E820cf29BA0D98673C8995Ebad` ([link](https://explorer.sophon.xyz/address/0xb8e9B994102309E820cf29BA0D98673C8995Ebad)) | Makes token approvals easier and more secure: [https://github.com/Uniswap/permit2](https://github.com/Uniswap/permit2) | | LzOftHelper (retired) | `0x88172F3041Bd0787520dbc9Bd33D3d48e1fb46dc` | Legacy contract; Sophon is no longer connected to LayerZero. Do not use it for new transfers. | | Seaport 1.6 | `0x18f4D8BbEE9F8783E17B7f2F3Cc18c9Be346ba44` ([link](https://explorer.sophon.xyz/address/0x18f4D8BbEE9F8783E17B7f2F3Cc18c9Be346ba44)) | OpenSea's marketplace protocol for safely and efficiently buying and selling NFTs | | Conduit Controller | `0x0E5267441f3dC4BEC3bbC7f0e6588239c76C1B75` ([link](https://explorer.sophon.xyz/address/0x0E5267441f3dC4BEC3bbC7f0e6588239c76C1B75)) | Protocol component for Seaport that manages token transfers | ### Tokens | Asset | Address | L1 Address | | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | ETH | `0x72af9F169B619D85A47Dfa8fefbCD39dE55c567D` ([link](https://explorer.sophon.xyz/address/0x72af9F169B619D85A47Dfa8fefbCD39dE55c567D)) | `0x0000000000000000000000000000000000000000` ([link](https://etherscan.io/address/0x0000000000000000000000000000000000000000)) | | SOPH | `0x000000000000000000000000000000000000800A` ([link](https://explorer.sophon.xyz/address/0x000000000000000000000000000000000000800A)) | `0x6B7774CB12ed7573a7586E7D0e62a2A563dDd3f0` ([link](https://etherscan.io/token/0x6B7774CB12ed7573a7586E7D0e62a2A563dDd3f0)) | | WSOPH | `0x2b1A859dE6A55c553520D7780Bc5805712B128F9` ([link](https://explorer.sophon.xyz/address/0x2b1A859dE6A55c553520D7780Bc5805712B128F9)) | N/A | | vSOPH | `0xe1A376fa16f40A1dc3712463616054e6CCA338ED` ([link](https://explorer.sophon.xyz/address/0xe1A376fa16f40A1dc3712463616054e6CCA338ED)) | N/A | | BEAM | `0x7A94dFb534ec790277Ad332EFB9B11687A130880` ([link](https://explorer.sophon.xyz/address/0x7A94dFb534ec790277Ad332EFB9B11687A130880)) | `0x62d0a8458ed7719fdaf978fe5929c6d342b0bfce` ([link](https://etherscan.io/address/0x62d0a8458ed7719fdaf978fe5929c6d342b0bfce)) | | stZENT | `0x351ca00C5B64C03CA6d1eB9ABe5355ed449ac19C` ([link](https://explorer.sophon.xyz/address/0x351ca00C5B64C03CA6d1eB9ABe5355ed449ac19C)) | `0x996d67aa9b37df96428ad3608cb21352bf1fdb90` ([link](https://etherscan.io/address/0x996d67aa9b37df96428ad3608cb21352bf1fdb90)) | | stATH | `0x42E5bFdC7032D1F8e4B4D3fea3Eb5dB9C01Ef997` ([link](https://explorer.sophon.xyz/address/0x42E5bFdC7032D1F8e4B4D3fea3Eb5dB9C01Ef997)) | `0xc96aa65f31e41b4ca6924b86d93e25686019e59c` ([link](https://etherscan.io/address/0xc96aa65f31e41b4ca6924b86d93e25686019e59c)) | | PEPE | `0x06432e41131B70708c1C46814c2fcE9e720edd8A` ([link](https://explorer.sophon.xyz/address/0x06432e41131B70708c1C46814c2fcE9e720edd8A)) | `0x6982508145454Ce325dDbE47a25d4ec3d2311933` ([link](https://etherscan.io/address/0x6982508145454Ce325dDbE47a25d4ec3d2311933)) | | USDT | `0x6386dA73545ae4E2B2E0393688fA8B65Bb9a7169` ([link](https://explorer.sophon.xyz/address/0x6386dA73545ae4E2B2E0393688fA8B65Bb9a7169)) | `0xdac17f958d2ee523a2206206994597c13d831ec7` ([link](https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7)) | | USDC | `0x9Aa0F72392B5784Ad86c6f3E899bCc053D00Db4F` ([link](https://explorer.sophon.xyz/address/0x9Aa0F72392B5784Ad86c6f3E899bCc053D00Db4F)) | `0xac85cda0c91d5571e79deac9ecef6fa90978bb5b` ([link](https://etherscan.io/address/0xac85cda0c91d5571e79deac9ecef6fa90978bb5b)) | | wstETH | `0x60D02F185F80644e1A5ae35497736dd31d1b078B` ([link](https://explorer.sophon.xyz/address/0x60D02F185F80644e1A5ae35497736dd31d1b078B)) | `0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0` ([link](https://etherscan.io/address/0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0)) | | weETH | `0x5E9Fc50b44988B66BA84500f8Bc32C0493fe8F8D` ([link](https://explorer.sophon.xyz/address/0x5E9Fc50b44988B66BA84500f8Bc32C0493fe8F8D)) | `0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee` ([link](https://etherscan.io/address/0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee)) | | sDAI | `0xeCcbb9360d235548473Cb8C752735F68e652439B` ([link](https://explorer.sophon.xyz/address/0xeCcbb9360d235548473Cb8C752735F68e652439B)) | `0x83f20f44975d03b1b09e64809b757c47f942beea` ([link](https://etherscan.io/address/0x83f20f44975d03b1b09e64809b757c47f942beea)) | | DAI | `0x88171a5BbAcd92ca5e25575c5904581C80B025Dd` ([link](https://explorer.sophon.xyz/address/0x88171a5BbAcd92ca5e25575c5904581C80B025Dd)) | `0x6B175474E89094C44Da98b954EedeAC495271d0F` ([link](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F)) | | wBTC | `0xF1f9E08a0818594FDe4713AE0Db1E46672Ca960E` ([link](https://explorer.sophon.xyz/address/0xF1f9E08a0818594FDe4713AE0Db1E46672Ca960E)) | `0x2260fac5e5542a773aa44fbcfedf7c193bc2c599` ([link](https://etherscan.io/address/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599)) | | stAZUR | `0x841bE23f3872309f50E0c955c8Cb4b660f733811` ([link](https://explorer.sophon.xyz/address/0x841bE23f3872309f50E0c955c8Cb4b660f733811)) | `0x67f3228fd58f5a26d93a5dd0c6989b69c95618eb` ([link](https://etherscan.io/address/0x67f3228fd58f5a26d93a5dd0c6989b69c95618eb)) | | stAVAIL | `0xB2253e3D9A00e1471Ae7A3F77cBe7d81ec542A3e` ([link](https://explorer.sophon.xyz/address/0xB2253e3D9A00e1471Ae7A3F77cBe7d81ec542A3e)) | `0x3742f3fcc56b2d46c7b8ca77c23be60cd43ca80a` ([link](https://etherscan.io/address/0x3742f3fcc56b2d46c7b8ca77c23be60cd43ca80a)) | | USN | `0xC1AA99c3881B26901aF70738A7C217dc32536d36` ([link](https://explorer.sophon.xyz/address/0xC1AA99c3881B26901aF70738A7C217dc32536d36)) | `0xdA67B4284609d2d48e5d10cfAc411572727dc1eD` ([link](https://etherscan.io/address/0xdA67B4284609d2d48e5d10cfAc411572727dc1eD)) | # Network Information Source: https://docs.sophon.xyz/build/network-information These endpoints are for the legacy Sophon Chain while it remains operational. New deposits are disabled, and the final decommissioning date will be announced in advance. Do not use this network for a new production deployment. Paymaster: `0x98546B226dbbA8230cf620635a1e4ab01F6A99B2` ### Mainnet * RPC URLs: * `https://rpc.sophon.xyz` | `https://rpc.sophonapi.com` * `https://rpc-quicknode.sophon.xyz` * Chain ID: `50104` * Explorer: [https://explorer.sophon.xyz](https://explorer.sophon.xyz) ([docs](https://api-explorer.sophon.xyz/docs)) * Sophscan: [https://sophscan.xyz](https://sophscan.xyz) ([docs](https://docs.sophscan.xyz)) ### Testnet * RPC URLs: * `https://rpc.testnet.sophon.xyz` | `https://rpc.testnet.sophonapi.com` * `https://rpc-quicknode.testnet.sophon.xyz` * Chain ID: `531050104` * Explorer: [https://explorer.testnet.sophon.xyz](https://explorer.testnet.sophon.xyz) ([docs](https://api-explorer.sophon.xyz/docs)) * Sophscan: [https://testnet.sophscan.xyz](https://testnet.sophscan.xyz) ([docs](https://docs.sophscan.xyz)) * Faucet: [https://thirdweb.com/sophon](https://thirdweb.com/sophon) # Account Abstraction Source: https://docs.sophon.xyz/build/partners/account-abstraction This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Dynamic Dynamic Effortless login, wallet creation and user management solutions. * Site: [https://www.dynamic.xyz/](https://www.dynamic.xyz/) * Docs: [https://docs.dynamic.xyz/](https://docs.dynamic.xyz/) ### Openfort Openfort [Openfort](https://openfort.io) is an open-source alternative to wallet infrastructure solutions. The core offerings —Openfort Kit, Invisible Wallet, and Cross-app Wallet - enable rapid integration of wallet functionality, intuitive onboarding, and flexible user journeys for any application or ecosystem. * Site: [https://openfort.io/](https://openfort.io/) * Docs: [https://openfort.io/docs](https://openfort.io/docs) # Block Explorers Source: https://docs.sophon.xyz/build/partners/block-explorers This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Sophscan Sophscan [Etherscan](https://etherscan.io/)-based Block Explorer providing comprehensive chain analytics and contract verification. * Site: [https://sophscan.xyz/](https://sophscan.xyz/) * Docs: [https://docs.sophscan.xyz/](https://docs.sophscan.xyz/) ### Sophon Explorer Sophon Explorer Sophon's Block Explorer which is meant to be a more user-friendly alternative to Sophscan. **Mainnet:** * Site: [https://explorer.sophon.xyz/](https://explorer.sophon.xyz/) * API Endpoint: [https://api-explorer.sophonapi.com/](https://api-explorer.sophonapi.com/) * Docs: [https://api-explorer.sophon.xyz/docs](https://api-explorer.sophon.xyz/docs) **Testnet:** * Site: [https://explorer.testnet.sophon.xyz/](https://explorer.testnet.sophon.xyz/) * API Endpoint: [https://block-explorer-api.testnet.sophonapi.com/](https://block-explorer-api.testnet.sophonapi.com/) * Docs: [https://block-explorer-api.testnet.sophon.xyz/docs](https://block-explorer-api.testnet.sophon.xyz/docs) **Important** Write operations support **Sophon's Paymaster** in both Sophscan and Sophon Explorer. # Gaming Source: https://docs.sophon.xyz/build/partners/gaming This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Beam Beam Leverage the Beam stack to build the new generation of games. * Site: [https://hub.onbeam.com/](https://hub.onbeam.com/) * Documentation: [https://docs.onbeam.com/](https://docs.onbeam.com/) # Indexers Source: https://docs.sophon.xyz/build/partners/indexers This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Goldsky Goldsky The go-to data indexer for web3 builders, offering high-performance subgraph hosting and realtime data replication pipelines. * Site: [https://goldsky.com/](https://goldsky.com/) * Documentation: [https://docs.goldsky.com/introduction](https://docs.goldsky.com/introduction) ### Envio Envio Modern, multi-chain data indexing framework for easily querying real-time and historical data from any EVM blockchain. * Site: [https://envio.dev/](https://envio.dev/) * Documentation: [https://docs.envio.dev/docs/HyperIndex/overview](https://docs.envio.dev/docs/HyperIndex/overview) # Infrastructure Source: https://docs.sophon.xyz/build/partners/infrastructure This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Avail Avail Sophon's Data Availability layer providing scalable and secure data availability solutions. * Site: [https://www.availproject.org/](https://www.availproject.org/) * Docs: [https://docs.availproject.org/](https://docs.availproject.org/) ### TxSync TxSync All-in-one platform for using and building on Sophon. * Site: [https://www.txsync.io/](https://www.txsync.io/) * Docs: [https://docs.txsync.io/](https://docs.txsync.io/) ### Unifra Unifra Open, reliable infrastructure service for web3 developers. * Site: [https://unifra.io/](https://unifra.io/) * Docs: [https://unifra.readme.io/](https://unifra.readme.io/) ### Thirdweb Thirdweb Full stack, open-source web3 development platform. * Site: [https://thirdweb.com/](https://thirdweb.com/) * Docs: [https://docs.thirdweb.com/](https://docs.thirdweb.com/) * Testnet Faucet: [https://thirdweb.com/sophon](https://thirdweb.com/sophon) # Oracles & zkTLS Source: https://docs.sophon.xyz/build/partners/oracles This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Stork Stork Open data marketplace designed to address the limitations of traditional blockchain oracles, providing ultra low-latency price feeds. * Site: [https://www.stork.network/](https://www.stork.network/) * Documentation: [https://docs.stork.network/](https://docs.stork.network/) ### Reclaim Reclaim zkTLS solution to bring user activity, reputation, and identity from external websites into your platform. * Site: [https://www.reclaimprotocol.org/](https://www.reclaimprotocol.org/) * Docs: [https://docs.reclaimprotocol.org/](https://docs.reclaimprotocol.org/) ### Redstone Redstone Modular Oracle offering 1,250+ data feeds in Pull model. * Site: [https://redstone.finance/](https://redstone.finance/) * Documentation: [https://docs.redstone.finance/](https://docs.redstone.finance/) # Overview Source: https://docs.sophon.xyz/build/partners/overview This is a legacy Sophon Chain partner directory. The chain is being wound down, and Sophon's new applications are being built on Base. Welcome to Sophon's ecosystem partners page. Here you'll find a comprehensive list of partners and solutions building on Sophon, categorized by their primary focus areas: Chain analytics and block exploration tools Data indexing and querying solutions Core infrastructure and development platforms Wallet and user management solutions Oracle networks and zkTLS providers Gaming infrastructure and tools Payment and fiat on-ramp solutions # Payment Solutions Source: https://docs.sophon.xyz/build/partners/payments This is a legacy Sophon Chain partner reference. Service availability may change during the wind-down; verify it directly with the provider. ### Transak Transak Developer integration toolkit to enable users to buy/sell crypto in any app. * Site: [https://transak.com/](https://transak.com/) As an EVM-compatible chain, Sophon works with existing wallets out of the box. Check the [Network Information](https://docs.sophon.xyz/using-sophon) page to manually add Sophon to your wallet. # Paymasters Source: https://docs.sophon.xyz/build/setting-up-paymasters How to create and use paymasters This guide is retained only for existing Sophon v1 integrations during the chain wind-down. Do not deploy a new production paymaster on Sophon. ## Creating Your Own Paymaster You can create your own paymaster with your custom logic to subsidize users in multiple ways. For general information on paymasters, please refer to the [Paymasters](/architecture/paymasters) page. ### 1. Deploy via txSync [txSync Tsuko](https://app.txsync.io/tsuko) offers everyone an easy way to create sponsored paymasters on Sophon and Sophon testnet. To create one, please follow our [walkthrough video](https://www.loom.com/share/bf5d2d2d774646eaa2aed3c71a822263?sid=7ba4d65f-465b-442e-b22a-30f52d75997d). Via **txSync Tsuko**, you can: * Top it up with **SOPH** * Withdraw your **SOPH** from it at any time * Monitor it (see usage) * Add extensions It is important to restrict your paymasters to your target audience only to avoid unintended usage. ### Configure Your Restrictions [txSync Tsuko](https://app.txsync.io/tsuko) extensions offer you a list of pre-built restrictions you can plug into your paymasters to filter transactions. This list includes: * **User whitelisting**: specify which user addresses (EOAs) can send a transaction. * **Contract whitelisting**: specify which contract addresses can be interacted with. * **Function whitelisting**: specify both contracts AND functions from those contracts that can be interacted with. * **NFT(ERC721) whitelisting**: exclusively authorize paymaster access for holders of a specific NFT collection on Sophon. For more detail, check their detailed list [here](https://app.txsync.io/tsuko/restriction-catalog). ### 2. Deploy via Hardhat/Foundry The [ZKsync contract templates](https://github.com/matter-labs/zksync-contract-templates/tree/main/templates/101/contracts/4-paymaster) repository has examples for both ERC20-based paymasters as well as sponsored(gasless) ones. If you are proficient with direct on-chain deployments, you can tailor these examples to your needs and deploy it following their respective [deployment templates](https://github.com/matter-labs/zksync-contract-templates/blob/main/templates/101/deploy/4-paymaster/gasless/deploy.ts). # Legacy Chain Development Source: https://docs.sophon.xyz/build/start-building Archived Sophon Chain developer documentation The Sophon Chain is being wound down, and new deposits have been disabled since June 25, 2026. Do not start a new production deployment on Sophon. Sophon's new applications are being built on Base. This section preserves the Sophon v1 network, contract, EVM-compatibility, and tool documentation for teams maintaining an existing integration during the wind-down. Access the legacy RPC, chain ID, and explorers. Review the legacy chain's EVM compatibility. Find the Sophon v1 chain contracts. Review the chain timeline and asset-withdrawal process. # Testnet Source: https://docs.sophon.xyz/build/testnet This is legacy Sophon Chain testnet documentation. The production chain is being wound down, and Sophon's new applications are being built on Base. ### Chain Contracts | Name | Address | Comment | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | BridgeHub Proxy | L1: `0x35a54c8c757806eb6820629bc82d90e056394c92` ([link](https://sepolia.etherscan.io/address/0x35a54c8c757806eb6820629bc82d90e056394c92)) | Acts as a hub for bridges, so that they have a single point of communication with all ZK chain contracts ([reference](https://docs.zksync.io/zk-stack/components/shared-bridges#components-bridgehub)) | | Create2 Factory | L1: `0xce0042b868300000d44a59004da54a005ffdcf9f` ([link](https://sepolia.etherscan.io/address/0xce0042b868300000d44a59004da54a005ffdcf9f)) | CREATE2 factory contract for deterministic address deployment | | Default Upgrade | L1: `0x27a7f18106281fe53d371958e8bc3f833694d24a` ([link](https://sepolia.etherscan.io/address/0x27a7f18106281fe53d371958e8bc3f833694d24a)) | Used to upgrade chain contracts. | | Diamond Proxy | L1: `0xdd02368f378eed3779b358d2020a77e4d022236d` ([link](https://sepolia.etherscan.io/address/0xdd02368f378eed3779b358d2020a77e4d022236d)) | The main contract uses [EIP-2535](https://eips.ethereum.org/EIPS/eip-2535) diamond proxy pattern ([reference](https://docs.zksync.io/build/developer-reference/era-contracts/l1-contracts#diamondproxy)) | | ERC20 Bridge | L1: `0x2ae09702f77a4940621572fbcdae2382d44a2cba` ([link](https://sepolia.etherscan.io/address/0x2ae09702f77a4940621572fbcdae2382d44a2cba))
L2: `0xb10dd9f622ad0192cb007e12d5359081b90273bb` ([link](https://explorer.testnet.sophon.xyz/address/0xb10dd9f622ad0192cb007e12d5359081b90273bb)) | Canonical bridge for ERC20 tokens ([reference](https://docs.zksync.io/zk-stack/components/shared-bridges#main-asset-shared-bridges)) | | Governance | L1: `0x8550bc5b4a16f62a86f7bbd2d89412915c9587e6` ([link](https://sepolia.etherscan.io/address/0x8550bc5b4a16f62a86f7bbd2d89412915c9587e6)) | Deployer and Admin multi-sig for ZK chains | | Shared Bridge | L1: `0x3e8b2fe58675126ed30d0d12dea2a9bda72d18ae` ([link](https://sepolia.etherscan.io/address/0x3e8b2fe58675126ed30d0d12dea2a9bda72d18ae))
L2: `0xb10dd9f622ad0192cb007e12d5359081b90273bb` ([link](https://explorer.testnet.sophon.xyz/address/0xb10dd9f622ad0192cb007e12d5359081b90273bb)) | Bridges assets between L1 and hyperchains, supporting both ETH and ERC20 tokens ([reference](https://docs.zksync.io/zk-stack/components/shared-bridges)) | | State Transition Proxy | L1: `0x4e39e90746a9ee410a8ce173c7b96d3afed444a5` ([link](https://sepolia.etherscan.io/address/0x4e39e90746a9ee410a8ce173c7b96d3afed444a5)) | Acts as a connector between Ethereum (L1) and ZK Chain (L2) ([reference](https://docs.zksync.io/build/developer-reference/era-contracts/l1-contracts#diamond-also-mentioned-as-state-transition-contract)) | | Transparent Proxy Admin | L1: `0x0358baca94dcd7931b7ba7aaf8a5ac6090e143a5` ([link](https://sepolia.etherscan.io/address/0x0358baca94dcd7931b7ba7aaf8a5ac6090e143a5)) | Admin Contract for the Transparent Proxy | | Validator Timelock | L1: `0xd3876643180a79d0a56d0900c060528395f34453` ([link](https://sepolia.etherscan.io/address/0xd3876643180a79d0a56d0900c060528395f34453)) | An intermediate smart contract between the validator EOA account and the ZKsync smart contract ([reference](https://docs.zksync.io/build/developer-reference/era-contracts/l1-contracts#validatortimelock)) | | Verifier | L1: `0xac3a2dc46cea843f0a9d6554f8804aed18ff0795` ([link](https://sepolia.etherscan.io/address/0xac3a2dc46cea843f0a9d6554f8804aed18ff0795)) | ZK proof verifier contract | ### Useful Contracts | Name | Address | Comment | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Sophon Global Paymaster | L2: `0x98546B226dbbA8230cf620635a1e4ab01F6A99B2` ([link](https://explorer.testnet.sophon.xyz/address/0x98546B226dbbA8230cf620635a1e4ab01F6A99B2)) | Sponsors all transactions | | SOPH | `0x000000000000000000000000000000000000800A` ([link](https://explorer.testnet.sophon.xyz/address/0x000000000000000000000000000000000000800A)) | Native SOPH token | | WSOPH | `0x9B7EA63EF5062661570afe548e3AD691D5652527` ([link](https://explorer.testnet.sophon.xyz/address/0x9B7EA63EF5062661570afe548e3AD691D5652527)) | Wrapped SOPH | | Bridged USDC | L2: `0x27553b610304b6AB77855a963f8208443D773E60` ([link](https://explorer.testnet.sophon.xyz/address/0x27553b610304b6AB77855a963f8208443D773E60))
L2 Custom Bridge: `0x72591d4135B712861d8d4513a2f6860Ac30A684D` ([link](https://explorer.testnet.sophon.xyz/address/0x72591d4135B712861d8d4513a2f6860Ac30A684D))
L1: `0xbf4fdf7bf4014ea78c0a07259fbc4315cb10d94e` ([link](https://sepolia.etherscan.io/address/0xbf4fdf7bf4014ea78c0a07259fbc4315cb10d94e)) | Main USDC contract - Follows Circle standard | | Multicall | `0x83c04d112adedA2C6D9037bb6ecb42E7f0b108Af` ([link](https://explorer.testnet.sophon.xyz/address/0x83c04d112adedA2C6D9037bb6ecb42E7f0b108Af)) | Enables more efficient contract querying: [https://github.com/mds1/multicall](https://github.com/mds1/multicall) | | Disperse | `0x7853Fa386191EF961e6448dEBE4C3E205F7A4215` ([link](https://explorer.testnet.sophon.xyz/address/0x7853Fa386191EF961e6448dEBE4C3E205F7A4215)) | Enables batch transfers for tokens and SOPH : [https://github.com/sophon-org/disperse](https://github.com/sophon-org/disperse) | | Permit2 | `0x37CcE35d6A19C3948e9557308E705Ee64404B3D0` ([link](https://explorer.testnet.sophon.xyz/address/0x37CcE35d6A19C3948e9557308E705Ee64404B3D0)) | Makes token approvals easier and more secure: [https://github.com/Uniswap/permit2](https://github.com/Uniswap/permit2) | | TimestampAsserter | `0x3070e0Ff401098d250D78D4aeAF6fC85C6bD29ff` ([link](https://explorer.testnet.sophon.xyz/address/0x3070e0Ff401098d250D78D4aeAF6fC85C6bD29ff)) | Verifies if the current block timestamp falls within a specified range | | LzOftHelper (retired) | `0x88172F3041Bd0787520dbc9Bd33D3d48e1fb46dc` ([link](https://explorer.testnet.sophon.xyz/address/0x88172F3041Bd0787520dbc9Bd33D3d48e1fb46dc)) | Legacy testnet contract; do not use it for new transfers. | | Seaport 1.6 | `0x18f4D8BbEE9F8783E17B7f2F3Cc18c9Be346ba44` ([link](https://explorer.testnet.sophon.xyz/address/0x18f4D8BbEE9F8783E17B7f2F3Cc18c9Be346ba44)) | OpenSea's marketplace protocol for safely and efficiently buying and selling NFTs | | Conduit Controller | `0x0E5267441f3dC4BEC3bbC7f0e6588239c76C1B75` ([link](https://explorer.testnet.sophon.xyz/address/0x0E5267441f3dC4BEC3bbC7f0e6588239c76C1B75)) | Protocol component for Seaport that manages token transfers | # USDC (Legacy) Source: https://docs.sophon.xyz/build/tokens/USDC Legacy bridged USDC contracts and current withdrawal guidance New deposits into the Sophon Chain are disabled. Do not call the former L1 deposit flow. Withdraw any USDC balance through [claim.sophon.com](https://claim.sophon.com). ## Withdraw USDC 1. Open [claim.sophon.com](https://claim.sophon.com). 2. Select **Withdraw from Sophon** for the USDC balance. 3. Review the paths supplied through Jumper and choose the appropriate destination. The portal may offer the canonical Ethereum route or another supported path, depending on current availability. ## Legacy contract addresses * **Sophon USDC token:** [`0x9Aa0F72392B5784Ad86c6f3E899bCc053D00Db4F`](https://explorer.sophon.xyz/address/0x9Aa0F72392B5784Ad86c6f3E899bCc053D00Db4F) * **Ethereum USDC bridge:** [`0xf553E6D903AA43420ED7e3bc2313bE9286A8F987`](https://etherscan.io/address/0xf553E6D903AA43420ED7e3bc2313bE9286A8F987) * **Sophon USDC bridge:** [`0x0f44bac3ec514be912aa4359017593b35e868d74`](https://explorer.sophon.xyz/address/0x0f44bac3ec514be912aa4359017593b35e868d74) ## Historical implementation Sophon used a custom bridge based on ZKsync's Shared Bridge implementation and the [Bridged USDC Standard](https://www.circle.com/bridged-usdc). The L2 bridge held the minter role for the bridged USDC token, while withdrawals burned the Sophon representation and released the corresponding Ethereum-side asset after the batch was finalized. This information is retained for existing integration and withdrawal support only. # LayerZero Integration (Retired) Source: https://docs.sophon.xyz/build/tokens/layerzero_integration Archived status of the Sophon Chain LayerZero integration Sophon was removed from the LayerZero network on **June 25, 2026**. Do not deploy new OFT routes to Sophon or call the former `LzOftHelper` contracts. The previous Sophon-specific LayerZero integration and `LzOftHelper` flow are retired as part of the Sophon Chain wind-down. Existing code samples were removed because they no longer describe a supported production route. For SOPH: * withdraw from Sophon to Ethereum through the canonical route at [claim.sophon.com](https://claim.sophon.com); * bridge from Ethereum to another supported chain through LayerZero. For other assets on Sophon, use the claim portal's **Withdraw from Sophon** action. It routes users through Jumper and shows the paths currently available for each asset. See [SOPH Bridging](/build/tokens/soph-bridging) and the [chain migration guide](/migration) for current guidance. # SOPH Bridging Source: https://docs.sophon.xyz/build/tokens/soph-bridging Current SOPH routes during the Sophon Chain wind-down Since **June 25, 2026**, deposits into the Sophon Chain have been disabled and Sophon is no longer connected to LayerZero. Use [claim.sophon.com](https://claim.sophon.com) to withdraw SOPH from Sophon. ## Current architecture SOPH is an ERC-20 token native to Ethereum. The token at the system address on the Sophon Chain is a canonically bridged representation, not a separate token that needs to be migrated. As part of the chain wind-down, the SOPH NativeOFTAdapter moved from Sophon to Ethereum. This makes Ethereum the hub for LayerZero routes to other supported chains. ## Supported flows * **Sophon → Ethereum:** use the canonical withdrawal route through [claim.sophon.com](https://claim.sophon.com). * **Ethereum → another supported chain:** use the LayerZero SOPH route available for the destination. * **Sophon → another chain:** first withdraw SOPH canonically to Ethereum, then use LayerZero from Ethereum to the supported destination. The following flows are no longer supported: * Ethereum → Sophon deposits; * LayerZero transfers to or from Sophon. ## Official contract addresses | Chain | Address | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | Ethereum | `0x6B7774CB12ed7573a7586E7D0e62a2A563dDd3f0` ([Etherscan](https://etherscan.io/token/0x6B7774CB12ed7573a7586E7D0e62a2A563dDd3f0)) | | Sophon | `0x000000000000000000000000000000000000800A` ([Sophon Explorer](https://explorer.sophon.xyz/address/0x000000000000000000000000000000000000800A)) | | Base | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` ([Basescan](https://basescan.org/token/0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742)) | | BSC | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` ([BscScan](https://bscscan.com/token/0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742)) | | Arbitrum | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` ([Arbiscan](https://arbiscan.io/token/0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742)) | | Polygon | `0xEb971Fd26783f32694dbB392dD7289de23109148` ([PolygonScan](https://polygonscan.com/token/0xEb971Fd26783f32694dbB392dD7289de23109148)) | | Beam | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` ([Beam Explorer](https://subnets.avax.network/beam/address/0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742)) | The previous Sophon NativeOFTAdapter address is a legacy contract and is not a current bridge entry point. Always start from the claim portal rather than calling an adapter directly. ## Exchange and bridge integrations For partners providing SOPH exchange or bridge services, the June 25 move of the SOPH NativeOFTAdapter from Sophon to Ethereum is the announced operational change. Existing non-Sophon routes otherwise remain unchanged. Do not treat the legacy Sophon adapter as an active endpoint. See the [Sophon Chain migration guide](/migration) for other assets, managed positions, and the transition timeline. # Farming Pools (Historical) Source: https://docs.sophon.xyz/discover/active-pools Archived status of former Sophon farming pools There are no active pools documented here. Do not send tokens to a former farm or pool contract. Use [claim.sophon.com](https://claim.sophon.com) to review and withdraw remaining Sophon balances. The Sophon Farm previously supported multiple asset pools and, where available, converted deposits to yield-bearing representations. The programme ended on June 30, 2025, so the former contract list has been removed from current guidance. # Farming Boosts (Historical) Source: https://docs.sophon.xyz/discover/boosts Archived rules for permanently committed farm boosts Boosting is no longer active. Do not make a new deposit or commitment based on this archived guide. The former boost mechanism permanently committed part of a farming position to an ownerless liquidity position. In return, that committed amount received a larger virtual weight for Sophon Points. Because boosted assets were permanently committed and the associated LP tokens were burned, the historical rules did not allow participants to withdraw the boosted portion. This page does not override the terms of an existing onchain position. Use [claim.sophon.com](https://claim.sophon.com) to review liquid Sophon balances and available withdrawal routes. # Withdrawal FAQs Source: https://docs.sophon.xyz/discover/bridging/bridging-faqs Common questions about moving assets off the Sophon Chain No. New canonical deposits were disabled on June 25, 2026. Sophon is also no longer connected to LayerZero. Use [claim.sophon.com](https://claim.sophon.com). It shows Sophon balances and the withdrawal routes currently available for each asset. No. SOPH is native to Ethereum. SOPH on the Sophon Chain is its bridged representation, so you only need to withdraw it. Withdraw from Sophon to Ethereum through the canonical route. From Ethereum, use a supported LayerZero SOPH route to the destination chain. Choose **Withdraw from Sophon** at the claim portal. The portal uses Jumper to present available routes, which may include a direct destination or a path through Ethereum. The Sophon batch containing the transaction must be finalized and proven on Ethereum before the withdrawal can be completed. The exact time can vary. See [Withdrawal Delay](/discover/bridging/withdrawal-delay). No fixed date has been announced. The chain is expected to remain operational until late 2026, and Sophon has said the final date will be communicated in advance. Withdraw before that announced cutoff. Use [Sophon's official Discord or X account](/links/socials). Never follow an unsolicited claim, migration, or token-swap link. # Withdraw from Sophon Source: https://docs.sophon.xyz/discover/bridging/bridging-intro Move SOPH and other assets off the Sophon Chain New deposits into Sophon have been disabled since **June 25, 2026**. The bridge guidance in these docs is withdrawal-only. [claim.sophon.com](https://claim.sophon.com) is the supported starting point for moving assets off the Sophon Chain. It displays your Sophon balances and the routes currently available for each token. ## SOPH SOPH is native to Ethereum and does not require a token swap or migration. 1. Withdraw SOPH from Sophon to Ethereum using the canonical route. 2. From Ethereum, use LayerZero if you want to move SOPH to another supported chain. Sophon itself is no longer on the LayerZero network, so a direct LayerZero transfer to or from Sophon is not available. ## Other assets For ETH, USN, and other tokens: 1. Open [claim.sophon.com](https://claim.sophon.com). 2. Select **Withdraw from Sophon** for the token. 3. Review the routes supplied through Jumper. 4. Choose the destination and route that fit your needs, then confirm in your wallet. Open the unified Sophon transition portal. Review managed positions, key dates, and holder actions. # Canonical Withdrawal Source: https://docs.sophon.xyz/discover/bridging/sophon-bridge Withdraw SOPH and supported assets from Sophon to Ethereum The canonical bridge no longer accepts deposits into Sophon. Use this route only to withdraw from Sophon to Ethereum. ## Withdraw through the portal 1. Go to [claim.sophon.com](https://claim.sophon.com). 2. Connect the wallet that holds your Sophon balance. 3. Select **Withdraw from Sophon** for the asset. 4. Choose the canonical Ethereum route when it is offered. 5. Review the token, amount, destination address, and fees. 6. Confirm the transaction in your wallet. 7. Return to the portal when the withdrawal is ready to be finalized or claimed on Ethereum. Canonical ZK withdrawals are not immediate. Sophon batches must be finalized and proven on Ethereum before a withdrawal can be completed. See [Withdrawal Delay](/discover/bridging/withdrawal-delay) for the technical background. The portal may route non-SOPH assets through Jumper instead when another supported route is more suitable. # Canonical Withdrawal Finalization Source: https://docs.sophon.xyz/discover/bridging/withdrawal-delay Why a Sophon-to-Ethereum canonical withdrawal is not immediate The Sophon Chain is being wound down and deposits are disabled. Start withdrawals at [claim.sophon.com](https://claim.sophon.com) and complete them before the final decommissioning date. A canonical withdrawal from Sophon to Ethereum is not immediately claimable. The Sophon transaction must be included in a batch, and the corresponding chain state must be finalized and proven on Ethereum before the withdrawal can be completed. The wait depends on batch processing, proof generation, and Ethereum finalization. Actual timing can vary, so follow the status shown by the claim portal rather than assuming a fixed completion time. ## Typical flow 1. Initiate the Sophon-to-Ethereum withdrawal through [claim.sophon.com](https://claim.sophon.com). 2. Wait for the Sophon batch and proof to be finalized on Ethereum. 3. Return to the portal when the withdrawal is ready. 4. Submit the final claim transaction on Ethereum. For the complete wind-down process, see the [chain migration guide](/migration). # Farming Timeline (Historical) Source: https://docs.sophon.xyz/discover/farming-cycle The former Ethereum and Sophon farming phases This programme has ended. Do not deposit or bridge assets into Sophon. Withdraw any remaining liquid balance through [claim.sophon.com](https://claim.sophon.com). ## Ethereum phase The original farm accepted deposits on Ethereum and awarded Sophon Points. Before the Sophon mainnet phase, eligible deposited assets were moved to Sophon. ## Sophon phase After the December 2024 mainnet launch, farming and withdrawals moved to the Sophon Chain. New boosts were disabled, and points from the programme informed the published SOPH reward allocations. The Sophon farming programme ended on June 30, 2025. This timeline is not an active deposit or reward guide. # Farming FAQs (Legacy) Source: https://docs.sophon.xyz/discover/farming-faqs Current answers for the concluded Sophon Farm No. The programme ended on June 30, 2025, and no new deposits, locks, boosts, or Sophon Points are available through these docs. Start at [claim.sophon.com](https://claim.sophon.com), select **Withdraw from Sophon**, and review the routes supplied through Jumper. Under the original rules, boosted assets were permanently committed to an ownerless liquidity position and the associated LP tokens were burned. The wind-down does not change those original position terms. No. The points programme has concluded. Historical points informed the published farming reward allocations. Use [Sophon's official Discord or X account](/links/socials). Never trust an unsolicited farm-migration or claim link. # Sophon Farming (Legacy) Source: https://docs.sophon.xyz/discover/farming-intro Archive of the concluded Sophon liquidity-mining programme Sophon farming ended on **June 30, 2025**. Do not deposit or bridge assets into Sophon based on this archive. Use [claim.sophon.com](https://claim.sophon.com) to review current balances and withdrawal routes. The Sophon Farm was a two-phase liquidity-mining programme. It began on Ethereum before the Sophon mainnet launch, then moved deposited assets and reward activity to the Sophon Chain. Participants earned Sophon Points, and the published token allocation assigned 6% of the original SOPH issuance to the pre-mainnet phase and 2% to the post-mainnet phase. These programmes are concluded. The remaining pages in this section preserve the former rules for historical reference only. # Legacy Sophon Chain Services Source: https://docs.sophon.xyz/discover/our-universe Claims, withdrawals, and archived Sophon v1 programmes The Sophon Chain is being wound down. New deposits are disabled; use the unified claim portal to claim rewards and withdraw remaining assets. Claim rewards and review available withdrawal routes. Review key dates and actions for each type of holder. Read the archived Sophon farming documentation. # Sophon Points (Historical) Source: https://docs.sophon.xyz/discover/points-calculations Archived overview of the former farming-points system Sophon farming and points accrual have ended. This page is a historical summary, not a current rewards programme. During the farm, Sophon Points were distributed across supported pools and allocated to participants based on their share of deposited value. Multipliers and boosts could change the effective point weight of a position. The points system informed the pre-mainnet and post-mainnet SOPH farming allocations. It no longer accrues points or accepts new positions. For remaining onchain balances, use [claim.sophon.com](https://claim.sophon.com). # Reward Locking (Historical) Source: https://docs.sophon.xyz/discover/reward-locking Archived Sophon farming lock rules This programme has ended. The lock rules below are historical and do not describe a new earning opportunity. The former farm allowed participants to lock a deposit for a defined period in exchange for a higher Sophon Points multiplier. A longer lock increased the points weight and prevented withdrawal until the selected period ended. The programme no longer accepts locks or accrues points. Use [claim.sophon.com](https://claim.sophon.com) for current claims and withdrawals. # Farm Withdrawals (Legacy) Source: https://docs.sophon.xyz/discover/withdrawals Current path for remaining assets from the former Sophon Farm The former farming interface and instructions are archived. Start the current chain-withdrawal flow at [claim.sophon.com](https://claim.sophon.com). If a liquid asset from the former farm remains in your wallet on the Sophon Chain: 1. Connect the holder wallet at [claim.sophon.com](https://claim.sophon.com). 2. Select **Withdraw from Sophon** for the balance. 3. Review the routes supplied through Jumper and confirm the appropriate path. Permanently committed boost portions were not withdrawable under the original farm rules. For a position-specific problem, contact Sophon through its [official Discord or X account](/links/socials). # Audits Source: https://docs.sophon.xyz/links/audits ## Quantstamp & Sherlock Audit Report Sophon prioritizes **security** and **integrity**. To ensure the highest standards, we are constantly engaging with leading blockchain security firms to conduct comprehensive audits of our contracts. You can view the full audit reports so far: * [Quantstamp Audit Report for Farming on Ethereum](https://github.com/sophon-org/audits/blob/main/Quantstamp%20-%20Sophon%20Farming%20Final%20Report.pdf) * [Sherlock Audit Report for Farming on Ethereum](https://github.com/sophon-org/audits/blob/main/Sherlock%20-%20sophon-farming-contracts-audit-report-1718619027.pdf) * [Omniscia Audit Report for Custom USDC Bridge](https://github.com/sophon-org/audits/blob/main/Omniscia%20-%20Security%20Review%20-%2011_20_2024.pdf) * [Omniscia Audit Report for Guardian NFT, L1 Paymaster, and SOPH Token](https://github.com/sophon-org/audits/blob/main/Omniscia%20-%20Security%20Review%20-%2011_01_2024.pdf) * [Omniscia Audit Report for Farming on layer-2 oracle based allocation reward system ](https://github.com/sophon-org/audits/blob/main/Omniscia%20-%20Security%20Review%20-%20Farming%20-%2001_08_2025.pdf) * [Omniscia Audit Report for Tokens and BridgeHubWrapper](https://github.com/sophon-org/audits/blob/main/Quantstamp%20-%20Sophon%20tokens%20%26%20BridgeHubWrappe.pdf) # Security Source: https://docs.sophon.xyz/links/security ## Staying Safe in the Sophon Ecosystem Phishing and online scams are some of the most common tactics used by fraudsters to steal funds, sensitive information, or access to your accounts. As part of the Sophon ecosystem, it is crucial to stay vigilant and ensure you interact only with verified and trusted applications, contracts, and addresses. ### Common Tactics Used by Scammers * **Fake Websites:** Lookalike domains designed to mimic legitimate platforms. * **Malicious Links:** Fraudulent links shared through emails, DMs, or social media. * **Impersonation:** Fake accounts posing as official representatives of Sophon. * **Fake Contracts:** Contracts claiming to offer benefits but actually designed to drain your wallet. * **Warning:** Always double-check the authenticity of any website, app, or wallet address before interacting. ### Verify to Trust To help you stay secure, Sophon provides an official verification tool to confirm whether an address, application, or contract is authentic and safe to use. Use the Sophon Verification App: Go to verify.sophon.xyz to quickly verify any address or contract. ### Best Practices to Avoid Scams * **Verify Everything:** Use the verification app before sending funds or approving contracts. * **Check Sources:** Only trust information shared through Sophon's official channels. * **Beware of Urgency:** Scammers often create fake urgency to pressure you into acting quickly. * **Bookmark Official Sites:** Avoid clicking on links in messages; always access sites directly. Sophon will never ask for your private keys or seed phrase. **If someone asks for this information, it is a scam**. Protecting yourself from phishing attacks requires awareness and caution. Make it a habit to verify addresses, Sophon team members and information before engaging. **Verify Now:** [https://verify.sophon.xyz/](https://verify.sophon.xyz/) By staying informed and using trusted tools, you help secure not just your assets but the broader Sophon community. # Socials Source: https://docs.sophon.xyz/links/socials Stay up-to-date with the latest news and developments from Sophon through our official social channels: * Website: [https://sophon.com/](https://sophon.com/) * Telegram: [https://t.me/SophonHub](https://t.me/SophonHub) * X (formerly Twitter): [https://x.com/sophon](https://x.com/sophon) * Discord: [https://discord.com/invite/sophon](https://discord.com/invite/sophon) # Status Source: https://docs.sophon.xyz/links/status The [Status Page](https://uptime.com/statuspage/sophon-mainnet) shows the current operational capacity of **Sophon Mainnet**. *** ## Navigation There are 4 tabs you can switch between - each provides helpful info regarding Sophon Mainnet: * **Status Overview:** Lists all active events and an overview of the network’s current status. * **Active Incidents:** Lists any active incidents that may be affecting the network’s capacity. * **Active Maintenance:** Any ongoing maintenance is detailed here. * **Scheduled Maintenance:** View any upcoming maintenance scheduled by Sophon’s team. You will need to click the **Refresh** icon in the top right corner of the screen to update the Status Page. Here you can enable **Auto-Refresh** and set your desired interval, or click on **Refresh Now** to get the latest status updates. ### Status Overview Under the **Status Overview** tab you will see **Components: Current Status**. Clicking the dropdown arrow next to **Mainnet** unfurls the various components. * **Web3 HTTP API:** A graph of the response time and its status are detailed here. * **Prover:** The operational status of Sophon’s ZK Prover is indicated here. * **Web3 Websocket API:** A graph of the response time and its status are detailed here. * **Sequencer:** The operational status of Sophon’s centralized Sequencer is indicated here. The default status of the network and its components is **Operational**. However, if you encounter any issues and cannot resolve them yourself, check the **Status Page** before taking any further steps: [https://uptime.com/statuspage/sophon-mainnet](https://uptime.com/statuspage/sophon-mainnet) # Support Source: https://docs.sophon.xyz/links/support ### Contact Support If you encounter any issues with a live app from Sophon, please contact our support through the link below
Contact support
### Data Deletion Request If you would like your personal data to be deleted, please contact our support through the link below. Make sure to specify which app this is for.
Deletion request
# Sophon Chain Migration Source: https://docs.sophon.xyz/migration How to claim rewards and move assets off the Sophon Chain The Sophon Chain is being wound down. Since **June 25, 2026**, new deposits into Sophon have been disabled. Withdrawals remain available while the chain is operational, but you should move any liquid assets off Sophon before the final decommissioning date. Sophon is moving from operating a general-purpose chain to building applications on Base. The chain is expected to remain operational until late 2026, but there is no fixed shutdown date yet. The final date will be announced in advance. Use [claim.sophon.com](https://claim.sophon.com) for the entire transition: claim staking or Guardian rewards and find a route to withdraw assets from Sophon. ## What you need to do 1. **Claim outstanding rewards.** Check the claim portal for unlocked staking and Guardian rewards. 2. **Withdraw liquid assets.** Bridge SOPH, ETH, USN, and any other tokens you hold on Sophon to another chain. 3. **Do not manually migrate managed positions.** Guardian NFTs, vSOPH, and staked SOPH are being moved to Ethereum for their holders. Claim rewards and review the available withdrawal routes. ## Actions by asset type | You hold | What to do | | ---------------------------------------- | -------------------------------------------------------------------------------------------------------- | | **Guardian NFT** | Claim any outstanding rewards. Sophon's announced NFT transition to Ethereum is automatic. | | **vSOPH** | Claim any unlocked SOPH. The vSOPH transition to Ethereum is automatic. | | **Staked SOPH** | Claim any outstanding staking rewards. The staked position transition to Ethereum is automatic. | | **Liquid SOPH on Sophon** | Bridge it out. SOPH itself does not need a token migration. | | **ETH, USN, or another token on Sophon** | Use the withdrawal action at [claim.sophon.com](https://claim.sophon.com) and select an available route. | ## Key dates ### June 25, 2026 * New deposits through the canonical Ethereum-to-Sophon bridge were disabled. * Sophon was removed from the LayerZero network. LayerZero can no longer be used to bridge SOPH to or from the Sophon Chain. * Canonical withdrawals from Sophon to Ethereum remained available. * Sophon announced an automatic Guardian NFT transition: transfers would be locked on Sophon and the same number of NFTs would be recreated in the same holder wallet on Ethereum. The exact snapshot timing was still subject to confirmation. Sophon's token announcement identified the June 25 Guardian snapshot timing as subject to final confirmation. Follow [official Sophon channels](/links/socials) for any timing update. ### September 29, 2026 at 00:00 GMT This is the final vesting unlock and node reward distribution on the Sophon Chain. After this point, vesting, reward accrual, and claims continue on Ethereum without requiring a user migration transaction. ### Late 2026 The chain is expected to remain operational through roughly the end of 2026 so holders have time to withdraw. This is an estimate, not a hard deadline. Withdraw before the final date announced by Sophon. ## Guardian NFTs and node rewards You do not need to move your Guardian NFT manually. Sophon has announced that it will recreate the same number of Guardian NFTs on Ethereum in the wallet that held them on Sophon. The Guardian reward programme continues on its original schedule: holders receive a pro-rata share of **20% of the original 10 billion SOPH supply over three years**. Rewards remain on Sophon through September 29, 2026 at 00:00 GMT, then continue on Ethereum. The Sophon light-node software has been retired. Running software, maintaining uptime, and delegating a Guardian NFT are no longer requirements for Guardian holders to continue receiving rewards. ## SOPH, vSOPH, and staked SOPH ### Liquid SOPH SOPH is native to Ethereum. The token on Sophon is a bridged representation, so there is no replacement token or token swap: 1. Withdraw SOPH from **Sophon to Ethereum** through the canonical route at [claim.sophon.com](https://claim.sophon.com). 2. If desired, bridge SOPH from **Ethereum to another supported chain** through LayerZero. Since June 25, the SOPH NativeOFTAdapter is based on Ethereum rather than Sophon. Expect the claim portal to show the currently available routes. ### vSOPH and staked SOPH The vSOPH and staked SOPH transitions to Ethereum are automatic. Check the claim portal for unlocked SOPH from vSOPH and for outstanding staking rewards. Those current claims run on Sophon before the settlement transition, while SOPH principal that is unstaked now is claimable on Ethereum. Staking will be discontinued when the Sophon Chain is decommissioned. No new staking action is required for the migration. ## Other assets on Sophon To withdraw ETH, USN, or another token: 1. Go to [claim.sophon.com](https://claim.sophon.com) and connect the wallet that holds the assets. 2. Select **Withdraw from Sophon** for the relevant balance. 3. Review the routes supplied through Jumper and choose the route that fits your destination and asset. 4. Confirm the transaction and wait for the selected bridge route to complete. The portal may offer a direct route to another chain or a route through Ethereum, depending on the asset and available liquidity. ## Official SOPH addresses | Chain | Address | | -------- | -------------------------------------------- | | Ethereum | `0x6B7774CB12ed7573a7586E7D0e62a2A563dDd3f0` | | Sophon | `0x000000000000000000000000000000000000800A` | | Base | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` | | BSC | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` | | Arbitrum | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` | | Polygon | `0xEb971Fd26783f32694dbB392dD7289de23109148` | | Beam | `0x31DbA3c96481FDe3CD81C2aaF51F2D8bf618C742` | ## Frequently asked questions There is no hard shutdown date yet, but new deposits are already disabled. Claim outstanding rewards and withdraw liquid assets before the final decommissioning date announced by Sophon. No. SOPH is already native to Ethereum. If you hold its bridged representation on Sophon, withdraw it canonically to Ethereum. From Ethereum, you can use LayerZero to reach another supported destination. No. These positions are transitioned to Ethereum automatically. You should still check [claim.sophon.com](https://claim.sophon.com) for rewards that are available to claim. No exact date has been announced. The chain is expected to remain available until late 2026, and Sophon has said the final date will be communicated in advance. Use [Sophon's official Discord or X account](/links/socials) and never trust an unsolicited claim or migration link. ## Official announcements * [Sophon Chain Migration Guide](https://sophon.com/content/sophon-migration) * [SOPH token changes](https://sophon.com/content/soph-token) # Guardian Rewards Source: https://docs.sophon.xyz/nodes/calculating-rewards Guardian reward schedule and transition to Ethereum Guardian NFT holders retain a pro-rata share of **20% of the original 10 billion SOPH supply**, distributed over **156 weeks (three years)**. ## What changed The reward allocation and duration continue, but the operating requirements have been simplified during the Sophon Chain wind-down: * light-node software is retired; * uptime is no longer a reward requirement; * Full Node or Light Node delegation is no longer required; * holders do not need to migrate Guardian NFTs manually. The previous Full Node, Light Node, participation-bonus, uptime, and operator- commission calculations are therefore no longer instructions a Guardian holder must follow. ## Claiming rewards Use [claim.sophon.com](https://claim.sophon.com) to view and claim available reward streams. * Rewards vest and are claimed on Sophon through **September 29, 2026 at 00:00 GMT**. * After that transition point, new rewards accrue and claims continue on Ethereum. * Sophon has announced that the NFT will be recreated on Ethereum in the same holder wallet automatically. Withdraw any liquid SOPH claimed on the Sophon Chain before the final chain decommissioning date. No exact shutdown date has been announced yet. See the [chain migration guide](/migration) for withdrawal routes and other managed positions. # Node Sale Contracts (Legacy) Source: https://docs.sophon.xyz/nodes/contracts Archived tier contracts from the 2024 Sophon node sale These are legacy node-sale tier contracts. They are **not** migration, Guardian NFT, or reward-claim contracts. Do not call them to move an NFT or claim SOPH; use [claim.sophon.com](https://claim.sophon.com). The following addresses are retained only as a historical reference for the 2024 Sophon node sale. | Tier | Contract address | | ------- | -------------------------------------------- | | Tier 1 | `0xc9110F53C042a61d1b0f95342e61d62714F8A2E6` | | Tier 2 | `0x11B2669a07A0D17555a7Ab54C0C37f5c8655A739` | | Tier 3 | `0x58078e429a99478304a25B2Ab03ABE79199bE618` | | Tier 4 | `0x2E89CAE8F6532687b015F4BA320F57c77920B451` | | Tier 5 | `0x396Ea0670e3112BC344791Ee7931a5A55E0bDBd1` | | Tier 6 | `0xB08772AA562ED5d06B34fb211c51EC92debF7b26` | | Tier 7 | `0x772eDA6C5aACC61771F9b5f9423D381D311a7018` | | Tier 8 | `0x4842547944832Fe833af677BFDB157dEf391e685` | | Tier 9 | `0x3F0d099120Bf804606835DEFa6dA1A5E784328D6` | | Tier 10 | `0xe0D06d430b0a44e6444f5f0736dC113afe5b636A` | | Tier 11 | `0xE501ADF8425E1Dd5099fA607dCc2B4c91C47B986` | | Tier 12 | `0x2FB5D834D274b9442DA957E98319C35938219a9E` | | Tier 13 | `0xa1109b5550bec4a1118bD232BacCd07dc914CF04` | | Tier 14 | `0x2e64E45faBF1f432d2B59ABd474Da738042B9393` | | Tier 15 | `0x11fBF3713B44AE6D8DBCA1920A40c82AdC685eb4` | | Tier 16 | `0x12f8cDEfd7146a089609Be76dCeb8cCeda45eC84` | | Tier 17 | `0x7497B778f8ACfe135D7710B223F72B82ECca8F20` | | Tier 18 | `0x27437670D359cb40088Cfa39111144ddD13E05c8` | | Tier 19 | `0xfE1AEb6f8ceFaF3cc6b331975B25C30a86b111ea` | | Tier 20 | `0xeF51418BcF608470cB02C3701E22d8885DBbFF5A` | | Tier 21 | `0x2C8e588EC69B15731970470c8C0Eb864D9Ffb414` | | Tier 22 | `0x857558578A8Dd302D56a1111835e7bAa245EA38e` | | Tier 23 | `0x2BDd83B8B189013173C59a15cd9a2fb4Fba9db40` | | Tier 24 | `0x569C7B5f46f33d7EABcf6347Db6e3338f924AF34` | | Tier 25 | `0x37AA2dD6aA1c611958879a072C78Db8C8150eb84` | | Tier 26 | `0x648afe9Dd30515329865ddF5277ae64EaE0576E4` | | Tier 27 | `0xa2751F76b031189007a573cEa8FdA0d9ddbEf894` | | Tier 28 | `0xb09fFbf62450608Ba304befDA6C8FA1eCF77F3f3` | | Tier 29 | `0xC94e199600f09CDcBEEe0AeeB0bBf55E31585149` | | Tier 30 | `0x7ec4D460a3E97fed71081ECAcd5591d1d3A1884C` | | Tier 31 | `0x96Da89f233a53b97976F73D7C519C44fefD08CD5` | | Tier 32 | `0x8CC671cEabb069a2F232CB6ECd4fFC7cd23E9c76` | | Tier 33 | `0xc501E4aa8fA91a8cdc696F513B05883f5347C69d` | | Tier 34 | `0xc1e161E12C537661E047d0BFA187EbfF5988A873` | | Tier 35 | `0x5Edf657342e5fD199Ff64Ff10C232F5D5f931d83` | | Tier 36 | `0x28aA5d6BE4A4861Bf8a49ae46ab8Ce31A89A03De` | | Tier 37 | `0xF5f80976ca38881ECe87b9c83Eb9273bd87AA688` | | Tier 38 | `0xced90a97B34a04dc49b0b4d58336c8c74F1971a3` | | Tier 39 | `0x518eCD09723EF4a71952aCD9281234294dE1488a` | | Tier 40 | `0x75d4E9988ed1a06FBB4b1A4D13217Fb87C82cB08` | # Details Source: https://docs.sophon.xyz/nodes/details This page describes the concluded 2024 Sophon node sale. For current Guardian NFT and reward handling, use [claim.sophon.com](https://claim.sophon.com) and read the [Guardian transition](/nodes/our-infra). Please note that the Sophon Node sale has already concluded. This page will show you all the relevant links and information: **Date of sale: April 30th, 2024** [The tiered pricing system](https://docs.google.com/spreadsheets/d/1ULyfJ9z18Ujq_AMCNun2d55uZkNZUeqDvm9u127c5bE/edit?usp=sharing) There was no cap on the nodes that could be purchased beyond tier 13 [Terms and Conditions](https://farm.sophon.xyz/node-sale-terms) # Full Nodes (Legacy) Source: https://docs.sophon.xyz/nodes/full-nodes Archived role of full nodes in the Sophon Chain This is legacy Sophon v1 infrastructure. The chain is being wound down, and these docs no longer provide a path for launching a new Sophon full node. A Sophon full node stored a complete copy of the chain and could reproduce and verify Sophon state. The original roadmap also anticipated full nodes participating as sequencers or validators as ZKsync sequencing became decentralized. That forward-looking node roadmap is no longer active because the Sophon Chain is being decommissioned. This page is retained only to explain the role full nodes had in the legacy architecture. For current Guardian NFT and reward handling, see the [Guardian transition](/nodes/our-infra). # Guardian Migration FAQs Source: https://docs.sophon.xyz/nodes/guardian-faqs Guardian NFT and reward migration questions Yes. Sophon has announced that Guardian NFT transfers will be locked on Sophon and the same number of NFTs will be recreated on Ethereum in the same holder wallet. No. The NFT transition is automatic and does not require a user transaction. No interruption is planned. The final Sophon reward is scheduled for September 29, 2026 at 00:00 GMT, after which rewards continue on Ethereum. No. The light-node software is retired, and neither software operation nor delegation is required for Guardian holders to continue earning rewards. Check [claim.sophon.com](https://claim.sophon.com). The portal supports reward claims on Sophon and Ethereum during the transition. The SOPH token announcement described the June 25 snapshot timing as subject to final confirmation. Check [official Sophon channels](/links/socials) for any timing update. # Guardian Membership Transition Source: https://docs.sophon.xyz/nodes/guardian-membership What Guardian NFT holders need to know Guardian NFT holders do not need to migrate their membership manually. Sophon has announced that the same number of NFTs will be recreated on Ethereum in the wallet that held them on Sophon. ## Holder checklist 1. Open [claim.sophon.com](https://claim.sophon.com). 2. Claim any Guardian rewards currently available on Sophon. 3. Do not bridge or transfer the Guardian NFT as part of the migration. 4. After September 29, 2026 at 00:00 GMT, use the same portal for reward activity on Ethereum. The light-node software and membership-delegation requirements from the original programme have been retired. Holders continue to receive rewards on the original three-year schedule without running software or maintaining a delegation. See [Guardian Rewards](/nodes/calculating-rewards) for the transition timeline. # Light Nodes (Retired) Source: https://docs.sophon.xyz/nodes/light-nodes Status of the former Sophon light-node programme Sophon light-node operating software has been retired. Do not deploy, upgrade, or pay a provider to run a Sophon light node for Guardian reward eligibility. Sophon light nodes previously used Avail light-client technology for data availability sampling on the Sophon Chain. Guardian reward eligibility was tied to node operation and delegation during that phase of the programme. As part of the chain wind-down, software operation, uptime, and delegation are no longer required. Guardian holders continue to receive rewards according to the original schedule. Use [claim.sophon.com](https://claim.sophon.com) to claim available rewards, and see the [Guardian transition](/nodes/our-infra) for the Ethereum timeline. # Guardian and Node FAQs Source: https://docs.sophon.xyz/nodes/nodes-faqs Current answers for the Guardian programme transition No. The Sophon light-node software has been retired. Software operation and uptime are no longer requirements for Guardian rewards. No. Delegation is no longer required to continue receiving the original Guardian reward allocation. No. Sophon has announced that the same number of Guardian NFTs will be recreated on Ethereum in the wallet that held them on Sophon. The programme continues to distribute a pro-rata share of 20% of the original SOPH supply over three years. Rewards remain on Sophon through September 29, 2026 at 00:00 GMT, then continue on Ethereum. Use [claim.sophon.com](https://claim.sophon.com) for both Sophon and Ethereum reward activity during the transition. Withdraw it through the claim portal. SOPH is native to Ethereum, so it does not need to be swapped for a replacement token. The chain is being decommissioned, and the light-node programme is retired. The full-node and light-node pages are retained only as legacy references. No fixed date has been announced. Sophon expects the chain to remain operational until late 2026 and will announce the final date in advance. Use [Sophon's official Discord or X account](/links/socials). Never trust an unsolicited Guardian migration or reward-claim link. # Operator Addresses (Retired) Source: https://docs.sophon.xyz/nodes/operator-address Archived status of Sophon light-node operator addresses Operator addresses and delegation are no longer required for Guardian rewards. Sophon light-node software has been retired. Operator addresses previously identified light-node operators, received Guardian delegations, and tracked operator commissions. Do not create a new operator address or change delegation for the purpose of preserving rewards during the chain migration. Guardian rewards continue on the original schedule without software or delegation requirements. Claim available rewards at [claim.sophon.com](https://claim.sophon.com). # Guardian Transition Source: https://docs.sophon.xyz/nodes/our-infra Guardian NFTs and node rewards during the Sophon Chain wind-down The Sophon Chain is being wound down. Light-node software has been retired, and Guardian holders no longer need to run software, maintain uptime, or delegate their NFTs to continue receiving rewards. The Guardian reward programme continues on its original schedule. Guardian NFT holders receive a pro-rata share of **20% of the original 10 billion SOPH supply over three years**. ## What holders need to do * Check [claim.sophon.com](https://claim.sophon.com) for outstanding node rewards. * Do not manually move or bridge the Guardian NFT. * Withdraw any liquid SOPH or other assets that remain on the Sophon Chain. Under the announced migration process, Guardian NFT transfers are locked on Sophon and the same number of NFTs will be recreated on Ethereum in the same holder wallet. Rewards remain on Sophon through **September 29, 2026 at 00:00 GMT**, then continue on Ethereum. Review the reward schedule and Ethereum transition. See the complete holder actions and chain timeline. Read the status of the retired operating software. View the archived role of full nodes in Sophon v1. # Guardian NFTs Source: https://docs.sophon.xyz/nodes/what-are-guardians Guardian membership and its transition to Ethereum Guardian memberships are ERC-721 NFTs created through the 2024 Sophon node programme. Each NFT represents one membership, and a wallet can hold multiple memberships. ## Current role Sophon light-node software is retired, and running that software or delegating a membership is no longer a condition for Guardian rewards. The reward entitlement continues. Guardian holders receive a pro-rata share of 20% of the original SOPH supply over the programme's three-year schedule. ## Ethereum transition Under the announced migration process, Guardian NFT transfers are locked on the Sophon Chain and the same number of NFTs will be recreated on Ethereum for their holders. No manual migration or claim transaction is required for the NFT itself. Use [claim.sophon.com](https://claim.sophon.com) to view and claim available rewards. Reward activity moves from Sophon to Ethereum after **September 29, 2026 at 00:00 GMT**. The SOPH token announcement described the June 25 Guardian snapshot timing as subject to final confirmation. Follow [official Sophon channels](/links/socials) for any timing update. # Architecture Source: https://docs.sophon.xyz/sophon-account/architecture Learn how the Sophon Account works The Sophon Account utilizes native **Account Abstraction**, creating smart contract accounts for users, offering enhanced security and flexibility compared to traditional **Externally Owned Accounts** (EOAs). Sophon Account Architecture Key Features: * **Modularity**: The Sophon account is designed on top of [EIP-7579](https://eips.ethereum.org/EIPS/eip-7579), which bring the concept of modular accounts, where you can install and remove modules providing extra functionality to it. * **EOA + Web 2 Signers**: Users can sign using regular EOAs. This makes easy for existing EOA users to be onboarded, but also enable to use use services that provide Web 2 logins (Google, Apple, Email, etc), running backend services with secured private keys as signers. * **Passkey Signers**: Incredible UX for users with enhanced security of passkeys. * **Session Keys**: Enable temporary permissions for specific actions or dApps. * **Guardians**: Users can define guardians, who have permissions to reset the signers of an account, in the case of losing access to a passkey for example. The users themselves could set a (cold) hardware wallet they own as a Guardian. # JWT & Access Tokens Source: https://docs.sophon.xyz/sophon-account/authentication/access-tokens Tokens are accessible only when using the React and React Native SDKs with a valid `partnerId`. Partners integrating via EIP-6963 will not have access to user tokens. When using Sophon Account, everytime a user authorizes an application connection our Account Server issues an access token using RS256 algorithm, with a secret private key. You can use this token to authenticate requests to our API, and if you don't want to implement a custom SIWE flow, you can use the token on your own to make sure that the user is authenticated and owns the account. ```typescript React theme={null} import { useSophonToken } from '@sophon-labs/account-react-native'; ``` ```typescript React Native theme={null} import { useSophonToken } from "@sophon-labs/account-react"; ``` ```typescript General Implementation theme={null} export default function App() { const [token, setToken] = useState(null); const [loading, setLoading] = useState(false); const { getAccessToken } = useSophonToken(); const updateAccessToken = useCallback(async () => { setLoading(true); const newToken = await getAccessToken(); setToken(newToken); setLoading(false); }, [getAccessToken]); useEffect(() => { updateAccessToken(); }, [updateAccessToken]); return (

My Token: {token?.value}

); } ``` ## JWT Token Payload We follow standard JWT [RFC-7519](https://www.rfc-editor.org/rfc/rfc7519#section-4.1), and add some more fields to give more context to the token. Audience for the JWT token. This claim shows what domain of the intended audience of the JWT. In this context, the audience is your **partnerId**. When processing and validating the token by yourself, the value of this field should match with your **partnerId** that we provided you. Issuer of the JWT token. This claim always shows **auth.sophon.xyz** generated and issued the JWT. Subject of the JWT token, representing the user's smart wallet address. Timestamp when the JWT token was issued. Timestamp when the JWT token will expire. This is generally some hours after the token was issued. The scope of data granted by the user that allows us to share specific data with the application that the user is connecting to. Possible scopes are: `email`, `twitter`, `gmail`, `discord` and `telegram`. Multiple scopes could be provided and they are separated by a space. ## Sending the Token Once you got the token issued, you can send it during the calls to your API using the classic header `Authorization: Bearer `. See how to do it with different frameworks: ```typescript axios theme={null} import axios from 'axios'; export const callBackend = (token: string) => { const response = await axios.get(`${process.env.BACKEND_URL}/do-something`, { headers: { Authorization: `Bearer ${token}`, }, }); if (response.status !== 200) { throw new Error('Failed to call backend.'); } return response.data; }; ``` ```typescript fetch theme={null} export const callBackend = (token: string) => { const response = await fetch(`${process.env.BACKEND_URL}/do-something`, { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}` }, body: JSON.stringify(data) }); if (!response.ok) { throw new Error('Failed to call backend.'); } return response.json(); } ``` ## Decoding the JWT When you have the token, it is useful to decode it for additional verification during your backend processing. Given that only Sophon can issue tokens, you can validate that the token you are receiving is valid, and it assert that the user owns the account. By using the JWKS standard, and having the public key we provide, you can decode by yourself, without having to making additional calls. ### Decode Using Sophon Account SDK To make things easier, we provide a SDK that can decode the token for you: ```bash npm theme={null} npm install @sophon-labs/account-api-sdk ``` ```bash yarn theme={null} yarn add @sophon-labs/account-api-sdk ``` ```bash pnpm theme={null} pnpm add @sophon-labs/account-api-sdk ``` Then, you can use it in your code: ```typescript theme={null} import { SophonAPISDK } from "@sophon-labs/account-api-sdk"; const partnerId = "my-partner-id"; const sdk = SophonAPISDK("testnet", partnerId); const decodedToken = sdk.auth.decodeJWT(token); console.log(decodedToken); // { iss: 'xxxx', exp: nnnn, ... } ``` ### Decoding the token using JWKS libraries One of the options is to use a JWKS library to decode the token. For example, using `jsonwebtoken` and `jwks-rsa` libraries: ```typescript theme={null} import jwt, { JwtPayload } from "jsonwebtoken"; import { JwksClient } from "jwks-rsa"; const jwksUrl = `https://api.my.staging.sophon.xyz/.well-known/jwks.json`; // https://api.my.sophon.xyz/.well-known/jwks.json for production // The client should be initialized as const client = new JwksClient({ jwksUri: jwksUrl, rateLimit: true, cache: true, cacheMaxEntries: 5, // Maximum number of cached keys cacheMaxAge: 600000, // Cache duration in milliseconds (10 minutes in this case))} }); const signingKey = await client.getSigningKey(); const publicKey = signingKey.getPublicKey(); const decodedToken: JwtPayload = jwt.verify(encodedJwt, publicKey, { ignoreExpiration: false, }) as JwtPayload; console.log(decodedToken); // { iss: 'xxxx', exp: nnnn, ... } ``` # Data Scopes Source: https://docs.sophon.xyz/sophon-account/authentication/data-scopes Tokens are accessible only when using the React and React Native SDKs with a valid `partnerId`. Partners integrating via EIP-6963 will not have access to user tokens. As an authentication provider, Sophon Account is able to provide a list of data scopes that the user can grant to the application. You are required to specify the data scopes that you want to request from the user when you are initializing the SDK Context Provider. The available scopes right now are: * `email` * `x` * `gmail` * `discord` * `telegram` The user has the option to grant or not to grant the scopes to the application during the authentication process. To use it in code, you can do the following: ```typescript Requesting Data Scopes theme={null} import { DataScopes } from "@sophon-labs/account-core"; import { SophonContextProvider } from "@sophon-labs/account-react-native"; export default function App() { return ( {/* Your components*/} ); } ``` Then you will have the scopes available in the user JWT token, and fetch the info in the backend. For more information, please check the [JWT & Access Tokens](./access-tokens) documentation. # EIP-6963 Source: https://docs.sophon.xyz/sophon-account/authentication/eip6963 [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) is a standard way to add support for **Sophon Account** using the main wallet providers in the market. The implementation is very simple, you just need to import the package and it will automatically broadcast the provider to the wallet provider that you are using. Most modern wallet connection libraries, like RainbowKit, wagmi, or Reown Appkit, support [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963). ```bash npm theme={null} npm install @sophon-labs/account-eip6963 ``` ```bash yarn theme={null} yarn add @sophon-labs/account-eip6963 ``` ```bash pnpm theme={null} pnpm add @sophon-labs/account-eip6963 ``` Then you need to import and initialize the [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) emitter in your application entry point, the simplest way is: ```typescript testnet theme={null} import "@sophon-labs/account-eip6963/testnet"; ``` ```typescript mainnet theme={null} import "@sophon-labs/account-eip6963/mainnet"; ``` If you need dynamic network support, you can use the root package, for example: ```typescript theme={null} import { getDefaultConfig } from "@rainbow-me/rainbowkit"; import { sophonTestnet, sophon } from "wagmi/chains"; import { createSophonEIP6963Emitter } from "@sophon-labs/account-eip6963"; createSophonEIP6963Emitter("testnet"); export const config = getDefaultConfig({ appName: "Your Application", projectId: "YOUR_PROJECT_ID", chains: [sophon, sophonTestnet], ssr: true, }); ``` This will automatically: * Register the **Sophon Account** provider * Announce it through the [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) events * Make it available to [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) compatible applications You can find examples of implementing EIP-6963 with other common libraries: * [RainbowKit](../examples/rainbowkit) * [Reown AppKit](../examples/appkit) * [ConnectKit](../examples/connectkit) * [Thirdweb Wallet](../examples/thirdweb) You can check an example of implementing EIP-6963 with RainbowKit. # Overview Source: https://docs.sophon.xyz/sophon-account/authentication/intro There are some different ways to integrate Sophon Account into your application: * Using the **React** and **React Native** SDKs * Using the **EIP-6963** standard on *any* web plaform Fast integration by just importing a package into your existing project. Integrate any web app with Sophon Account. Integrate any mobile app with Sophon Account. Some of the options available require a valid `partnerId` to be provided to the SDK. Email us at [product@sophon.xyz](mailto:product@sophon.xyz) to request yours. # React Source: https://docs.sophon.xyz/sophon-account/authentication/react You can add support for Sophon Account in your React application by using the `@sophon-labs/account-react` package. ## Installation ```sh npm theme={null} # Sophon Library npm install @sophon-labs/account-react ``` ```sh yarn theme={null} # Sophon Library yarn add @sophon-labs/account-react ``` ```sh pnpm theme={null} # Sophon Library pnpm add @sophon-labs/account-react ``` ## Usage Before anything, you need to wrap your application with `SophonContextProvider`, that will store context information about the account and walletClient connection. ```ts theme={null} 'use client'; import { DataScopes } from '@sophon-labs/account-core'; import { SophonContextProvider, SophonWagmiConnector, } from '@sophon-labs/account-react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { type ReactNode, useState } from 'react'; import { type State, WagmiProvider } from 'wagmi'; import { getWagmiConfig } from '../lib/wagmi'; export default function Web3ModalProvider({ children, initialState, }: { children: ReactNode; initialState?: State; }) { const [config] = useState(() => getWagmiConfig()); const [queryClient] = useState(() => new QueryClient()); return ( {children} ); } ``` With that ready, you can now use our hooks to interact with Sophon. ```ts theme={null} import { useSophonAccount } from "@sophon-labs/account-react"; export default function YourComponent() { const { connect, account, disconnect } = useSophonAccount(); // ... } ``` And you can use any wagmi hook to interact with the wallet as well. You can check an example of implementing React Native with Sophon Account. # React Native Source: https://docs.sophon.xyz/sophon-account/authentication/react-native Because of how **React Native** libraries work, you will need to install dependencies that have native code directly in your app so that we can use them. You can add support for Sophon Account in your React Native application by using the `@sophon-labs/account-react-native` package. ## Installation The SDK is compatible with Expo Go without the need of prebuilding the app. Before you start, you need these libraries: ```sh npm theme={null} # Expo packages npx expo install react-native-webview expo-standard-web-crypto expo-crypto expo-network expo-secure-store ``` ```sh yarn theme={null} # Expo packages npx expo install react-native-webview expo-standard-web-crypto expo-crypto expo-network expo-secure-store ``` ```sh pnpm theme={null} # Expo packages npx expo install react-native-webview expo-standard-web-crypto expo-crypto expo-network expo-secure-store ``` After that, you are ready to install our SDK: ```sh npm theme={null} # Sophon Library npm install @sophon-labs/account-react-native ``` ```sh yarn theme={null} # Sophon Library yarn add @sophon-labs/account-react-native ``` ```sh pnpm theme={null} # Sophon Library pnpm add @sophon-labs/account-react-native ``` ## Usage Before anything, you need to wrap your application with `SophonContextProvider`, that will store context information about the account and walletClient connection. ```ts theme={null} import { DataScopes } from "@sophon-labs/account-core"; import { SophonContextProvider } from "@sophon-labs/account-react-native"; export default function RootLayout() { // ... return ( {/* Your components*/} ); } ``` With that ready, you can now use our hooks to interact with Sophon. ```ts theme={null} import { useSophonAccount } from "@sophon-labs/account-react-native"; export default function YourComponent() { const { connect, account, disconnect } = useSophonAccount(); // ... } ``` You can check an example of implementing React Native with Sophon Account. # Overview Source: https://docs.sophon.xyz/sophon-account/connectors/intro Sophon Account can be used with most popular wallet connectors in the market. # Integrating with Viem Source: https://docs.sophon.xyz/sophon-account/connectors/viem Viem is actually a dependency for Sophon Account. We expose an [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) provider that can be used directly with [Viem](https://viem.sh/). ```ts theme={null} import { createSophonEIP1193Provider } from "@sophon-labs/account-connector"; import { useCallback, useMemo, useState } from "react"; import { type Address, createWalletClient, custom } from "viem"; import { sophonTestnet } from "viem/chains"; import { eip712WalletActions } from "viem/zksync"; export default function Home() { const [address, setAddress] = useState
(); const [error, setError] = useState(); const [signature, setSignature] = useState(); const provider = useMemo(() => { return createSophonEIP1193Provider( 'testnet', '123b216c-678e-4611-af9a-2d5b7b061258', ); }, []); const walletClient = useMemo(() => { return createWalletClient({ chain: sophonTestnet, transport: custom(provider), }).extend(eip712WalletActions()); }, [provider]); const handleConnect = useCallback(async () => { const addresses = await walletClient.requestAddresses(); if (!addresses.length) { setError("No addresses found"); return; } setAddress(addresses[0]); const signature = await walletClient.signMessage({ account: addresses[0], message: 'Hello from Sophon', }); setSignature(signature); }, [walletClient]); const handleDisconnect = useCallback(async () => { setAddress(undefined); setError(undefined); setSignature(undefined); await provider.disconnect(); }, [provider]); return ( // ... your logic here ); } ``` You can check an example of using Viem directly with Sophon Account. # Integrating with Wagmi Source: https://docs.sophon.xyz/sophon-account/connectors/wagmi To integrate Sophon Account with Wagmi, you need to install the `@sophon-labs/account-connector` package. ```bash theme={null} npm install @sophon-labs/account-connector ``` Then, you need to create a new connector: ```ts theme={null} import { sophon, sophonTestnet } from "viem/chains"; import { createConfig, http, WagmiProvider } from "wagmi"; // Wagmi config const wagmiConfig = createConfig({ chains: [sophonTestnet], connectors: [sophonSsoConnector("testnet")], // or 'mainnet' transports: { [sophon.id]: http(), [sophonTestnet.id]: http(), }, }); ``` And that's it, you can now use wagmi hooks and componentes to interact with Sophon Account. ## Signin Messages Simple message signature is supported: ```ts theme={null} import { useSignMessage } from "wagmi"; // ... const { signMessage } = useSignMessage(); // ... signMessage({ message: "Hello from Sophon SSO!", }); ``` ## Signin Types Messages Typed data signature is supported: ```ts theme={null} import { useSignTypedData } from "wagmi"; // ... const { signMessage } = useSignTypedData(); // ... signTypedData({ domain: { name: "Sophon SSO", version: "1", chainId: sophonTestnet.id, }, types: { Message: [ { name: "content", type: "string" }, { name: "from", type: "address" }, { name: "timestamp", type: "uint256" }, ], }, primaryType: "Message", message: { content: `Hello from Sophon SSO!\n\nThis message confirms you control this wallet.`, from: address as `0x${string}`, timestamp: BigInt(Math.floor(Date.now() / 1000)), }, }); ``` You can check an example of using a custom Wagmi connector with Sophon Account. # Reown AppKit Source: https://docs.sophon.xyz/sophon-account/examples/appkit Integrate the Sophon Account with Reown AppKit ## Reown AppKit Reown AppKit is a versatile wallet connector for React, enabling seamless wallet connection and transaction signing. Reown AppKit Example ### Installation ```npm yarn pnpm bun theme={null} npm install @sophon-labs/account-eip6963 wagmi viem @reown/appkit @tanstack/react-query ``` ### Live demo