diff --git a/docs/about/specs/gbc/README.md b/docs/about/specs/gbc/README.md index 7712d256..cc2376bc 100644 --- a/docs/about/specs/gbc/README.md +++ b/docs/about/specs/gbc/README.md @@ -16,7 +16,7 @@ To stake on GBC, follow the Validator instructions starting with [Validator Requ | GBC Deposit Contract | [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) | | GNO-> mGNO contract | [0x647507A70Ff598F386CB96ae5046486389368C66](https://gnosis.blockscout.com/address/0x647507A70Ff598F386CB96ae5046486389368C66) | | GNO token on Gnosis | [0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://blockscout.com/xdai/mainnet/token/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb/token-transfers) | -| mGNO token on Gnosis | [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosis.blockscout.com/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68) | + ### **Initial Parameters (subject to change)** diff --git a/docs/about/specs/gbc/upgradeability.md b/docs/about/specs/gbc/upgradeability.md index 6dca0dbb..97b79163 100644 --- a/docs/about/specs/gbc/upgradeability.md +++ b/docs/about/specs/gbc/upgradeability.md @@ -18,5 +18,4 @@ A proposed upgrade is presented to this board and a minimum of 7 signatures are ### Contracts managed by the Governance Board - Deposit Contract: [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9/read-contract) -- mGno Token Contract: [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosis.blockscout.com/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68/read-contract) -- GNO-mGNO Wrapper Contract: [0x647507A70Ff598F386CB96ae5046486389368C66](https://gnosis.blockscout.com/address/0x647507A70Ff598F386CB96ae5046486389368C66/read-contract) + diff --git a/docs/about/third-parties.md b/docs/about/third-parties.md index 0739de66..c2e17898 100644 --- a/docs/about/third-parties.md +++ b/docs/about/third-parties.md @@ -4,23 +4,32 @@ sidebar_position: 4 keywords: [gnosis bridges, on ramp solutions, third party, omni bridge] title: Third Party bridges and On-Ramp Solutions --- +:::info +If you want to use Gnosis Bridge, please visit : https://bridge.gnosischain.com/ +::: ### Bridge aggregators -- Jumper (by Li Fi) -- Bungee (by Socket) -- ShapeShift +- [Jumper (by Li Fi)](https://jumper.exchange/?fromChain=1&toChain=100) +- [Bungee (by Socket)](https://www.bungee.exchange/) +- [ShapeShift](https://app.shapeshift.com/trade#/trade) ### Third-party bridges -- Connext Bridge -- Hop -- Celer Bridge +- [Connext Bridge](https://bridge.connext.network/ETH-from-ethereum-to-gnosis?symbol=ETH) +- [Hop](https://app.hop.exchange/#/send?sourceNetwork=ethereum&destNetwork=gnosis) +- [Celer Bridge](https://cbridge.celer.network/1/100/SOS) + ### On-ramps -- Monerium -- Mt Pelerin -- Ramp -- AscendEX +- [Monerium](https://monerium.com/) +- [Mt Pelerin](https://www.mtpelerin.com/) +- [Ramp](https://ramp.network/) +- [AscendEX](https://ascendex.com/en) + + -### Legacy bridges -- xDai Bridge -- Omni Bridge +:::note +If you want to check out Legacy UI for our xDAI and Omni Bridge check out below. +### Legacy UI +- [xDAI Bridge UI](https://bridge.legacy.gnosischain.com/) +- [Omni Bridge UI](https://omni.legacy.gnosischain.com/bridge) +::: \ No newline at end of file diff --git a/docs/about/tokens/gno.md b/docs/about/tokens/gno.md index a3b14a19..372f3b82 100644 --- a/docs/about/tokens/gno.md +++ b/docs/about/tokens/gno.md @@ -1,7 +1,7 @@ --- title: GNO Token description: GNO is the staking token of Gnosis and the governance token for the GnosisDAO. -keywords: [gnosis tokens, gnosis gno token, fee token, gno validation, omni bridge, mgno, ethereum gno] +keywords: [gnosis tokens, gnosis gno token, fee token, gno validation, omni bridge, ethereum gno] --- GNO is the key token of the Gnosis ecosystem. It's used for staking on the Gnosis Beacon Chain and acts as the governance token for the GnosisDAO. @@ -90,7 +90,8 @@ Check out [Chiado Testnet specs](/concepts/networks/chiado#gno-token) for more i By staking your GNO tokens, you play a vital role in securing the Gnosis chain through the validation of blocks within the PoS consensus. As a reward for your participation, you will receive staking [rewards](../../node/rewards-penalties). For a more comprehensive understanding of the validator deposit process, check the [validator deposit process](/node/manual/validator/deposit) page. -In order to establish a highly precise ETH-mirrored environment, it is required to stake a minimum of 32 tokens on the Gnosis Beacon Chain. To facilitate this, the mGNO token serves as a meta-token specifically designed for staking purposes. During the deposit process, an automatic conversion takes place where 1 GNO is transformed into 32 mGNO tokens behind the scenes. +In order to establish a highly precise ETH-mirrored environment, it is required to stake a minimum of 32 tokens on the Gnosis Beacon Chain. To facilitate this, the mGNO token serves as a meta-token spe +cifically designed for staking purposes. During the deposit process, an automatic conversion takes place where 1 GNO is transformed into 32 mGNO tokens behind the scenes. The mGNO contract address on the Gnosis network is as follows: [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosisscan.io/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68). diff --git a/docs/bridges/Bridges Architecture.md b/docs/bridges/About Token Bridges/README.md similarity index 72% rename from docs/bridges/Bridges Architecture.md rename to docs/bridges/About Token Bridges/README.md index 9ebd9cd1..0b2302b4 100644 --- a/docs/bridges/Bridges Architecture.md +++ b/docs/bridges/About Token Bridges/README.md @@ -1,17 +1,18 @@ --- -description: Architecture of Gnosis' Bridges sidebar_position: 4 +title: Learn about Token bridges +keywords: [bridge architecture] --- -## Conceptual Architecture +## Bridges Conceptual Architecture Gnosis has three main types of bridges: -- **Native Bridges**: built into the chain itself, and mint the xDAI and ERC20 token from Ethereum to Gnosis Chain +- **Native Bridge**: built into the chain itself, and mint the xDAI and ERC20 token from Ethereum to Gnosis Chain - **3rd-party Bridges**: these are maintained by 3rd parties and allow users to swap for canonical tokens created by native bridges - **Application-Specific Bridges**: some applications may provide custom bridges that maintain their own canonical token on Gnosis -![Diagrams overview of Bridges](../../static/img/bridges/diagrams/bridge-overview.svg) +![Diagrams overview of Bridges](../../../static/img/bridges/diagrams/bridge-overview.svg) ## Gnosis Chain Bridge @@ -22,7 +23,7 @@ Gnosis Chain bridge : ### Bridging Data -See the [Arbitrary Message Passing Bridge](/bridges/tokenbridge/amb-bridge) or AMB Bridge for short. +See the [Arbitrary Message Passing Bridge](/docs/bridges/About%20Token%20Bridges/amb-bridge.md) or AMB Bridge for short. ## Roadmap diff --git a/docs/bridges/Token Bridge/amb-bridge.md b/docs/bridges/About Token Bridges/amb-bridge.md similarity index 69% rename from docs/bridges/Token Bridge/amb-bridge.md rename to docs/bridges/About Token Bridges/amb-bridge.md index b1c1ebd1..35f8bc5f 100644 --- a/docs/bridges/Token Bridge/amb-bridge.md +++ b/docs/bridges/About Token Bridges/amb-bridge.md @@ -7,13 +7,11 @@ keywords: ![](/img/bridges/diagrams/amb-bridge.svg) -You can also send arbitrary data between Gnosis and Ethereum using the native Arbitrary Message Bridge (AMB). This allows Gnosis contracts to send data and trigger contract functions on Ethereum and other chains, and vice versa. +The native Arbitrary Message Bridge (AMB) allows user to send arbitrary data between Gnosis Chain and Ethereum. This allows Gnosis contracts to send data and trigger contract functions on Ethereum and other chains, and vice versa. -The AMB is a key bridge primitive that is used inside higher-order bridges like the [Omnibridge native token bridge](/bridges/tokenbridge/omnibridge). +The AMB is a key bridge primitive that is used inside higher-order bridges like the [Omnibridge native token bridge](/bridges/tokenbridge/omnibridge), and is part of the [Tokenbridge Architecture](https://tokenbridge.net/). -The AMB currently supports Ethereum, and is part of the [Tokenbridge Architecture](https://tokenbridge.net/). There may be additional EVM-based networks supported in the future. - -With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), AMB bridge is now more secure with trustless zero-knowledge light client technology. Due to the light client finality requirements (at least 12mins on Ethereum), the transactions will take approx. 30mins to be signed by the bridge. However, users can still use 3rd party bridges (Jumper.exchange, Connext, Hop) without any impact. For more details, check out [how AMB & Omnibridge works with Telepathy validator](#how-it-works-with-telepathy-validator). +With [Telepathy added as the 8th validator](../managementdecisions.md#add-telepathy-validator-in-the-amb), AMB bridge is now more secure with trustless zero-knowledge light client technology. Due to the light client finality requirements (at least 23mins on Ethereum), the transactions will take approx. 30mins to be signed by the bridge. However, users can still use 3rd party bridges (Jumper.exchange, Connext, Hop) without any impact. For more details, check out [how AMB & Omnibridge works with Telepathy validator](#how-it-works-with-telepathy-validator). ## Key Information @@ -24,63 +22,12 @@ With [Telepathy added as the 8th validator](../governance/decisions.md#add-telep | Frontend URL | N/A | | Trust Model | [4-of-8 Validator Multisig](#bridge-validators) | | Governance | [8-of-16 Multisig](#bridge-governance) | -| Governance Parameters | | +| Governance Parameters | [Validators](#bridge-validators) | | Bug Bounty | [up to $2m](https://immunefi.com/bounty/gnosischain/) | | Bug Reporting | [Immunefi](https://immunefi.com/bounty/gnosischain/) | -### Fees & Daily Limits - -As the Arbitrary Message Bridge is a message passing bridge, there are no fees or daily limits associated with it. - -### Bridge Validators - -For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community and ZK Light Client validator Telepathy. - -### Current Bridge Validators - - - - -| GC Address | Organization Name | -| -------------------------------------------------------------------------------------------------------------------------- | ----------------- | -| [gno:0x459a3bd49f1ff109bc90b76125533699aaaaf9a6](https://gnosisscan.io/address/0x459a3bd49f1ff109bc90b76125533699aaaaf9a6) | Protofire | -| [gno:0x105CD22eD3D089Bf5589C59b452f9dE0796Ca52d](https://gnosisscan.io/address/0x105CD22eD3D089Bf5589C59b452f9dE0796Ca52d) | Giveth | -| [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://gnosisscan.io/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | Karpatkey | -| [gno:0xbdc141c8d2343f33f40cb9edd601ccf460cd0dde](https://gnosisscan.io/address/0xbdc141c8d2343f33f40cb9edd601ccf460cd0dde) | GnosisDAO | -| [gno:0x674c97db4ce6cac04a124d745979f3e4cba0e9f0](https://gnosisscan.io/address/0x674c97db4ce6cac04a124d745979f3e4cba0e9f0) | Cow Protocol | -| [gno:0x258667E543C913264388B33328337257aF208a8f](https://gnosisscan.io/address/0x258667E543C913264388B33328337257aF208a8f) | Gnosis Safe | -| [gno:0x90776017057b84bc47D7e7383b65C463C80a6cdd](https://gnosisscan.io/address/0x90776017057b84bc47D7e7383b65C463C80a6cdd) | Gateway | -| [gno:0x456c255A8BC1F33778603A2a48Eb6B0C69F4d48E](https://gnosisscan.io/address/0x456c255A8BC1F33778603A2a48Eb6B0C69F4d48E) | Telepathy | - - - - - -0x725bC6F18F8CDd7f57A9aB9A9f2Ea17A199185e5 -0xb1562173109932146a7fBBF28d7c6652bc2DaACE - - - - - -[0xc9ADb79B8A6e7C6e90c765A3B4d16d81213c9D49](https://gnosisscan.io/address/0xc9ADb79B8A6e7C6e90c765A3B4d16d81213c9D49) - - - - - - -### Bridge Governance - -- See [Bridge Governance](/bridges/governance) - ## Key Contracts -References: - -- [Bridge Governance Board](/bridges/tokenbridge/amb-bridge#bridge-governance) -- [Bridge Daily Limits](/bridges/tokenbridge/amb-bridge#fees--daily-limits) - @@ -88,8 +35,8 @@ References: | Contract | Address | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| AMB/Omnibridge Multi-Token Mediator | [0x88ad09518695c6c3712AC10a214bE5109a655671](https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671#writeProxyContract) | -| AMB Contract Proxy (Foreign) | [0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e#writeProxyContract) | +| Omnibridge Multi-Token Mediator | [0x88ad09518695c6c3712AC10a214bE5109a655671](https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671#writeProxyContract) | +| AMB (Foreign) | [0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e#writeProxyContract) | | AMB/OmniBridge wETH Router Helper | [0xa6439Ca0FCbA1d0F80df0bE6A17220feD9c9038a](https://etherscan.io/address/0xa6439ca0fcba1d0f80df0be6a17220fed9c9038a) | @@ -101,7 +48,7 @@ References: | Contract | Address | | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | AMB/Omnibridge Multi-Token Mediator | [0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d](https://gnosisscan.io/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d#writeProxyContract) | -| AMB Contract Proxy (Home) | [0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract) | +| AMB (Home) | [0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract) | | AMB Helper Contract | [0x7d94ece17e81355326e3359115D4B02411825EdD](https://gnosisscan.io/address/0x7d94ece17e81355326e3359115D4B02411825EdD#readContract) | @@ -148,11 +95,24 @@ The bridge betwee Goerli and Chiado is deprecating soon. + +### Fees & Daily Limits + +As the Arbitrary Message Bridge is a message passing bridge, there are no fees or daily limits associated with it. + +### Bridge Validators + +- See [Bridge Validator](/bridges/management/validators#amb--omnibridge) + +### Bridge Governance + +- See [Bridge Governance](/bridges/management) + ## How it works ### Terminology -- **Home (Native) Network**: Of the two networks being bridged between, the home or native network is the one with fast and inexpensive operations. All bridge operations to collect validator confirmations are performed on this side of the bridge. +- **Home (Native) Network**: Of the two networks being bridged between, the home or native network is the one with fast and inexpensive operations. All bridge operations to collect validator confirmations are performed on this side of the bridge. It is the Gnosis Chain in this case. - **Foreign Network**: Can be any EVM chain, generally it refers to Ethereum. - **Originating Contract**: An arbitrary contract where the message originates, typically this is where the user interacts and requests for a function to be invoked on another network. @@ -175,22 +135,19 @@ function requireToPassMessage (address _contract, #### Foreign Network to Home Network 1. User calls `foo()` on the originating contract -2. Originating contract calls `requireToPassMessage()` on Foreign Bridge contract, and encodes `foo()`, target address, and gas limit used on the other chain for executing a message. +2. Originating contract calls [`requireToPassMessage()`](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e#writeProxyContract#F10) on Foreign Bridge contract, and encodes `foo()`, target address, and gas limit used on the other chain for executing a message. 3. `UserRequestForAffirmation` event is emitted, and listening validators relay the message to the Home side where signatures are collected -4. `executeAffirmation()` is called on the Home Bridge contract by a validator once enough signatures are collected. +4. [`executeAffirmation()`](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract#F15) is called on the Home Bridge contract by a validator once enough signatures are collected. 5. Home bridge contract decodes the message and calls `foo()` on the target contract. #### Home Network to Foreign Network 1. User calls `foo()` on an originating contract -2. Originating contract calls `requireToPassMessage()` on Home Bridge contract, and encodes `foo()`, target address, and gas limit used on the other chain for executing a message. -3. Signatures are collected from validators by calling `submitSignatures()`, and once enough are collected `CollectedSignatures()` event is emitted. -4. Message is relayed to the Foreign Bridge contract, and `executeSignatures()` is called +2. Originating contract calls [`requireToPassMessage()`](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract#F14) on Home Bridge contract, and encodes `foo()`, target address, and gas limit used on the other chain for executing a message. +3. Signatures are collected from validators by calling [`submitSignatures()`](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract#F5), and once enough are collected `CollectedSignatures()` event is emitted. +4. Message is relayed to the Foreign Bridge contract, and [`executeSignatures()`](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e#writeProxyContract#F3) is called 5. Foreign bridge contract decodes the message and calls `foo()` on target contract -[AMB Bridge proxy contact on Ethereum](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e#writeProxyContract) -[AMB Bridge Proxy Contract in Gnosis](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract) - ### How it works with Telepathy validator ![AMB&Omnibridge with Telepathy Validator](../../../static/img/bridges/AMBValidators.png) @@ -252,37 +209,12 @@ A mediator contract is needed if there is an approval flow, such as when transfe | DevOps | [Bridge monitoring](https://github.com/omni/tokenbridge/blob/master/monitor/README.md), [ALM](https://github.com/omni/tokenbridge/tree/master/alm), docker compose, ansible playbooks | | dApp Contracts | extensions (pair mediator contracts on both sides of the AMB), such as the Omnibridge | -### Uses of AMB +### Use Cases of AMB - ERC-to-ERC Bridges: `AMB-ERC-TO-ERC` mode enables the transfer of ERC tokens to the Foreign Mediator, which will interact with Foreign AMB Bridge to mint wrapped ERC-667 tokens on the Home Network. Complimentarily, the mode enables the transfer ERC20 or ERC-667 tokens to the Home Mediator, which will interact with Home AMB Bridge to unlock ERC20 tokens on the Foreign network. This is used by the [Omnibridge](omnibridge). - ERC-to-Native Bridges: `ERC-TO-NATIVE` mode enables the user to send ERC20 tokens to the Foreign Bridge and receive native coins from the Home Bridge Complimentarily, then can send native coins to the Home Bridge to unlock ERC20 tokens from the Foreign Bridge. The home network nodes must support a consensus engine that allows using a smart contract for block reward calculation. This mode is used by the [xDai Bridge](xdai-bridge) - Message Passing: `ARBITRARY-MESSAGE` mode enables the capability to invoke a Home/Foreign Bridge contract to send a message that will be executed on the other Network. This can be an arbitrary contract method invocation. -## Managing Bridge Contracts - -### Bridge Roles - -- **Administrator** role (representation of a multisig contract): - - add/remove validators - - set daily limits on either direction - - set maximum per transaction limit on both bridges - - set minimum per transaction limit on both bridges - - upgrade contracts in case of vulnerability - - set minimum required signatures from validators in order to relay a user's transaction -- **Validator** role: - - provide 100% uptime to relay transactions - - listen for `UserRequestForSignature` events on Home Bridge and sign an approval to relay assets on Foreign network - - listen for `CollectedSignatures` events on Home Bridge. As soon as enough signatures are collected, transfer all collected signatures to the Foreign Bridge contract. - - listen for `UserRequestForAffirmation` or `Transfer` (depending on the bridge mode) events on the Foreign Bridge and send approval to Home Bridge to relay assets from Foreign Network to Home -- **User** role: - - sends assets to Bridge contracts: - - in `ERC-TO-NATIVE` mode: send ERC20 tokens to the Foreign Bridge to receive native coins from the Home Bridge, send native coins to the Home Bridge to unlock ERC20 tokens from the Foreign Bridge; - - in `ARBITRARY-MESSAGE` mode: Invoke Home/Foreign Bridge to send a message that will be executed on the other Network as an arbitrary contract method invocation; - - in `AMB-ERC-TO-ERC` mode: transfer ERC20 tokens to the Foreign Mediator which will interact with Foreign AMB Bridge to mint ERC20 tokens on the Home Network, and transfer ERC20 tokens to the Home Mediator which will interact with Home AMB Bridge to unlock ERC20 tokens on Foreign network. - -## Managing Bridge Validators - -Bridge admins can vote to add/remove validators. Read more about governance [here](../governance/README.md) ## Resources diff --git a/docs/bridges/Token Bridge/omnibridge.md b/docs/bridges/About Token Bridges/omnibridge.md similarity index 73% rename from docs/bridges/Token Bridge/omnibridge.md rename to docs/bridges/About Token Bridges/omnibridge.md index 6cd45396..fc0dd5d9 100644 --- a/docs/bridges/Token Bridge/omnibridge.md +++ b/docs/bridges/About Token Bridges/omnibridge.md @@ -7,14 +7,14 @@ keywords: [omnibridge, token bridge, token claim] # Omnibridge :::info -Legacy Omnibridge can be accessed at https://omni.legacy.gnosischain.com/bridge +The Omnibride can be used in https://bridge.gnosischain.com/. +Please avoid using the legacy Omnibridge: https://omni.legacy.gnosischain.com/bridge ::: -![](/img/bridges/diagrams/token-bridge-01.png) ## Key Information -[Omnibridge](https://omni.legacy.gnosischain.com/bridge) is a native token bridge that mints the canonical representations of bridged assets on Gnosis. The Omnibridge is built on top of the [Arbitrary Message Bridge (AMB)](/bridges/tokenbridge/amb-bridge) and thus relies on the same group of [Trusted Bridge Validators](/bridges/tokenbridge/amb-bridge#bridge-validators) and trust model as the AMB. With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), Omnibridge bridge is now more secure with trustless zero-knowledge light client technology. Check out how Omnibridge works with Telepathy validator [here](amb-bridge.md#how-it-works-with-telepathy-validator). +[Omnibridge](https://bridge.gnosischain.com/) is a native token bridge that mints the canonical representations of bridged assets on Gnosis. The Omnibridge is built on top of the [Arbitrary Message Bridge (AMB)](/bridges/Token%20Bridge/amb-bridge) and thus relies on the same group of [bridge validators](/bridges/Token%20Bridge/amb-bridge#bridge-validators) and trust model as the AMB. The Omnibridge currently connects Gnosis to Ethereum. @@ -24,7 +24,7 @@ The Omnibridge mints bridged tokens using a variant of the [ERC-677](https://git | | Detail | | --------------------- | ----------------------------------------------------- | -| Frontend URL | https://omni.gnosischain.com | +| Frontend URL | https://bridge.gnosischain.com/ | | Trust Model | [4-of-8 Validator Multisig](#bridge-validators) | | Governance | [8-of-16 Multisig](#bridge-governance) | | Governance Parameters | Validator Set, Daily Limits, Fees | @@ -51,7 +51,7 @@ The Omnibridge mints bridged tokens using a variant of the [ERC-677](https://git | Contract | Gnosis Address | | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| AMB Proxy Contract | [0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract) | +| AMB Proxy Contract (Home) | [0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59](https://gnosisscan.io/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59#writeProxyContract) | | Omnibridge Multi-Token Mediator Proxy | [0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d](https://gnosisscan.io/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d#writeProxyContract) | | Validator Management Contract | [0xA280feD8D7CaD9a76C8b50cA5c33c2534fFa5008](https://gnosisscan.io/address/0xA280feD8D7CaD9a76C8b50cA5c33c2534fFa5008#writeContract) | @@ -104,8 +104,13 @@ The bridge betwee Goerli and Chiado is deprecating soon. | Token | Ethereum -> Gnosis | Gnosis -> Ethereum | | ---------------- | ------------------ | ------------------ | -| Approx. Gas Cost | | | -| Bridge Fees | 0% | 0.1% | +| Default Bridge Fees | 0% | 0.1% | + +```mdx-code-block +
+ Fees and transaction limits of specific token +
+``` #### Single Transaction Limits @@ -113,6 +118,7 @@ The bridge betwee Goerli and Chiado is deprecating soon. Bridging DAI token to Gnosis Chain DOES NOT mint native xDai token. If you want native xDai, use the [xDai Bridge](xdai-bridge) ::: + | Token | Ethereum -> Gnosis | Gnosis -> Ethereum | | --------- | ------------------ | ------------------- | | Dai\*\*\* | 1,000,000,000 | 1,000,000,000 WXDAI | @@ -149,25 +155,30 @@ Bridging DAI token to Gnosis Chain DOES NOT mint native xDai token. If you want Daily Limit is reset according to the following logic: the smart contract stores total amount of processed tokens per current day and reverts on a new transfer if it exceeds the daily limit. Id of the day is calculated using the formula `timestamp / (number of seconds in 1 day)`, where `timestamp` is the Unix timestamp. ::: +```mdx-code-block +
+
+``` + + + ### Bridge Validators -For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community. Since Omnibridge is based on the Arbitrary Message Bridge functionality, the set of validators is the actual set of AMB validators. The same [validator set](amb-bridge#bridge-validators) is used as the AMB bridge, as the OmniBridge is built on top of the AMB Bridge. -### Bridge Validator Flow +- See [Bridge Validator](/bridges/management/validators#amb--omnibridge) -![](/img/bridges/diagrams/amb-bridge-validator-flow.png) ### Bridge Governance -- See [Bridge Governance](/bridges/governance) +- See [Bridge Governance](/bridges/management) -## Bridge Design +## How it works ### Ethereum -> Gnosis ![](/img/bridges/diagrams/token-bridge-01.png) -1. Token spend approval by user. +1. User `approve` Omnibridge as token spender. 2. User call `relayTokens()` on Mediator contract. 3. Mediator calls `requireToPassMessage()` on the Bridge. 4. `UserRequestForAffirmation` event is emitted for validators to validate the message. @@ -196,7 +207,7 @@ The Omnibridge is built on top of the [Arbitrary Message Bridge](./amb-bridge.md ### Mediator Contracts -To handle the approval of token transfers, the Omnibridge makes use of what is called a mediator contract. +To handle the approval of token transfers, the Omnibridge makes use of what is called a mediator contract. No matter which side of the chain is originated, the following flows are valid. ![](/img/bridges/diagrams/amb-bridge-contract-flow-mediator.svg) 1. User calls token contract's `approve()` function to approve the balance to be transferred. @@ -273,7 +284,7 @@ Additional References: In a multi-chain world, some assets (e.g. USDC) can be bridged over from different chains. This is because the two bridges create different representation of the token on Gnosis, even if the underlying asset is the same. -For example, there are two different representations of USDC on Gnosis: +For example, there are two different representations of USDC on Gnosis(created by Omnibridge, it follows ERC677 standard): | Asset | Token Contract | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | @@ -282,46 +293,22 @@ For example, there are two different representations of USDC on Gnosis: Gnosis adopts a naming convention where the "chain of origin" is added as a suffix to the token name (e.g. USDC from Ethereum, USDC from BSC) -## Managing the Bridge - -Bridge administrators can perform 4 groups of operations with the xDai bridge. All operations are performed by owners of the Multisignature Wallet which requires several accounts to confirm the operation transaction. - -| Network | Multisignature Wallet Address | -| ----------- | ---------------------------------------------------------------------------------------------------------------------- | -| ETH Mainnet | [0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd](https://etherscan.io/address/0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd) | -| Gnosis | [0x0d3726e5a9f37234d6b55216fc971d30f150a60f](https://gnosisscan.io/address/0x0d3726e5a9f37234d6b55216fc971d30f150a60f) | +### USDC.e: A USDC token on Gnosis Chain that complies with Circle standard -### Interacting with Bridge Contracts - -1. One of the multisig wallet owners encodes the method call with a set of parameters (if any). For example, this can be done with the [ABI Encoding Service](https://abi.hashex.org/). -2. The encoded sequence of bytes is used to create a transaction for the multisig wallet contract. This is done with the `submitTransaction()` method of the multisig wallet contract. The method raises the event `Submission` containing the index of the registered transaction. The index is shared with the other owners of the wallet. -3. The rest of the owners confirm the transaction by invoking `confirmTransaction` from the multisig wallet contract. As soon as enough confirmations are received, the method encoded in step 1 is invoked automatically. This is important because adequate gas limits must be set for that transaction and for the set of confirmations sent by the wallet owner finalizing the operation. -4. If the method is not invoked because the gas limit is exceeded, the owners can execute the confirmed transaction manually by sending `executeTransaction()`. - This process can vary depending on the action being taken. - -### Upgrading Bridge Contract - -There are two possible scenarios for how the bridge or validators contracts can be upgraded: - -- Security fix when only the contract implementation is changed -- Improvement when the contract implementation upgrade requires initialization of storage values. - -A more detailed explanation can be found on the [xDai Bridge page](./xdai-bridge.md). The steps are the same but the contract addresses differ. - -### Managing Bridge Validators - -Bridge validators are separate from chain validators, and currently composed of a subset of Gnosis Chain validators. This is a dynamic set, as the bridge governors can vote to increase the current set as well as propose and vote on other bridge related measures. -After a ballot is finalized, the new validator is added to the bridge management multisignature wallets (one on each side of the bridge). -The submitter will execute these methods: `addValidator` and (optionally if the voting threshold is to be changed) the `setRequiredSignatures` method. After encoding the data for each of these methods, it is sent to each contract (one on either side of the bridge) using the `submitTransaction()` execution method. +:::info +When using [Bridge UI](https://bridge.gnosischain.com/): +Bridging from Ethereum, users bridge [USDC](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) and get [USDC.e](https://gnosisscan.io/address/0x2a22f9c3b484c3629090feed35f17ff8f88f76f0). +Bridging from Gnosis Chain, users bridge [USDC on xDAI](https://gnosisscan.io/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83) and get [USDC](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48). +Use [USDC swap](https://bridge.gnosischain.com/usdc) to swap between USDC.e and USDC on xDAI +::: -:::info -Before starting, current validators should determine: +USDC.e is a token compliant with the [Circle's Bridged USDC Standard](https://github.com/circlefin/stablecoin-evm/blob/master/doc/bridged_USDC_standard.md). To ensure smooth bridging operations, when using [Bridge UI](https://bridge.gnosischain.com/) to bridge [USDC](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) from Ethereum, user will get [USDC.e](https://gnosisscan.io/address/0x2a22f9c3b484c3629090feed35f17ff8f88f76f0) by default. -1. Who will add the new validator (the submitter) -2. Coordinate a time when the other validators will confirm the transaction, as the bridge will be stopped to complete the upgrade. -3. Ask the Omnibridge team to add a new bridge validator to the Certifier contract and confirm it has been added. This enables the node to relay bridge transactions with zero gas price. - ::: -- [TokenBridge Docs: Migrating Oracle to new Server](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-oracle-maintenance/oracle-migration-to-a-new-server) +1. Bridging from ETH: + a. Select **Ethereum** as source chain and **USDC** as token to bridge, you will get the equivalent amount of USDC.e on Gnosis Chain. (If you wish to get the [USDC on xDAI (old USDC)](https://gnosis.blockscout.com/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83), you may use the [USDC swap](https://bridge.gnosischain.com/usdc) in the Bridge UI to swap your USDC.e to USDC(old), and vice versa) +2. Bridging from GC: + a. Select **Gnosis Chain** as source chain and **USDC.e** as token, is not allowed, user need to swap their **USDC.e** to **USDC on xDAI(old USDC)** on the [USDC swap](https://bridge.gnosischain.com/usdc). + b. Select **Gnosis Chain** as source chain and **USDC on xDAI (old USDC)** as token, and claim their USDC on Ethereum. -Additional steps for setting up a validator node can be found in [governance](../governance/README.md#how-to-setup) and [here](https://github.com/gnosischain/documentation/issues/72) +For more detail, check out [this twitter post](https://x.com/gnosischain/status/1800565095065641409). \ No newline at end of file diff --git a/docs/bridges/Token Bridge/xdai-bridge.md b/docs/bridges/About Token Bridges/xdai-bridge.md similarity index 58% rename from docs/bridges/Token Bridge/xdai-bridge.md rename to docs/bridges/About Token Bridges/xdai-bridge.md index cc284044..a3518875 100644 --- a/docs/bridges/Token Bridge/xdai-bridge.md +++ b/docs/bridges/About Token Bridges/xdai-bridge.md @@ -7,17 +7,14 @@ keywords: [xdai bridge, bridge, dai, ethereum, gnosis bridge] # xDai Bridge :::info - -The Legacy xDai bridge can be found at https://bridge.legacy.gnosischain.com/ - - +The xDAI bridge can be used in https://bridge.gnosischain.com by selecting DAI/xDAI. +Please avoid using the legacy xDai bridge: https://bridge.legacy.gnosischain.com/. ::: -The [Legacy xDai bridge](https://bridge.legacy.gnosischain.com/) is a native Dai bridge from Ethereum that is used to mint and burn [xDai](/concepts/tokens/xdai), the native asset used for gas and transaction fees on Gnosis. +The [xDai bridge](https://bridge.gnosischain.com) is a native DAI bridge from Ethereum that is used to mint and burn [xDai](/about/tokens/xdai), the native asset used for gas and transaction fees on Gnosis. -![xDai Bridge Diagram](/img/bridges/diagrams/dai-bridge-01.png) -Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis notifies the [block rewards contract](#block-rewards-contract). The consensus algorithm then mints xDai to the user's corresponding address on Gnosis in the next block. +Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis notifies the [block rewards contract](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA). The consensus algorithm then mints xDai to the user's corresponding address on Gnosis in the next block. ## Key Information @@ -43,7 +40,7 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | xDAI Bridge Contract | [eth:0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#readProxyContract) | | Validator Management Contract | [eth:0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#code) | -| Admin Multisignature Wallet | [eth:0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd](https://etherscan.io/address/0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd) | + @@ -55,7 +52,6 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not | xDAI Bridge Contract | [gno:0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6#address-tabs) | | Block Reward Contract | [gno:0x481c034c6d9441db23Ea48De68BCAe812C5d39bA](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) | | Validator Management Contract | [gno:0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D/read-proxy) | -| Admin Multisignature Wallet | [gno:0x0d3726e5a9f37234d6b55216fc971d30f150a60f](https://gnosis.blockscout.com/address/0x0D3726e5a9f37234D6B55216fC971D30F150a60F/transactions#address-tabs) | | ERC20ToNative Helper Contract | [gno:0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A](https://gnosis.blockscout.com/address/0x2d51eaa266eafcb59bb36dd3c7e99c515e58113a#readContract) | @@ -93,11 +89,86 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not The current deployment of xDAI bridge contract is from [tokenbridge-contracts/xdaibridge-upgrade-sdai](https://github.com/gnosischain/tokenbridge-contracts/tree/xdaibridge-upgrade-sdai), with the commit hash `bf602f35e624cc6c58c827e7c56b23c8b1afa69a` ::: -References: - +References: +** Some of the informations from TokenBridge Docs are outdated, please verify the information before you bridge. - [TokenBridge Docs: About xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/about) - [TokenBridge Docs: Bridge Contract Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) + +### Fees & Daily Limits + +| Type | Ethereum -> Gnosis | Gnosis -> Ethereum | +| ------------------ | ------------------ | ------------------ | +| Bridge Fees | 0% | 0% | +| Min Transfer | 0.005 Dai | 10 xDai | +| Daily Limit | 10,000,000 Dai | 10,000,000 xDai | +| Max Single Deposit | 9,999,999 Dai | 10,000,000 xDai | + +:::note +Daily Limit is reset according to the following logic: the smart contract stores total amount of processed tokens per current day and reverts on a new transfer if it exceeds the daily limit. Id of the day is calculated using the formula `timestamp / (number of seconds in 1 day)`, where `timestamp` is the Unix timestamp. +::: + +### Bridge Validators + + +- See [Bridge Validator](/bridges/management/validators#xdaibridge) + +### Bridge Governance + +- See [Bridge Governance](/bridges/management) + + + +## How it Works + +### Ethereum -> Gnosis Chain. + +![](/img/bridges/diagrams/dai-bridge-01.png) + +The [xDai token](/concepts/tokens/xdai) is minted when Dai is transferred from Ethereum to Gnosis using the xDai Bridge. During the transfer process, a block reward contract is invoked to mint xDai to a user's account. Because contract calls are made from the consensus engine to create xDai tokens, balance updates are more difficult to trace than simple value transfers. + +1. Users lock DAI on the [bridge contract](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#code) on Ethereum by approving the bridge contract and calling `relayTokens`. +2. `UserRequestForAffirmation` event is triggered +3. Validators observe the deposit and invoke `executeAffirmation` function on Gnosis bridge contract +4. When enough confirmations are collected (4/7 majority), the bridge contract on Gnosis Chain calls the block reward contract to record the receiver(s) and amount(s) of xDAI to mint. +5. The [block reward contract](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) is called by the consensus engine to update user's xDAI balance. + +User may check the balance change visually using Blockscout's [coin balance history](https://gnosis.blockscout.com/address/0xE05FB316eB8C4ba7288D43c1bd87BE8a8d16761C?tab=coin_balance_history) or programmatically using [eth_getBalance](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getbalance) API. + +You can also view a receiver's address and amount of xDai received in the [block reward contract's](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) logs. Whenever the `executeAffirmation` method is called, it emits the `AddedReceiver` event: + +``` +AddedReceiver( + uint256 amount, + address indexed receiver, + address indexed bridge +) +``` + +Example: https://gnosis.blockscout.com/tx/0x5892a695860f6087a2d93140f05e6365142ff77fd7128e39dbc03128d5797ac4?tab=logs + +--- + +### Gnosis Chain -> Ethereum. + +![](/img/bridges/diagrams/dai-bridge-02.png) + +1. User transfer xDAI to Gnosis Chain's xDAI bridge, xDAI is burned. +2. `UserRequestForSignature` event emitted (see [example transaction](https://blockscout.com/xdai/mainnet/tx/0x8e23cf0ab01476c2df5b71a72603f2c229d3d9a63ad6ca71ce164798f3733826/internal-transactions)). +3. Validators listen to the event and call `submitSignature` on Gnosis chain. +4. After enough signatures are collected, `CollectedSignatures` event is emitted +5. Anyone can execute the withdrawal on Ethereum (user via UI or validator). DAI is unlocked to the receiver on Ethereum. +6. `RelayedMessage` emitted on mainnet + +:::note +This final step may be delayed if Ethereum mainnet is congested. +::: + +References: + +- [TokenBridge Docs: Withdrawing xDai to Dai](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/withdrawal-authorization-flow) + + ### Savings xDAI Application: https://agave.finance/sdai/ @@ -195,195 +266,11 @@ The second contract is the Interest Receiver. This will be the address provided | SavingsXDAI Adapter | [0xc1529e13A5842D790da01F778Bf23a3677830986](https://gnosis-chiado.blockscout.com/address/0xc1529e13A5842D790da01F778Bf23a3677830986) | | Bridge Interest Receiver | [0x65e75819E4e8250a03958Ba303E8f95F8f578168](https://gnosis-chiado.blockscout.com/address/0x65e75819E4e8250a03958Ba303E8f95F8f578168) | - - - - -### Fees & Daily Limits - -| Type | Ethereum -> Gnosis | Gnosis -> Ethereum | -| ------------------ | ------------------ | ------------------ | -| Approx. Gas Cost | | | -| Bridge Fees | 0% | 0% | -| Min Transfer | 0.005 Dai | 10 xDai | -| Daily Limit | 10,000,000 Dai | 10,000,000 xDai | -| Max Single Deposit | 9,999,999 Dai | 10,000,000 xDai | - -:::note -Daily Limit is reset according to the following logic: the smart contract stores total amount of processed tokens per current day and reverts on a new transfer if it exceeds the daily limit. Id of the day is calculated using the formula `timestamp / (number of seconds in 1 day)`, where `timestamp` is the Unix timestamp. -::: - -### Bridge Validators - -The xDai bridge relies on trusted xDai Bridge Validators as cross-chain bridge oracle. There is a roadmap to move towards [trustless bridges](/bridges/roadmap). - - - - - -Bridge transactions currently requires signatures from 4 of 7 validators. - -| Organization | Gnosis Address | -| ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | -| GnosisDao | [gno:0x97630e2ae609d4104abda91f3066c556403182dd](https://gnosis.blockscout.com/address/0x97630e2ae609d4104abda91f3066c556403182dd) | -| Protofire | [gno:0x4d1c96b9a49c4469a0b720a22b74b034eddfe051](https://gnosis.blockscout.com/address/0x4D1c96B9A49C4469A0b720a22b74b034EDdFe051) | -| CowProtocol | [gno:0x587c0d02b40822f15f05301d87c16f6a08aaddde](https://gnosis.blockscout.com/address/0x587c0d02b40822f15f05301d87c16f6a08aaddde) | -| Giveth | [gno:0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506](https://gnosis.blockscout.com/address/0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506) | -| GnosisSafe | [gno:0x1312e98995bbcc30fc63db3cef807e20cdd33dca](https://gnosis.blockscout.com/address/0x1312e98995bbcc30fc63db3cef807e20cdd33dca) | -| Karpatkey | [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://gnosis.blockscout.com/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | -| Gateway | [gno:0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6](https://gnosis.blockscout.com/address/0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6) | - - - 0x725bc6f18f8cdd7f57a9ab9a9f2ea17a199185e5 - 0xb1562173109932146a7fbbf28d7c6652bc2daace - - - - - -| Network | Address | -| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Goerli | 0xef35547c29a7547df67ff573c158bf1b74381add(Gateway)
0xda286781cbbc9819c94852885a118c93ed25e064
0x758c277ca1b04da3ba3add5d61cd26337cfafd7e
0xdc3a6044440b75c5cefb023ae2d0e5b9069230cf (Gnosis DAO) | -| Chiado | 0xef35547c29a7547df67ff573c158bf1b74381add(Gateway)
0xda286781cbbc9819c94852885a118c93ed25e064
0x758c277ca1b04da3ba3add5d61cd26337cfafd7e
0x9d84152df06880cdabeb30e10c2985f40d98b901
0xdc3a6044440b75c5cefb023ae2d0e5b9069230cf (Gnosis DAO) | - -
- -
-### Bridge Validator Flow - -![](/img/bridges/diagrams/xdai-bridge-validator-flow.png) - -### Bridge Governance - -- See [Bridge Governance](/bridges/governance) - -### Bridge Revenue - -The xDai bridge currently generates bridge revenue through earned yield on stablecoins deposited on the bridge, which is then used by the GnosisDAO treasury to fund Gnosis development. - -### Analytics - -- [Dune Analytics on xDai Bridge Transfers & Amount](https://dune.com/maxaleks/xDai-Bridge) - -## How it Works - -### Ethereum -> Gnosis Chain. - -![](/img/bridges/diagrams/dai-bridge-01.png) - -The [xDai token](/concepts/tokens/xdai) is minted when Dai is transferred from Ethereum to Gnosis using the xDai Bridge. During the transfer process, a block reward contract is invoked to mint xDai to a user's account. Because contract calls are made from the consensus engine to create xDai tokens, balance updates are more difficult to trace than simple value transfers. - -1. Users lock DAI on the [bridge contract](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#code) on Ethereum by calling `relayTokens`. -2. `UserRequestForAffirmation` event is triggered -3. Validators observe the deposit and invoke `executeAffirmation` function on Gnosis bridge contract -4. When enough confirmations are collected (4/7 majority), the bridge contract on Gnosis Chain calls the block reward contract to record the receiver(s) and amount(s) of xDAI to mint. -5. The [block reward contract](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) is called by the consensus engine to update user's xDAI balance. - -User may check the balance change visually using Blockscout's [coin balance history](https://gnosis.blockscout.com/address/0xE05FB316eB8C4ba7288D43c1bd87BE8a8d16761C?tab=coin_balance_history) or programmatically using [eth_getBalance](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getbalance) api. - -You can also view a receiver's address and amount of xDai received in the [block reward contract's](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) logs. Whenever the `executeAffirmation` method is called, it emits the following event: - -``` -AddedReceiver( - uint256 amount, - address indexed receiver, - address indexed bridge -) -``` - -Example: https://gnosis.blockscout.com/tx/0x5892a695860f6087a2d93140f05e6365142ff77fd7128e39dbc03128d5797ac4?tab=logs - ---- - -### Gnosis Chain -> Ethereum. - -![](/img/bridges/diagrams/dai-bridge-02.png) - -1. User -> Gnosis Chain bridge: initiate a withdrawal: xDAI is burned. -2. `UserRequestForSignature` event emitted (see [example transaction](https://blockscout.com/xdai/mainnet/tx/0x8e23cf0ab01476c2df5b71a72603f2c229d3d9a63ad6ca71ce164798f3733826/internal-transactions)). -3. Validators listen to the event and call `submitSignature` on Gnosis chain. -4. After consensus: `CollectedSignatures` event is emitted -5. Anyone can execute the withdrawal on Ethereum (user via UI or validator). DAI is unlocked. -6. `RelayedMessage` emitted on mainnet - -:::note -This final step may be delayed if Ethereum mainnet is congested. -::: - -References: - -- [TokenBridge Docs: Withdrawing xDai to Dai](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/withdrawal-authorization-flow) - -## Managing Bridge Contracts - -### Upgrading a Contract - -There are two possible scenarios for how the bridge or validators contracts can be upgraded: - -- a security fix when only the contract implementation is changed -- an improvement when the contract implementation upgrade requires initialization of storage values. - -#### Basic Process - -![](/img/bridges/diagrams/xdaibridge-contract-mgmt.svg) - -1. One of the multisig wallet owners ABI encodes a method call with parameters (if any). This can be done with the [ABI Encoding Service](https://abi.hashex.org/). The encoded sequence of bytes is used to create a transaction for the multisig wallet contract. This is done with the `submitTransaction` method of the multisig wallet contract. -2. The method raises the event `Submission` containing the index of the registered transaction. The index is shared with the other owners of the wallet. -3. The rest of the owners confirm the transaction by invoking `confirmTransaction` from the multisig wallet contract. -4. As soon as enough confirmations are received, the method encoded in step 1 is invoked automatically. This is important because adequate gas limits must be set for that transaction and set of confirmations sent by the wallet owner finalizing the operation. If the method is not invoked because the gas limit is exceeded, the owners can execute the confirmed transaction manually by sending `executeTransaction`. - -#### Security Upgrade - -1. Deploy a new implementation of the bridge or validators contract. -2. Depending on the contract and the chain use one of the links below to get the current version of the contract implementation: - - The bridge contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), - - The validators contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) - - The bridge contract on _Gnosis_: [Blockscout](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6?tab=read_proxy) - - The validators contract on _Gnosis_: [Blockscout](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D?tab=read_proxy) -3. Use the `upgradeTo` method from EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `3ad06d160000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f097137c7ec5e582b5704065f72ac5903d0b526d`. -4. Invoke `submitTransaction` of the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). The data field must be filled with the bytes received from the previous step. The destination depends on the contract: - - `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. - - `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on the ETH Mainnet. - - `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on the xDai chain. - - `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on the xDai chain. -5. Identify the index of the transaction returned in the `Submission` event as soon as the transaction from the previous step is included into a block and share it with the other multisig wallet owners. -6. (for the rest of owners) Invoke `confirmTransaction` on the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on the Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). Set the gas limit to _three times bigger_ than the gas estimator function suggests. - -#### Bridge Improvement - -1. Identify the method to call as part of the new implementation initialization. In the following steps we assume that the method's name is `upgradeFrom3to4()` which takes no arguments. -2. Use the method mentioned above from the new contract implementation code or ABI to encode the data to be passed to `upgradeToAndCall()` method. Example of the data: `50d28adb`. -3. Deploy a new implementation of the bridge or validators contract. -4. Depending on the contract and the chain, use one of the links below to get the current `version` of the contract implementation: - - The bridge contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), - - The validators contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) - - The bridge contract on _Gnosis Chain_: [Blockscout](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6?tab=read_proxy) - - The validators contract on _Gnosis chain_: [Blockscout](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D?tab=read_proxy) -5. Use the `upgradeToAndCall` method from the EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `0xa9c45fcb0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000692a70d2e424a56d2c6c27aa97d1a86395877b3a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000450d28adb00000000000000000000000000000000000000000000000000000000`. -6. Invoke `submitTransaction` on the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). The data field must be filled with the bytes received on the previous step. The destination depends on the contract: - - `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. - - `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on ETH Mainnet. - - `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on Gnosis chain. - - `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on Gnosis chain. -7. Identify the index of the transaction returned in the `Submission` event as soon as the transaction from the previous step is included into a block and share it with other multisig wallet owners. -8. (for the rest of owners) Invoke `confirmTransaction()` of the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). Set the gas limit to _four times bigger_ than the gas estimator suggests. - -References: - -- [TokenBridge Docs: xDai Contracts Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) -- [TokenBridge Docs: Upgrading xDai Bridge Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/upgrade-contracts) -- [TokenBridge Docs: Configuring Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/configuration) -- [TokenBridge Docs: Admin Privilege Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/admin-privileges-management) -- [TokenBridge Docs: ERC20 Token Release](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/erc20-tokens-release) -- [TokenBridge Docs: xDai Bridge Management API](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/xdai-bridge-management-api) - ## Resources - [Tokenbridge Docs on xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/about) -- [xDai Bridge docs](/bridges/tutorials/using-xdai-bridge/) -- [TokenBridge Docs: Migrating Oracle to new Server](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-oracle-maintenance/oracle-migration-to-a-new-server) diff --git a/docs/bridges/Build with Bridges/_category_.json b/docs/bridges/Build with Bridges/_category_.json deleted file mode 100644 index 62cec52f..00000000 --- a/docs/bridges/Build with Bridges/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "position": 5, - "label": "Build with Bridges", - "collapsible": true, - "collapsed":true, - "link": { - "type": "generated-index", - "title": "How to build using AMB,Omnibridge and xDAI bridge" - } - } \ No newline at end of file diff --git a/docs/bridges/Token Bridge/nft-bridge.md b/docs/bridges/Legacy Bridges UI/nft-bridge.md similarity index 100% rename from docs/bridges/Token Bridge/nft-bridge.md rename to docs/bridges/Legacy Bridges UI/nft-bridge.md diff --git a/docs/bridges/Build with Bridges/using-omnibridge/README.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/README.md similarity index 97% rename from docs/bridges/Build with Bridges/using-omnibridge/README.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/README.md index 1108f2c2..1175564f 100644 --- a/docs/bridges/Build with Bridges/using-omnibridge/README.md +++ b/docs/bridges/Legacy Bridges UI/using-omnibridge/README.md @@ -7,7 +7,7 @@ keywords: [omnibridge, token bridge, gnosis, bsc, ethereum] # OmniBridge :::info -The Legacy OmniBridge and the legacy OmniBridge UI are now deprecated but still available, use it at your own risk. The OmniBridge UI can be accessed here: https://omni.legacy.gnosischain.com/bridge +The Legacy OmniBridge UI is now deprecated but still available, use it at your own risk. The OmniBridge UI can be accessed here: https://omni.legacy.gnosischain.com/bridge ::: The Omnibridge can be used to bridge ERC-20 tokens between Ethereum and Gnosis. The first time a token is bridged, a new ERC677 token contract is deployed on GC with an additional suffix to differentiate the token. It will say "token name on xDai", as this was the original chain name prior to re-branding. If a token has been bridged previously, the previously deployed contract is used. The requested token amount is minted and sent to the account initiating the transfer (or an alternative receiver account specified by the sender). diff --git a/docs/bridges/Build with Bridges/using-omnibridge/advanced.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/advanced.md similarity index 89% rename from docs/bridges/Build with Bridges/using-omnibridge/advanced.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/advanced.md index 49f305ce..a85ce912 100644 --- a/docs/bridges/Build with Bridges/using-omnibridge/advanced.md +++ b/docs/bridges/Legacy Bridges UI/using-omnibridge/advanced.md @@ -5,7 +5,12 @@ keywords: [alternate receiver, custom rpc endpoints, bridge, omnibridge ui, safe] --- -# Advanced +:::info +The following tutorial is refering to the legacy Omnibridge. +The new Bridge UI for Omnibridge can be used in https://bridge.gnosischain.com/, and relevant tutorials can be found in [here](../../Bridge%20Explorer.md). +Please avoid using the legacy Omnibridge: https://omni.legacy.gnosischain.com/bridge +::: + ## Alternate Receiver diff --git a/docs/bridges/Build with Bridges/using-omnibridge/bnb-chain.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/bnb-chain.md similarity index 100% rename from docs/bridges/Build with Bridges/using-omnibridge/bnb-chain.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/bnb-chain.md diff --git a/docs/bridges/Build with Bridges/using-omnibridge/debugging-omnibridge-txns.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/debugging-omnibridge-txns.md similarity index 94% rename from docs/bridges/Build with Bridges/using-omnibridge/debugging-omnibridge-txns.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/debugging-omnibridge-txns.md index a3789237..d9bd894d 100644 --- a/docs/bridges/Build with Bridges/using-omnibridge/debugging-omnibridge-txns.md +++ b/docs/bridges/Legacy Bridges UI/using-omnibridge/debugging-omnibridge-txns.md @@ -7,7 +7,7 @@ keywords: [amb debug, developer, debugging transactions, bridge transactions] # Debugging OmniBridge Transactions :::info -This page is mostly for application developers, if you sent tokens through the OmniBridge and would like to get the status whether the tokens were sent successfully or not, please use [AMB Live Monitoring application](https://alm-bridge-monitor.gnosischain.com/) instead. +This page is mostly for application developers, if you sent tokens through the OmniBridge and would like to get the status whether the tokens were sent successfully or not, please use [Bridge Explorer](https://bridge.gnosischain.com/bridge-explorer) instead. ::: Firstly, the [Foreign Arbitrary Message Bridge contract](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e) which is used by the OmniBridge, emits the `UserRequestForAffirmation` event as part of the a deposit request made by user (on the Ethereum side). diff --git a/docs/bridges/Build with Bridges/using-omnibridge/safe.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/safe.md similarity index 100% rename from docs/bridges/Build with Bridges/using-omnibridge/safe.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/safe.md diff --git a/docs/bridges/Build with Bridges/using-omnibridge/specific-tokens.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/specific-tokens.md similarity index 100% rename from docs/bridges/Build with Bridges/using-omnibridge/specific-tokens.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/specific-tokens.md diff --git a/docs/bridges/Build with Bridges/using-omnibridge/token-registry.md b/docs/bridges/Legacy Bridges UI/using-omnibridge/token-registry.md similarity index 100% rename from docs/bridges/Build with Bridges/using-omnibridge/token-registry.md rename to docs/bridges/Legacy Bridges UI/using-omnibridge/token-registry.md diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/README.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/README.md similarity index 100% rename from docs/bridges/Build with Bridges/using-xdai-bridge/README.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/README.md diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/alternate-receiver.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/alternate-receiver.md similarity index 96% rename from docs/bridges/Build with Bridges/using-xdai-bridge/alternate-receiver.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/alternate-receiver.md index 57b8f1be..782c72b7 100644 --- a/docs/bridges/Build with Bridges/using-xdai-bridge/alternate-receiver.md +++ b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/alternate-receiver.md @@ -5,6 +5,12 @@ keywords: [xdai bridge, alternate receiver, gnosis bridge] # Alternate Receiver +:::info +The following tutorial is refering to the legacy xDAI bridge. +The new Bridge UI for xDAI bridge can be used in https://bridge.gnosischain.com/, and relevant tutorials can be found in [here](../../Bridge%20Explorer.md). +Please avoid using the legacy xDAI bridge: https://bridge.legacy.gnosischain.com/ +::: + The feature _Alternative Receiver_ has integrated in the contracts of the xDai bridge as part of [an upgrade](https://forum.poa.network/t/migration-of-the-xdai-tokenbridge-completed/3212). With this feature it becomes possible to transfer tokens through the bridge to any account by very simple actions. It means that Alice can send Dai to Bob’s account on Gnosis chain in one transaction, and Bob can send xDai to Clare’s account on the Ethereum Mainnet in one transaction too. Due to different nature of tokens on two sides of the xDai bridge the operations to transfer assets to an alternative receiver from one chain to another differ as well. diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/custom-rpc.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/custom-rpc.md similarity index 100% rename from docs/bridges/Build with Bridges/using-xdai-bridge/custom-rpc.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/custom-rpc.md diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/no-ui.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/no-ui.md similarity index 100% rename from docs/bridges/Build with Bridges/using-xdai-bridge/no-ui.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/no-ui.md diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/safe.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/safe.md similarity index 100% rename from docs/bridges/Build with Bridges/using-xdai-bridge/safe.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/safe.md diff --git a/docs/bridges/Build with Bridges/using-xdai-bridge/troubleshooting.md b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/troubleshooting.md similarity index 97% rename from docs/bridges/Build with Bridges/using-xdai-bridge/troubleshooting.md rename to docs/bridges/Legacy Bridges UI/using-xdai-bridge/troubleshooting.md index a630c9bb..955a0743 100644 --- a/docs/bridges/Build with Bridges/using-xdai-bridge/troubleshooting.md +++ b/docs/bridges/Legacy Bridges UI/using-xdai-bridge/troubleshooting.md @@ -4,6 +4,13 @@ keywords: [troubleshooting, bridge problems, issues, token bridge, gnosis bridge] --- +:::info +The following tutorial is refering to the legacy xDAI bridge. +The new Bridge UI for xDAI bridge can be used in https://bridge.gnosischain.com/, and relevant tutorials can be found in [here](../../Bridge%20Explorer.md). +Please avoid using the legacy xDAI bridge: https://bridge.legacy.gnosischain.com/ +::: + + # Troubleshoot Bridge Issues Bridge transactions can take some time (hours in extreme cases) to complete depending on Ethereum mainnet congestion. Try these actions first if your transaction has been **pending for 10 minutes or more** (and you don't want to wait any more time). Actions differ depending on if you are transferring from xDai to Dai or [Dai to xDai](#dai-to-xdai-transaction-is-taking-a-long-time). diff --git a/docs/bridges/README.md b/docs/bridges/README.md index d3608df2..7630f5c8 100644 --- a/docs/bridges/README.md +++ b/docs/bridges/README.md @@ -4,8 +4,7 @@ title: Intro to Gnosis Bridges keywords: [gnosis bridges, omnibridge, xdai bridge] --- -Welcome to Gnosis Bridges! 🎉 - +Welcome to Gnosis Bridge! 🎉 You can check out Gnosis Bridge here : https://bridge.gnosischain.com/ gno:0xEF138856d0581641A57245Ee5CFfc9ceaA059623 | +| Giveth | 0x839395e20bbB182fa440d08F850E6c7A8f6F0780 | +| KarpatkeyDAO | 0xb8173f558f75EE263013fd6294177bf75279a21e | +| 1Hive | 0x86Da253817DC599059e3AD5A1F098F7b96aBf34c | +| Peerion | 0x1685324Bf373670ad5C9c56bd88A1dc1C063b0f9 | +| 01Node | 0x0101016044726994aFd16f4A99f0d960090D35e7 | +| Cow Protocol | 0xAC0622953d25e1a6c4e0f32Ffc1A9C1cE350B60E | +| Safe | 0xDdf2d07267EAF2cE3E13ee4319bE1F34D55ed992 | +| Agave | 0xc44caeb7F0724A156806664d2361fD6f32a2d2C8 | + +## Governance Process + +### Phase 1: Ideation + +Post created on the Gnosis Forum in the [GnosisDAO](https://forum.gnosis.io/). There is no set duration on how long a proposal stays in this stage. There is no formal requirement for a proposal to pass this stage. However, if a proposal discussion fails to garner momentum from the community, it is unlikely to become a successful proposal. + +### Phase 2: Specification + +[Gnosis Improvement Proposal](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is created. This stage lasts 5 days. For the proposal to pass this stage, one outcome with a relative majority of votes on the forum poll must be achieved. If the relative majority of votes indicates `Make no changes`, the proposal does not pass to Phase 3. + +### Phase 3: Multisig Voting & Execution + +[Gnosis Improvement Proposal](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is refined, and there is a [GnosisDAO Snapshot](https://snapshot.org/#/gnosis.eth) poll. This stage lasts for 7 days. For proposals to be accepted there must be one outcome with a relative majority of GNO used for signaling on the GnosisDAO Snapshot poll accompanied by a yes-voting quorum of a minimum of 4% of the circulating supply of GNO. If the relative majority of GNO used in signaling on the Snapshot poll indicates the result Make no changes, the proposal will not be accepted and considered closed. + +:::info +Check out all the governance decisions in the past in [Governance Decisions](decisions.md)! +::: + + +### Governor: Upgrading a Contract + +There are two possible scenarios for how the bridge or validators contracts can be upgraded: + +- a security fix when only the contract implementation is changed +- an improvement when the contract implementation upgrade requires initialization of storage values. + +1. Deploy a new implementation of the bridge or validators contract. +2. Depending on the contract and the chain, get the current version of the contract implementation. +3. Use the `upgradeTo` method from EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Tools like [ABI Encoding Service](https://abi.hashex.org/) can be useful when it comes to constructing the calldata from ABI. +4. Create the transaction on using [Governor's Safe](README.md#bridge-governor-multisig) and let all the governors sign the message. +5. Once the threshold is reached, execute the transaction. + + +### Governor: Adding/Removing a validator +1. Call `addValidator(address validator)` or `removeValidator(address validator)` in the [Governor's Safe](README.md#bridge-governor-multisig) to add or remove a validator. +2. (Optional) Call `setRequiredSignatures(uint256 _requiredSignatures)` to update the required signatures in order to execute a message. + +### Governor: Setting bridge limits + +Different limits are set for the [xDai Bridge](../Token%20Bridge/xdai-bridge.md#fees--daily-limits) and the [OmniBridge](../Token%20Bridge/omnibridge.md#fees--daily-limits) by the bridge governors. Please see their respective documentation pages for more information. + + +## Bridge Validators + +Bridge Validators monitor events on both sides of the chains to ensure that the user's bridging requests are validated promptly. In the Gnosis Chain, there are both trusted and trustless validators. [Telepathy](/bridges/Token%20Bridge/amb-bridge#how-it-works-with-telepathy-validator), a trustless ZK-based validator on AMB, secures transactions using zero-knowledge proofs, while the rest of the validators sign the message to validate the message. The threshold of signatures from validators has to be reached in order to execute the message on the destination chain. + +- [xDai Bridge Validators](/bridges/management/validators#xdai-bridge) +- [AMB & OmniBridge Validators](/bridges/management/validators#amb--omnibridge) + + + +## Summary of different roles in bridge +- **Governor** role (representation of a multisig contract): + - add/remove validators + - set daily limits on either direction + - set maximum per transaction limit on both bridges + - set minimum per transaction limit on both bridges + - upgrade contracts in case of vulnerability + - set minimum required signatures from validators in order to relay a user's transaction +- **Validator** role: + - provide 100% uptime to relay transactions + - listen for `UserRequestForSignature` events on Home Bridge and sign an approval to relay assets on Foreign network + - listen for `CollectedSignatures` events on Home Bridge. As soon as enough signatures are collected, transfer all collected signatures to the Foreign Bridge contract. + - listen for `UserRequestForAffirmation` or `Transfer` (depending on the bridge mode) events on the Foreign Bridge and send approval to Home Bridge to relay assets from Foreign Network to Home +- **User** role: + - sends assets to Bridge contracts: + - In xDAI bridge: Send DAI token to the Foreign xDAI Bridge to receive xDAI token from the Home xDAI Bridge, send xDAI token to the Home xDAI Bridge to unlock DAI token from the Foreign xDAI Bridge; + - In AMB: Invoke Home/Foreign Bridge to send a message that will be executed on the other chain as an arbitrary contract method invocation; + - In Omnibridge: Approve & relay ERC20 tokens to the Foreign Omnibridge which will interact with Foreign AMB Bridge to mint ERC20 tokens on the Home chain, and transfer ERC20 tokens to the Home Omnibridge which will interact with Home AMB Bridge to unlock ERC20 tokens on Foreign chain. + + + + + diff --git a/docs/bridges/governance/decisions.md b/docs/bridges/management/decisions.md similarity index 99% rename from docs/bridges/governance/decisions.md rename to docs/bridges/management/decisions.md index 7d90188f..911b0b13 100644 --- a/docs/bridges/governance/decisions.md +++ b/docs/bridges/management/decisions.md @@ -1,5 +1,5 @@ --- -title: Decisions +title: Governance Decisions description: The Bridge Governance Board is responsible for enacting updates related to bridge functionality, contract upgrades, and other parameters impacting bridge operations. The following items have been implemented by the board. keywords: [governance board, bridge governance] --- diff --git a/docs/bridges/management/validators.md b/docs/bridges/management/validators.md new file mode 100644 index 00000000..ed06eed6 --- /dev/null +++ b/docs/bridges/management/validators.md @@ -0,0 +1,259 @@ +--- +title: Bridge Validators +description: A bridge validator is an entity responsible for monitoring event emissions from one blockchain, validating the associated logic, signing the validated events, and subsequently invoking the relevant functions on the destination chain to confirm the validation. +keywords: [bridge validator] +--- + +# Bridge Validator + +Unlike bridge governance, a bridge validator in Gnosis Chain is an entity responsible for monitoring event emissions from one blockchain, validating the associated logic, signing the validated events, and subsequently invoking the relevant functions on the destination chain to confirm the validation. + +Bridge validators are formed by different trusted entities such as Gnosis DAO, Safe, etc, and trustless entity such as Succinct Labs Telepathy for AMB. + +## AMB & Omnibridge + +Due to the fact that Omnibridge is built on top of AMB, these two bridges share the same set of validators. + +### Current Bridge Validators + + + + +| GC Address | Organization Name | +| -------------------------------------------------------------------------------------------------------------------------- | ----------------- | +| [gno:0x459a3bd49f1ff109bc90b76125533699aaaaf9a6](https://gnosisscan.io/address/0x459a3bd49f1ff109bc90b76125533699aaaaf9a6) | Protofire | +| [gno:0x105CD22eD3D089Bf5589C59b452f9dE0796Ca52d](https://gnosisscan.io/address/0x105CD22eD3D089Bf5589C59b452f9dE0796Ca52d) | Giveth | +| [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://gnosisscan.io/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | Karpatkey | +| [gno:0xbdc141c8d2343f33f40cb9edd601ccf460cd0dde](https://gnosisscan.io/address/0xbdc141c8d2343f33f40cb9edd601ccf460cd0dde) | GnosisDAO | +| [gno:0x674c97db4ce6cac04a124d745979f3e4cba0e9f0](https://gnosisscan.io/address/0x674c97db4ce6cac04a124d745979f3e4cba0e9f0) | Cow Protocol | +| [gno:0x258667E543C913264388B33328337257aF208a8f](https://gnosisscan.io/address/0x258667E543C913264388B33328337257aF208a8f) | Gnosis Safe | +| [gno:0x90776017057b84bc47D7e7383b65C463C80a6cdd](https://gnosisscan.io/address/0x90776017057b84bc47D7e7383b65C463C80a6cdd) | Gateway | +| [gno:0x456c255A8BC1F33778603A2a48Eb6B0C69F4d48E](https://gnosisscan.io/address/0x456c255A8BC1F33778603A2a48Eb6B0C69F4d48E) | Telepathy | + + + + + +0x725bC6F18F8CDd7f57A9aB9A9f2Ea17A199185e5 +0xb1562173109932146a7fBBF28d7c6652bc2DaACE + + + + + +[0xc9ADb79B8A6e7C6e90c765A3B4d16d81213c9D49](https://gnosisscan.io/address/0xc9ADb79B8A6e7C6e90c765A3B4d16d81213c9D49) + + + + + + +### Omnibridge validator workflow + + +![](/img/bridges/diagrams/amb-bridge-validator-flow.png) + + + +## xDAI bridge + + +The xDAI bridge relies on trusted xDai Bridge Validators as cross-chain bridge oracle. + + + + + +Bridge transactions currently requires signatures from 4 of 7 validators. + +| Organization | Gnosis Address | +| ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | +| GnosisDao | [gno:0x97630e2ae609d4104abda91f3066c556403182dd](https://gnosis.blockscout.com/address/0x97630e2ae609d4104abda91f3066c556403182dd) | +| Protofire | [gno:0x4d1c96b9a49c4469a0b720a22b74b034eddfe051](https://gnosis.blockscout.com/address/0x4D1c96B9A49C4469A0b720a22b74b034EDdFe051) | +| CowProtocol | [gno:0x587c0d02b40822f15f05301d87c16f6a08aaddde](https://gnosis.blockscout.com/address/0x587c0d02b40822f15f05301d87c16f6a08aaddde) | +| Giveth | [gno:0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506](https://gnosis.blockscout.com/address/0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506) | +| GnosisSafe | [gno:0x1312e98995bbcc30fc63db3cef807e20cdd33dca](https://gnosis.blockscout.com/address/0x1312e98995bbcc30fc63db3cef807e20cdd33dca) | +| Karpatkey | [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://gnosis.blockscout.com/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | +| Gateway | [gno:0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6](https://gnosis.blockscout.com/address/0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6) | + + + + + + 0x725bc6f18f8cdd7f57a9ab9a9f2ea17a199185e5 + 0xb1562173109932146a7fbbf28d7c6652bc2daace + + + + + +| Network | Address | +| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Goerli | 0xef35547c29a7547df67ff573c158bf1b74381add(Gateway)
0xda286781cbbc9819c94852885a118c93ed25e064
0x758c277ca1b04da3ba3add5d61cd26337cfafd7e
0xdc3a6044440b75c5cefb023ae2d0e5b9069230cf (Gnosis DAO) | +| Chiado | 0xef35547c29a7547df67ff573c158bf1b74381add(Gateway)
0xda286781cbbc9819c94852885a118c93ed25e064
0x758c277ca1b04da3ba3add5d61cd26337cfafd7e
0x9d84152df06880cdabeb30e10c2985f40d98b901
0xdc3a6044440b75c5cefb023ae2d0e5b9069230cf (Gnosis DAO) | + +
+ + +
+ +### Bridge Validator Flow + +![](/img/bridges/diagrams/xdai-bridge-validator-flow.png) + + +### Resources + +- [TokenBridge Docs: Migrating Oracle to new Server](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-oracle-maintenance/oracle-migration-to-a-new-server) + + + +```mdx-code-block +
+ Setting up GNO bridge validators: Gnosis Chain <->Ethereum +
+``` + + +## GNO bridge validators GC <-> ETH Mainnet + +### How to setup + +1. Checkout https://github.com/dharmendrakariya/chiado-ansible-bridges (yes I know it says Chiado but we use it for mainnet) +2. replace group_vars/amb.yml in https://github.com/dharmendrakariya/chiado-ansible-bridges with following settings: + +```bash + --- + ORACLE_LOG_LEVEL: info + ORACLE_BRIDGE_MODE: "ARBITRARY_MESSAGE" + + COMMON_HOME_RPC_URL: "" + COMMON_HOME_BRIDGE_ADDRESS: "0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59" + ORACLE_HOME_RPC_POLLING_INTERVAL: 15000 + + COMMON_FOREIGN_RPC_URL: "ETH RPC URL NON ARCHIVAL" + ORACLE_FOREIGN_ARCHIVE_RPC_URL: "ETH RPC URL ARCHIVAL" + COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e" + ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 24000 + + ORACLE_TX_REDUNDANCY: true + ORACLE_HOME_TX_RESEND_INTERVAL: 300000 + + COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "eip1559-gas-estimation" + COMMON_HOME_GAS_PRICE_SPEED_TYPE: "fast" + COMMON_HOME_GAS_PRICE_FALLBACK: 2000000000 + ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 + COMMON_HOME_GAS_PRICE_FACTOR: 1 + + COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "eip1559-gas-estimation" + COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "fast" + COMMON_FOREIGN_GAS_PRICE_FALLBACK: 100000000000 + ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 + COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 + + ORACLE_ALLOW_HTTP_FOR_RPC: yes + QUEUE_URL: "amqp://rabbit-amb" + REDIS_URL: "redis://redis-amb" + + ORACLE_HOME_START_BLOCK: 27147951 + ORACLE_FOREIGN_START_BLOCK: 16918880 +``` + +3. replace group_vars/native.yml in https://github.com/dharmendrakariya/chiado-ansible-bridges with following settings: + +```bash + --- + ORACLE_LOG_LEVEL: info + ORACLE_BRIDGE_MODE: "ERC_TO_NATIVE" + + COMMON_HOME_RPC_URL: "" + COMMON_HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6" + ORACLE_HOME_RPC_POLLING_INTERVAL: 15000 + + COMMON_FOREIGN_RPC_URL: "" + ORACLE_FOREIGN_ARCHIVE_RPC_URL: "" + COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016" + ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 24000 + + ORACLE_TX_REDUNDANCY: true + ORACLE_HOME_TX_RESEND_INTERVAL: 300000 + + COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "eip1559-gas-estimation" + COMMON_HOME_GAS_PRICE_SPEED_TYPE: "fast" + COMMON_HOME_GAS_PRICE_FALLBACK: 2000000000 + ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 + COMMON_HOME_GAS_PRICE_FACTOR: 1 + + COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "eip1559-gas-estimation" + COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "fast" + COMMON_FOREIGN_GAS_PRICE_FALLBACK: 100000000000 + ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 + COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 + + ORACLE_ALLOW_HTTP_FOR_RPC: yes + QUEUE_URL: "amqp://rabbit" + REDIS_URL: "redis://redis" + + ORACLE_HOME_START_BLOCK: 27147951 + ORACLE_FOREIGN_START_BLOCK: 16918880 +``` + +4. replaces hosts.yml in https://github.com/dharmendrakariya/chiado-ansible-bridges with + +```bash + all: + children: + oracle: + children: + native: + hosts: + : + ansible_user: + ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "" + amb: + hosts: + : + ansible_user: + ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "" +``` + +5. Install on hosts: + +```bash + - name: Install python3 + apt: + update_cache: yes + name: "{{ item }}" + with_items: + - python3 + - python3-pip + + - name: Install python requirnments + ansible.builtin.pip: + executable: pip3 + name: + - docker + - molecule + - flake8 + state: present +``` + +6. Run in https://github.com/dharmendrakariya/chiado-ansible-bridges, the command should start the service + +```bash + ansible-playbook -i hosts.yml site.yml +``` + +7. Make sure that logs for `oracle-bridge_affirmation-1` contains + +```bash + {"level":30,"time":1679670411723,"msg":"Processing affirmationRequest 0xd2abaafc7359452b6d78631d6ab35571127dbd05ddfcff41784a5e9d29c191e1","validator":"0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6","name":"watcher-erc-native-affirmation-request","eventTransactionHash":"0xd2abaafc7359452b6d78631d6ab35571127dbd05ddfcff41784a5e9d29c191e1","sender":"0xE899161e268C0Be32C7993BB8221480C89B00d4D","value":"500000000000000000000","v":1} + {"level":30,"time":1679670411724,"msg":"Processing affirmationRequest 0xbc6d387ffc1a893eceb123d54e90358a4f83756960bd40410fd4f76c296854d9","validator":"0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6","name":"watcher-erc-native-affirmation-request","eventTransactionHash":"0xbc6d387ffc1a893eceb123d54e90358a4f83756960bd40410fd4f76c296854d9","sender":"0xE899161e268C0Be32C7993BB8221480C89B00d4D","value":"130025433237150000000000","v":1} +``` + +8. After the service is started please use `service poabridge stop|start` in order to shutdown or start the service before making any changes on a host machine + +```mdx-code-block +
+
+``` \ No newline at end of file diff --git a/docs/bridges/roadmap.md b/docs/bridges/roadmap.md index 9bc2bada..a7c8147a 100644 --- a/docs/bridges/roadmap.md +++ b/docs/bridges/roadmap.md @@ -1,17 +1,17 @@ --- title: Bridges Roadmap -sidebar_position: 8 +sidebar_position: 6 description: Gnosis is investing significant resources into trust-minimization of its Bridges, to ensure trust and safety of users. keywords: [bridge roadmap, trustless bridge, light client, zksnark] --- Gnosis is investing significant resources into trust-minimization of its Bridges, to ensure trust and safety of users. -### Hashi - A cross chain protocol based on distributed trust of the underlying security mechanisms +### Hashi - A cross chain protocol based on distributed trust of the underlying security mechanisms 🚧 Hashi, a cross chain protocol based on distributed trust of the underlying security mechanisms Hashi is an EVM Hash Oracle Aggregator designed to enhance cross-chain bridge security by aggregating block headers from various sources. By requiring validation from multiple independent mechanisms, Hashi ensures greater resilience against security incidents. It supports 15+ General Message Passing bridges and ZK light clients, promoting redundancy and reducing reliance on single mechanisms. Integrating Hashi into Gnosis Chain's bridges strengthens security, decentralization, and interoperability. This initiative aims to set a new standard for cross-chain transactions, enhancing user confidence and bolstering the Gnosis ecosystem's security posture. [Check out the proposal](https://forum.gnosis.io/t/gip-93-should-gnosisdao-support-the-integration-of-hashi-within-gnosis-chains-canonical-bridges/8245) . -### Telepathy, zkSNARK-enabled Light Client bridge validator +### Telepathy, zkSNARK-enabled Light Client bridge validator ✅ Succinct Lab's zkSNARK-enabled Light Client, Telepathy, launched in July 2023, has emerged as a key component of the AMB bridge ecosystem. Utilizing zkSNARKs, Telepathy provides validity proofs, ensuring trustless verification of transaction events across chains. This solution has become one of the most active bridge validators in the AMB network, enhancing security and reliability for cross-chain transactions. After successful audits and release, we aim to gradually migrate our canonical bridges to Hashi’s distributed trust model. \ No newline at end of file diff --git a/docs/bridges/usebridges.md b/docs/bridges/usebridges.md index f1707376..83fa3375 100644 --- a/docs/bridges/usebridges.md +++ b/docs/bridges/usebridges.md @@ -4,7 +4,7 @@ title: How to use Gnosis Bridge ? keywords: [gnosis bridges, omnibridge, xdai bridge] --- :::info -To begin using Gnosis Bridge App, you need to go on this following link : https://bridge.gnosischain.com/ +To begin using Gnosis Bridge, you need to go on this following link : https://bridge.gnosischain.com/ ::: :::note diff --git a/docs/bridges/Build with Bridges/using-amb.md b/docs/bridges/using-amb.md similarity index 71% rename from docs/bridges/Build with Bridges/using-amb.md rename to docs/bridges/using-amb.md index 26cbec0e..c05d7e31 100644 --- a/docs/bridges/Build with Bridges/using-amb.md +++ b/docs/bridges/using-amb.md @@ -1,5 +1,6 @@ --- -title: Using the AMB +sidebar_position: 5 +title: Build with Bridges using the AMB description: How to use the Arbitrary Message Bridge keywords: [amb bridge, arbitrary message bridge, using amb, bridge, gnosis bridge] @@ -26,19 +27,7 @@ Below is the list of actions that can be executed in BlockScout and Etherscan, o :::info MetaMask will show a high gas estimate for this transaction. In most cases the final gas consumption will be significantly lower. ::: - -### Goerli and Chiado - -At the moment, the only way to use AMB between Goerli and Chiado is through a smart contract call. - -The process of claiming the message from Chiado to Goerli works similarly to the mainnet, but with a different contract address. - -| Contract | Address | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| AMB Helper Contract (Chiado) | [0xEd0dC0AA8A61c3Ac912072f50c4c5bd830d79E36](https://gnosis-chiado.blockscout.com/address/0xEd0dC0AA8A61c3Ac912072f50c4c5bd830d79E36?tab=read_contract) | -| AMB bridge contract (Chiado) | [0x99ca51a3534785ed619f46a79c7ad65fa8d85e7a](https://gnosis-chiado.blockscout.com/address/0x99ca51a3534785ed619f46a79c7ad65fa8d85e7a?tab=contact_code) | -| AMB bridge contract (Goerli) | [0x87A19d769D875964E9Cd41dDBfc397B2543764E6](https://goerli.etherscan.io/address/0x87A19d769D875964E9Cd41dDBfc397B2543764E6#code) | - + ## Deploying custom ERC-20 Bridge - [Tokenbridge Docs: Deploying custom token bridge on top of AMB](https://docs.tokenbridge.net/eth-xdai-amb-bridge/erc20-to-erc20-extension-linked-with-a-particular-token/deploy-erc20-erc677-erc827-to-erc677-amb-bridge-extension) diff --git a/docs/developers/Usefulcontracts.md b/docs/developers/Usefulcontracts.md index b1239de9..46acedef 100644 --- a/docs/developers/Usefulcontracts.md +++ b/docs/developers/Usefulcontracts.md @@ -40,7 +40,6 @@ The current deployment of xDAI bridge contract is from [tokenbridge-contracts/xd | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | GNO | [0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://gnosisscan.io/token/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb) | | wxDAI | [0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d](https://gnosisscan.io/token/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d) | -| mGNO | [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosisscan.io/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68) | | Deposit contract | [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosisscan.io/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) | ### Gnosis Chain bridge contract addresses @@ -94,7 +93,6 @@ The current deployment of xDAI bridge contract is from [tokenbridge-contracts/xd | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | GnosisBridge(GNO) | [0x19C653Da7c37c66208fbfbE8908A5051B57b4C70](https://blockscout.com/gnosis/chiado/address/0x19C653Da7c37c66208fbfbE8908A5051B57b4C70) | | wxDAI | [0x18c8a7ec7897177E4529065a7E7B0878358B3BfF](https://gnosis-chiado.blockscout.com/address/0x18c8a7ec7897177E4529065a7E7B0878358B3BfF) | -| mGNO | [0xc5be8bf53755a41c2385e7aa86f6a9e28746f466](https://blockscout.com/gnosis/chiado/address/0xc5be8bf53755a41c2385e7aa86f6a9e28746f466) | | Deposit Contract | [0xb97036A26259B7147018913bD58a774cf91acf25](https://blockscout.com/gnosis/chiado/address/0xb97036A26259B7147018913bD58a774cf91acf25) | | Governance Safe | [0x0Ad7de9064BAA98892a244e1415Ca8a2766096D2](https://blockscout.com/gnosis/chiado/address/0x0Ad7de9064BAA98892a244e1415Ca8a2766096D2) diff --git a/docs/faq/Node FAQs/staking.md b/docs/faq/Node FAQs/staking.md index 2c6f68b6..47c34175 100644 --- a/docs/faq/Node FAQs/staking.md +++ b/docs/faq/Node FAQs/staking.md @@ -14,7 +14,7 @@ title: Staking and Liquid Staking 1. **Where can I swap mGNO to GNO?** - Get the full balance in wei by inserting your address in balanceOf on this contract then go to this other contract and use the function "unwrap with _token" and enter 0x722fc4DAABFEaff81b97894fC623f91814a1BF68 and then in "_amount" enter the amount to convert as you go previously + mGNO is deprecated now, you can stake GNO directly 3. **What’s the best place to stake my GNO bag?** @@ -46,7 +46,7 @@ title: Staking and Liquid Staking 10. **Is there any way to stake more than 32 mGNO per validator?** - mGNO is actually deprecated, but the effective balance of your validator cannot exceed 1 GNO (or 32 mGNO) as the exceeding balance will be ready to be claimed as partial withdrawals. + mGNO is actually deprecated, but the effective balance of your validator cannot exceed 1 GNO as the exceeding balance will be ready to be claimed as partial withdrawals. 11. **Rewards for staking are given in GNO, but what happens to the xDai used to pay gas from all transactions on the network? Where does the GNO come from since it isn't used for gas in the transaction?** diff --git a/docs/faq/node.md b/docs/faq/node.md index 0880c475..e12483a8 100644 --- a/docs/faq/node.md +++ b/docs/faq/node.md @@ -152,7 +152,7 @@ As we have modified some specs regarding the withdrawals to enable withdrawing G 11. Where does the automatic balance withdraw to? - In case you are using a legacy withdrawal credential 0x00, it will not be withdrawn and you will have to perform a migration to 0x01 credentials to complete the withdrawal. If you have already configured your withdrawal address and have a withdrawal credential of 0x01, then rewards in excess of 1 GNO (32 mGNO) will be transferred to your withdrawal address. + In case you are using a legacy withdrawal credential 0x00, it will not be withdrawn and you will have to perform a migration to 0x01 credentials to complete the withdrawal. If you have already configured your withdrawal address and have a withdrawal credential of 0x01, then rewards in excess of 1 GNO will be transferred to your withdrawal address. 12. Once I have changed my credential to 0x01, can I change it to an alternative withdrawal address? diff --git a/docs/faq/others.md b/docs/faq/others.md index b26d2a17..f736bcf1 100644 --- a/docs/faq/others.md +++ b/docs/faq/others.md @@ -19,9 +19,7 @@ When you stake your GNO on Stakewise you receive sGNO. -5. What is mGNO? - - To create a more accurate ETH-mirrored environment, a minimum of 32 tokens are used for staking purposes on the Gnosis Beacon Chain. The mGNO token is a metaToken similar to a wrapped token created for this purpose. During deposits, 1 GNO is automatically converted to 32 mGNO. +https://docs.gnosischain.com/faq/others 6. What is LGNO? diff --git a/docs/node/manual/validator/deposit.md b/docs/node/manual/validator/deposit.md index 60c660a5..167b3efe 100644 --- a/docs/node/manual/validator/deposit.md +++ b/docs/node/manual/validator/deposit.md @@ -112,7 +112,7 @@ It will take about 1.5 hours for your validators to start proposing and attestin ## Option 2: Direct interaction with Contracts -A modification to the Gnosis Chain deposit contract allows you to deposit in batches (this functionality is not available for the ETH2 deposit contract). One transaction can be used to initiate deposits for up to 128 validators. The assumption is that every validator deposits 1 GNO(which is converted to 32mGNO) in every entry of the batch. The following script simplifies the process. +A modification to the Gnosis Chain deposit contract allows you to deposit in batches (this functionality is not available for the ETH2 deposit contract). One transaction can be used to initiate deposits for up to 128 validators. The assumption is that every validator deposits 1 GNO in every entry of the batch. The following script simplifies the process. ### Step 1: Get Deposit Script @@ -175,6 +175,66 @@ It will take about 1.5 hours for your validators to start proposing and attestin - This is roughly 1 hour and 25 minutes before the validators start proposing and attesting blocks on the Gnosis Chain. - Once live, you can view your validator(s) on the explorer. Copy the pubkey(s) listed in the deposit_data.json file (a key will be generated for each validator as "pubkey": "<your-public-key>") and paste into the search box at [https://gnosischa.in//](https://gnosischa.in/). +## Option 3: Running Your Own Deposit UI Instance Locally + +### Step 1: Dependencies + +Ensure that you have [NodeJS](https://nodejs.org/en) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) installed. +You can check the installation by running ```node -v``` and ```npm -v``` in your terminal. + +Additionally, install [Next.js](https://nextjs.org/) by running the command ```npm install next```. + + +### Step 2: Download the Deposit UI from GitHub + +Download the Deposit UI files from the corresponding Gnosis Chain [GitHub Repo](https://github.com/gnosischain/gbc-deposit-ui/). Extract the ZIP file to wherever you want to. + + +### Step 3: Edit Configuration Files + +1. Edit the file ```wagmi.ts``` in the ```main project folder```: change the **Mainnet RPC** to ```https://gnosis-rpc.publicnode.com``` on ```line 11``` (you may also choose another RPC, not all work) +2. Edit the file ```fetchEvents.ts``` in the ```utils folder```: change the ```BLOCK_RANGE_SIZE``` to **```10000```** on ```line 6``` (previous value was ```1000000```) + + +### Step 4: Run the UI + +1. Run the UI using the command ```npm run dev``` (in the main folder of the UI); if this doesn't work, it might need to be built or dependencies are missing try something like ```npm install typescript```. +2. Open [http://localhost:3000/](http://localhost:3000/) in your browser, the UI should appear now if it all works correctly. + + +### Step 5: Use the UI +1. Connect your wallet and ensure you are connected on the right network (Gnosis Chain). +2. Ensure that you have an adequate amount of GNO in your wallet to deposit to all pending validators listed in your ```deposit_data.json```. +3. Add your ```deposit_data.json``` file to the UI once you're asked for it. +4. Wait for the UI to load the completed deposits from the external RPC. Please have some patience as the RPC is rate limited. + + +:::tip + +This process will take about 20 minutes. The UI will not show any progress for getting the blocks from the RPC once you've submitted your JSON file. If you use the browser console window (using right-click "Inspect"), you can see the block number going up though. + +::: + + +### Step 6: Send Deposit Transactions + +For each validator in the file, a deposit transaction will be generated and sent to your wallet. Verify the transaction details (closer described in Option 1 above). Once verified, send out the transactions and wait for validator activation. + + +### Step 7: Validator Activation + +:::tip + +It will take about 1.5 hours for your validators to start proposing and attesting to blocks. + +::: + +- Following a successful deposit, the Gnosis Beacon Chain will wait for 1024 Gnosis Chain blocks plus up to 64 Gnosis Beacon Chain epochs before adding validators to the pool. +- This is roughly 1 hour and 25 minutes before the validators start proposing and attesting blocks on the Gnosis Chain. +- Once live, you can view your validator(s) on the explorer. Copy the pubkey(s) listed in the deposit_data.json file (a key will be generated for each validator as "pubkey": "<your-public-key>") and paste into the search box at [https://gnosischa.in/](https://gnosischa.in/). + + + ## Appendix ### Depositing For Chiado Testnet diff --git a/docs/node/rewards-penalties.md b/docs/node/rewards-penalties.md index a18a0476..b8f33670 100644 --- a/docs/node/rewards-penalties.md +++ b/docs/node/rewards-penalties.md @@ -9,7 +9,7 @@ You are responsible for your node, including ensuring uptime, correct behavior, ### Proof-of-Stake - Gnosis (and Ethereum) utilize a Proof-of-Stake cryptoeconomic incentive system to secure the network and disincentivize malicious behavior by nodes. -- Nodes that play an active role in validating the network are required to stake [32 mGNO](../about/tokens/gno.md) (i.e. 1 GNO) per validator. They receive periodic rewards for each epoch that they stay online and performing their duties. +- Nodes that play an active role in validating the network are required to stake [1 GNO ](../about/tokens/gno.md) per validator. They receive periodic rewards for each epoch that they stay online and performing their duties. - However, if they engage in malicious or disruptive activity on the network, their stake gets "slashed", and they can also be permanently removed from the validator pool. - Nodes that go offline also attract a penalty for "inactivity leaks", although these are significantly less harsh if the node is offline only for a short period of time. @@ -95,8 +95,8 @@ The most common "penalty" validators encounter is if they are offline, or are la Gnosis will move into a "inactivity leak" mode, if a large number (i.e. >1/3) of validators are offline at the same time causing the network to not finalize. - "Offline" validators receive increasingly large penalties based on their track records -- This is designed to restore finality by reducing the stake of "offline" validators, who may get ejected from the network if their stake drops below the minimum required (i.e. 16 mGNO or 0.5 GNO) -- While the initial stake is 1 GNO , a validator is allowed to continue validating even after being penalized so long as the stake is above 16 mGNO. +- This is designed to restore finality by reducing the stake of "offline" validators, who may get ejected from the network if their stake drops below the minimum required (i.e. 0.5 GNO) +- While the initial stake is 1 GNO , a validator is allowed to continue validating even after being penalized so long as the stake is above 0.5 GNO. ### Slashings diff --git a/updates/2024/06-12-core-devs-call.md b/updates/2024/06-12-core-devs-call.md new file mode 100644 index 00000000..df78d461 --- /dev/null +++ b/updates/2024/06-12-core-devs-call.md @@ -0,0 +1,121 @@ +--- +title: Core Devs Call - 2024/06/12 +authors: [dapplion, armaganercan, filoozom] +tags: [CoreDevsCall, Gnosis Chain] +--- + +# Gnosis Core Devs Call Notes + +Welcome to the Gnosis Core Devs weekly gathering. Every Wednesday, key members from the Gnosis team, contributors, and various team representatives convene to discuss, collaborate, and update one another on the Gnosis ecosystem's progression. + +Participants represent teams: + +Erigon, Gateway, Nethermind, Geth, Gnosis DevOps, Gnosis Core Devs, Gnosis Comms team. + +With a diverse set of voices present, our discussions are rich, multifaceted, and aim to foster innovation within the community. + +Watch the record [here](https://youtu.be/Zc2XWbj-HRE) + +June 12, 2024 + +# Client Team Updates +## EL + +* **Nethermind**: + * Released an RC with block processing improvements + * Hired a new QA engineer + * Talked with Lion about state testing GC (because Hive tests don’t cover that) + * Could help to prepare those tests + +* **Erigon**: + * Was able to run Erigon v3 on Gnosis up to T-50k blocks + * Running fine, but there might be some issues with block downloading towards the end (might also be a networking issue though) + +* **Geth**: + * Guillaume is sick + +* **Reth**: + * We want to bring reth to Gnosis (there’s also demand from CoW and other projects) + * Reth is close to being considered stable + * Reth is quite extensible, so it might be possible to implement support for Gnosis without having to maintain a fork + * Will require a state snapshot from the merge, so we don’t have to implement AuRa, as this would be significantly more difficult + * Reth doesn’t support snap sync yet + +# Chain Infra + +* **Gateway** + * Updated Erigon to the latest version + +# Testing +* Planning on forking https://github.com/ethereum/tests + * Try to fork it with Nethermind as a generator without modifications + * Should mostly be implemented by Nethermind but wasn’t battle tested + * Maybe we should try generating tests for mainnet and compare them + * Likely some tests will fail, and we can adapt them afterwards +* Is Erigon running POSDAO tests? + * Geth for sure isn’t +* We shouldn’t necessarily assume that passing mainnet tests means that we also pass Gnosis tests, but it might not be reasonable to fork all tests either + * We should adapt some tests at least + * The question is where to draw the line + +# Research + +* EIP-7002 (EL withdrawals) + * On Ethereum the fee is burned, but we don’t want that on Gnosis Chain + * Either we keep the same contract and burn the xDAI, or we do a different contract with a different address (which might be worse UX) + * Burning it shouldn’t be too bad, but it’s not only a “chain revenue” decision, it’s also the fact that the xDAI burned will never be recoverable, which doesn’t really make sense + + +# Innovation + +* Shutter + * All the signatures are now being verified + * Keypers haven’t swapped over to blst yet, but they have test vectors that are working + * Nethermind is feature complete + * Debugging an issue where some transactions are not being included when there’s too many + * Debugging high CPU usage + * Code review is finished + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +