Godwoken Documentation
website·Indexed 32 days ago
https://docs.godwoken.ioDocumentation for Godwoken, an EVM-compatible layer 2 chain built on Nervos CKB. It features 100% EVM compatibility, gasless transactions via ERC-4337, and tools like Godwoken-Kicker for network deployment and GW-tools for asset deposits and withdrawals. The platform supports pCKB and pETH, providing a bridge between layer 1 (CKB) and layer 2.
What's inside Godwoken
- Godwoken is an EVM-compatible optimistic rollup layer 2 chain built on the Nervos Network (a Proof-of-Work layer 1). It allows Ethereum developers to use existing Ethereum development tools to deploy smart contracts and interact with the chain. Key features include low transaction costs (typically < $0.0001) and interoperability with Nervos, Ethereum, and BSC via the Force Bridge.
Overview of the Godwoken L2 Rollup Framework
Godwoken is a flexible and extensible layer 2 rollup framework designed for the Nervos CKB layer 1 blockchain. It currently utilizes Proof of Authority (PoA) consensus, with Proof of Stake (PoS) planned for future release. It is designed to be paired with a separate framework that defines the L2 programming model, enabling support for various blockchain models (e.g., EOS, Stellar, Libra). When combined with Polyjuice, it allows Solidity dApps to run on Nervos L2.Overview of Godwoken and Polyjuice
Godwoken is a layer 2 rollup framework built atop Nervos CKB that provides an abstract account model and abstract layer 2 transactions. Polyjuice is an Ethereum-compatible layer designed using the Godwoken account model, allowing developers to deploy and run Ethereum contracts seamlessly on CKB.Overview of Godwoken Architecture
Godwoken is a multi-chain solution designed to enable interoperability and EVM compatibility on the Nervos Network. It consists of two primary components: the Godwoken optimistic rollup framework and the Polyjuice EVM-compatible framework. Polyjuice acts as the backend, providing an Ethereum-compatible layer atop Nervos CKB by leveraging the account model and integratingevmoneas the EVM engine to execute Ethereum smart contracts.Overview of Godwoken Layer 2
Godwoken is an EVM-compatible, layer 2 optimistic rollup solution built on Nervos layer 1. It utilizes the Polyjuice EVM framework to provide a scalable environment for dApp builders. It is designed to allow Ethereum developers to migrate existing dApps to Nervos with minimal effort, offering benefits such as instant transaction finality and low gas fees while maintaining compatibility with Ethereum's infrastructure and tools.Overview of Godwoken Gasless Transactions
Godwoken provides a gasless feature based on a simplified version of ERC-4337 that allows developers to sponsor transaction fees for users. This is achieved by routing transactions through an
Entrypointcontract, which then interacts with aPaymastercontract deployed by the developer to verify and pay the gas fees.Key Constraints:
- Only supports paying gas fees with native tokens (CKB or ETH).
- Does not work for native token transfers (users must still pay gas).
- Does not support paying gas fees using ERC20 tokens directly via the paymaster mechanism.
- Requires
maxFeePerGasandmaxPriorityFeePerGasto be set to the same value in theUserOperationto avoid errors, as London hard fork (EIP-3198) is not currently supported.
Overview of EVM on Nervos
Nervos supports Ethereum-compatible smart contracts via the Godwoken and Polyjuice frameworks, which run the Ethereum Virtual Machine (EVM) in a Layer 2 execution environment. This allows developers to use Solidity and enables users to interact with dApps using the MetaMask wallet.Overview of Nervos Layer 2 EVM Compatibility
Nervos is a multi-layer blockchain platform that supports Ethereum Virtual Machine (EVM) compatibility via a Layer 2 solution. This allows developers to use the Solidity smart contract programming language and existing Ethereum-based tooling to build and deploy applications on Nervos.Get started with Covalent API for Godwoken
Covalent provides a unified RESTful API to access asset transparency and visibility across blockchain networks, including Godwoken. To begin using the API, you must first sign up for an API Key via the Covalent platform.Understand the Godwoken withdrawal process and challenge period
Withdrawing funds from Godwoken is a two-step process: first, the withdrawal is initiated, and second, the funds are released. Due to the optimistic rollup architecture, there is a mandatory 5-day 'challenge period' after the withdrawal process commences. This period allows the Layer 2 network operator to examine transactions for malicious activity before funds can be unlocked.Understand the Godwoken Optimistic Rollup challenge mechanism
Godwoken uses an Optimistic Rollup architecture where aggregators collect Layer 2 transactions, pack them into blocks, and submit them to CKB. Blocks are initially 'unfinalized' and subject to a challenge period.
- Aggregators: Must stake CKB to submit blocks. They bear L1 transaction fees and liquidity costs but can charge L2 users fees in CKB or sUDT.
- Challengers: Can mark a transaction in an unfinalized block as invalid by staking CKB.
- Resolution:
- The aggregator must prove the transaction is valid by submitting a 'cancel challenge request' that executes the transaction on-chain. If successful, the aggregator claims the challenger's stake.
- If the aggregator fails, the challenger claims the aggregator's stake, and the chain reverts to the state prior to the invalid block.
- Finalization: After a specific period, blocks become 'finalized', are frozen, and can no longer be challenged.
Analyze blockchain data using the Layer1 Explorer
The Nervos Explorer provides a searchable web interface to analyze blockchain data without requiring a local node. Common use cases include:
- Tracking transactions to view all internal actions.
- Searching addresses to view transaction history and asset balances.
- Inspecting individual cells to view contained data and associated smart contracts.
Mainnet: https://explorer.nervos.org Testnet: https://explorer.nervos.org/aggron