As per community consensus and the previous discussions we had on our forum and community calls, we will be implementing EIP1559 as per the Ethereum spec https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md and burning baseFee
Matic tokens on every block.
Our implementation of EIP1559, with the plan to go live on Mumbai Testnet next week, is as follows.
Burn Implementation
Since MATIC is an ERC20 token on Ethereum (L1), the logic for burning the base fee had to be implemented in such a way that the tokens are actually burnt on the root chain and not just on the Polygon PoS chain (L2). Below is a high-level overview of the implementation:
On the Polygon chain, there is a burn contract deployed at https://mumbai.polygonscan.com/address/0x70bcA57F4579f58670aB2d18Ef16e02C17553C38 where all the base fees from txs get transferred to. On the child chain, this contract only has the withdraw()
method enabled and a receive()
function to receive MATIC.
You can check the implementation here: https://github.com/maticnetwork/eip-1559-burn/blob/master/contracts/EIP1559Burn.sol
The withdraw
method can be called by any address. Calling withdraw
on the Polygon chain ensures that the accumulated amount (all the baseFee
from different txs until that point) is burnt on the Polygon chain. Next, this needs to be burnt on the Ethereum chain.
On Ethereum, the contract is deployed at the same address https://goerli.etherscan.io/address/0x70bcA57F4579f58670aB2d18Ef16e02C17553C38. This is achieved by deploying the contract from a single account with the same nonce on both chains. After a checkpoint since the withdraw
tx, the initiateExit
method on the L1 burn contract is called which takes the predicate address and the burn proof as arguments. After waiting for the exit period, the exit
method will be called which finally burns the ERC20 tokens on Ethereum by transferring them to 0x000000000000000000000000000000000000dEaD
. Again, the methods can be called by any account on the Ethereum chain as well.
Here is a visual representation of the same:
We will add UI to initiate the burn process on our wallet very soon.
Rollout on Mumbai Testnet
We will hit the London Block where the EIP1559 and related EIPs will be activated on the testnet around 8AM UTC on Dec 14th 2021: https://mumbai.polygonscan.com/block/countdown/22640000
Since this is a hardfork, a genesis update will be required. Please follow the steps below to ensure your Mumbai Testnet nodes continue to sync after the London Block.
Please note that this is applicable only to the Mumbai Testnet.
Steps for Upgrading Bor on Mumbai Testnet Nodes
- Stop the bor service
sudo service bor stop
- Navigate to bor directory
cd ~/bor
- Fetch the latest changes and use Bor v0.2.13-beta1:
git fetch
git checkout v0.2.13-beta1
- Build latest changes
make bor-all
- Download the latest genesis file. We are activating the fork and burn contract address through the updated genesis.
curl https://raw.githubusercontent.com/maticnetwork/launch/6798732cc9f326a238c00ae9e13c3e86819f5a89/testnet-v4/sentry/sentry/bor/genesis.json --output ~/genesis.json
- Init bor with genesis file
bor --datadir ~/.bor/data init ~/genesis.json
If you are using a non-default datadir
, please ensure you input the correct one you have been using.
- You should see the output as follows:
...
...
INFO [12-10|19:57:02.531] Successfully wrote genesis state database=chaindata hash=...
...
INFO [12-10|19:57:02.556] Successfully wrote genesis state database=lightchaindata hash=...
...
...
- Start the bor service
sudo service bor start