# Understanding Gnosis Chain (formerly xDai)

Author: Markus Waas

Published: 2020-09-26T21:33:06.000Z

Updated: 2026-09-13T14:25:30.000Z

Source: [https://soliditydeveloper.com/xdai](<https://soliditydeveloper.com/xdai>)

## Compatibility and review

Before you start

Historical 2020 xDai tutorial. The network is now Gnosis Chain and has used proof of stake since December 2022. Mainnet remains chain ID 100; Chiado is the testnet. Current bridge deposits use the maintained USDS workflow, not the old direct-transfer addresses. Truffle examples have not been rerun.

[Official reference](<https://docs.gnosischain.com/about/networks/mainnet>)

Gas costs are exploding again, ETH2.0 is still too far away and people are now looking at layer 2 solutions. Here's a good overview of existing layer 2 projects: [https://github.com/Awesome-Layer-2/awesome-layer-2](<https://github.com/Awesome-Layer-2/awesome-layer-2>). Today we will take a closer look at [xDai](<https://www.xdaichain.com/>) as a solution for your Dapp.

**Historical context:** The name and consensus design below reflect 2020. The network is now Gnosis Chain and [completed its move to permissionless proof of stake on December 8, 2022](<https://docs.gnosischain.com/about/specs/hard-forks/merge>). It uses GNO for staking and xDai for gas; the old STAKE/POSDAO description is historical.

### What are sidechains?

Sidechains are generally EVM-compatible, separate blockchains with their own consensus models. xDai is moving towards a Proof-of-Stake mechanism using their own STAKE token on the Ethereum mainnet. Sidechains are designed to easily allow transfer of value and arbitrary state with the Ethereum chain.

+ allow you to run fully functioning smart contracts
+ arbitrary data exchange with mainchain

- security relies on small set of nodes in the sidechain
- not suitable for extremely high-value applications

## Why xDai

![Eggs](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/625534b0ee435802/aeadaf3f5774/v/93153fb2b033/eggs.jpeg>)

![DAI](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/b736a2f28d5272d3/49519d92fdc4/xDai.svg>)

**Historical context:** The following authority-validator discussion describes the old xDai setup. It does not describe the current Gnosis proof-of-stake validator set or its geographic distribution.

You may have heard about xDai especially given the high current gas prices. It's a working mainnet deployed sidechain focusing on simplicity and using the stable coin DAI as underlying main currency. The current implementation is still a PoA ([proof of authority](<https://en.wikipedia.org/wiki/Proof_of_authority>)) chain with selected and trusted, public validators [based in the United States](<https://medium.com/poa-network/introducing-oracles-network-864d1d7e37e2>).

The biggest advantages of xDai are the 3 **S**:

### 1. Simplicity

For a new application, choose [Gnosis mainnet or Chiado testnet](<https://docs.gnosischain.com/tools/wallets/metamask>) and use the corresponding RPC, chain ID and gas token. To bridge assets, use the current [Gnosis bridge workflow](<https://docs.gnosischain.com/bridges/About%20Token%20Bridges/xdai-bridge>). The older POA Network wallet/bridge instructions are historical.

### 2. Stable

Since we are using xDai as native currency, this will be used to pay for all gas costs as well. In contrast to ETH, this means we have a stable base currency to pay the very low transactions costs.

Win win.

### 3. Support

Most of the times tools only support the Ethereum mainnet and maybe 1-2 testnets. However with xDai, you get support for example from:

[TheGraph](<https://www.xdaichain.com/for-developers/developer-resources/thegraph-data-indexing>): An extremely useful tool to query blockchain data, see my previous tutorial [here](<https://soliditydeveloper.com/thegraph>).

[Blocknative](<https://www.xdaichain.com/for-developers/developer-resources/blocknative-notifications>): Transaction status service.

[AnyBlock](<https://www.xdaichain.com/for-developers/developer-resources/api-and-sql-access>): Blockchain analytics service.

### Existing projects on xDai

But not only that, many projects are also deploying their contracts now on xDai, check out existing projects [here](<https://www.xdaichain.com/about-xdai/project-spotlights>). Some highlights include:

- [Gnosis](<https://gnosis.io/>): xDai and Gnosis [started a partnership](<https://blog.gnosis.pm/gnosis-protocol-and-xdai-partnership-1de0e48fb14b>) just days ago. You can find their core protocol and multisigs deployed on xDai.
- [KickBack](<https://medium.com/wearekickback/kickback-x-the-three-experimental-new-features-bb75e1149022>): Event Management and RSVP accountability
- [HoneySwap](<https://honeyswap.org/#/swap>): Uniswap v2 Fork
- [RealityCards](<http://xdai.realitycards.io/>): NFTs for prediction voting

## How to deploy to xDai

Deploying to the xDai sidechain is very simple. If you're using Truffle, simply add the xDai network configuration like this:

```javascript
// Legacy Truffle configuration. HDWalletProvider and mnemonic are defined by the surrounding project.
module.exports = {
  networks: {
    gnosis: {
      provider: () => new HDWalletProvider(mnemonic, "https://rpc.gnosischain.com"),
      network_id: 100,
    },
  },
};
```

You'll also need funds in the sidechain of course, see further below on how to use the bridge.

### Wrapped xDai

xDai is the native currency in the xDai sidechain, like ETH is for Ethereum. In some cases you might want to continue using DAI as ERC-20. If so, simply [wrap it](<https://www.xdaichain.com/for-developers/developer-resources/wrapped-xdai>) as wxDai using the [WRAPETH](<https://wrapeth.com/>) tool.

## Onboarding users

### MetaMask

Chain ID `100` is **Gnosis mainnet**, not a testnet. The test network is **Chiado**, chain ID `10200`. Use the [official wallet settings](<https://docs.gnosischain.com/tools/wallets/metamask>) to choose the correct network.

![xDai MetaMask](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/bc13ab135e113293/aba72f2af437/v/711a9a84d6d6/xDai-MetaMask.png>)

### Value transfer from and to sidechain

#### 1. Getting the native xDai

The old direct-transfer instructions and addresses have been withdrawn. The maintained [Gnosis xDai Bridge documentation](<https://docs.gnosischain.com/bridges/About%20Token%20Bridges/xdai-bridge>) now specifies USDS as the default Ethereum-side deposit asset and a bridge-contract workflow. Sending a token directly to an address copied from this old article is not that workflow.

Open the bridge through the official documentation, select the intended source and destination networks, and review its current supported assets and deposit requirements.

![xDai Bridge](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/20bd2153617b8d49/0924f457ada2/v/26cf87085a72/xdai-bridge.png>)

#### 2. Moving ERC-20 and other tokens

For other supported assets, the current unified bridge interface and Omnibridge information are linked from the [Gnosis bridge documentation](<https://docs.gnosischain.com/bridges/About%20Token%20Bridges/xdai-bridge>). Asset support and transfer requirements can differ from the native xDai bridge.

![xDai Token Bridge](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/6c64f079e563059f/9179af009f0e/v/9c66f4279ea2/xdai-tokenbridge.png>)

#### 3. Arbitrary data transfer

Of course you can also transfer arbitrary data. There is naturally no UI for this, you will need to [call the contracts directly](<https://docs.tokenbridge.net/amb-bridge/how-to-develop-xchain-apps-by-amb>).

## The Future with POS

**Historical context:** This roadmap was written in 2020. Gnosis completed its proof-of-stake transition in 2022; the plans for STAKE and POSDAO below should be read as project history.

xDai is [transitioning towards POS](<https://www.xdaichain.com/for-stakers/stake-and-staking>). They implemented a POSDAO system which is using a DAO to find consensus and using Randao for its randomness. Randao is essentially a commit-reveal scheme, see [here](<https://soliditydeveloper.com/2019-06-23-randomness-blockchain>). You can find the complete POSDAO whitepaper at [https://forum.poa.network/t/posdao-white-paper/2208](<https://forum.poa.network/t/posdao-white-paper/2208>). The next phase of staking is currently actively in development. You can now start staking your STAKE at [https://easy-staking.xdaichain.com/](<https://easy-staking.xdaichain.com/>).

Given the underlying Randao, you will also be able to use this to get [on-chain randomness](<https://www.xdaichain.com/for-developers/on-chain-random-numbers>). Once again I wouldn't use this for billion dollar projects, see the reasoning [here](<https://soliditydeveloper.com/2019-06-23-randomness-blockchain>) for last-revealer problem. But it's nevertheless a great addition for when it's good enough.

## Layer-2 solutions

With the rise of gas prices we will see more and more support for layer 2. It will be up to us developers to actually drive adoption and make this a reality. We have stayed comfortably on layer 1 together for too long.

![Stanley Twitter Layer-2](<https://cdn0.scrvt.com/b095ee27d37b3d7b6b150adba9ac6ec8/72cc6144dbbcbe38/1a9b81ecb1a4/v/f211b5c09a7c/stanley-aave-l2.png>)

Have you used xDai before? Maybe even on Mainnet? There are also [grants opening](<https://www.xdaichain.com/for-developers/grants/xdai-adoption-fund>) again soon that you might want to check out. Or what other layer-2 solutions did you look at or would be interested to hear about next? Please let me know in the comments.
