New smart contract interaction flow

Objective: design and implement new update Incognito committee flow in smart contract for portal application

Length: 2 months
Resources: @duybao

Key results:

  • Smart contract interaction (@) -
    ** Design new flow by 12 June
    ** Implement new flow by 30 June
    ** Deploy on testnet by 30 July
    ** Improve contract deployment process
    ** Update smart contract with new staking flow
    ** Deploy mainnet (expect mid Oct)


– The new flow of consensus requires us to validate the finality of block, which also need to validate at smart contract side. We will also solve this issue in this proposal. The smart contract need to update committee, or execute any withdraw action if and only if block is finalized.


June update

The development phase includes 3 stages:

  1. Update block structure and blockchain’s storage to include finality proofs
  2. Update current Ethereum smart contracts to verify those proofs
  3. Optimize smart contract flow to reduce gas usage (since verifying finality would at least triple the gas consumption compare to previous versions)

For June, the new flow was presented and approved by core team members. Implementation of the first phase has also been concluded and we are testing it locally.

For July, we will implement the 2nd phase and deploy on devnet/testnet.
While the 1st and 2nd phase are being tested by QC, we will implement the 3rd phase (since it’s an optimization, it won’t affect the correctness of the solution).

Check out the code here:


July update

The development process is on track for the 2nd phase.
The current bridge’s smart contracts require 3 updates to accommodate the new consensus finality of Incognito chain:

  1. Receive and store the finality proofs (validators’ signatures aren’t enough anymore since the chain can be forked)
  2. Verify the finality proofs when the list of validators changes
  3. Verify the finality proofs when receiving a withdrawal request

The first 2 tasks had been finished and the 3rd one will be done this week. The rest of the time of this proposal will be dedicated toward optimizing the gas usage.

Take a look at the code here:


July update #2

There’s a change of plan: we are going to ship a new validator’s staking flow in October that would require another update to the smart contracts. If we stick to the current plan, we would have to deploy the contracts in Sept and redoing it once again in Oct. The deployment process is tedious and has some inherent risks. Therefore, we decided to:

  1. Scrap the Sept deadline
  2. Update the smart contracts in accordance with the new staking flow (again?, FML…)
  3. Improve the contract deployment process (no need to move $2.5M every time we make an update)
  4. Test and deploy on mainnet in mid Oct

August update

We decided to speed things up (because of the increased in Ethereum’s gas price) and we’re going to deploy the contract on August 28.
The implementation is being reviewed and tested right now.


August update 2

With the ongoing hike of Ethereum’s gas price, the process of syncing the list of validators to Ethereum becomes too costly to maintain. As explained in this post, the validators of the Beacon + Shard 1 need to be send to Ethereum to maintain the bridge between the 2 blockchains.

Therefore, we updated the contracts to keep only the validators of the Beacon since this list is rarely updated. This would save us 20-30 ETH/month (with the current gas price) while still maintaining the underlying security model.

All development has finished and the code is being tested on testnet right now. Instead of the previous mentioned date (August 28), we decided to test it more thoroughly and we will deploy it on mainnet in September. When it is finally gone live, we will make a final update to this proposal.


Hi, we’re going to upgrade the Incognito contract to reduce cost for the Ethereum bridge tomorrow (Sep 16th) as planned. The user will benefit from this by paying lower unshield fees as well as decreasing failure rate, especially, in the hike of Ethereum’s gas price. The upgrade also contains logic for solving Incognito chain’s fork situation, this is a preparation step for the chain’s next iterations in the future.

An official announcement will be sent out by the CS team very soon. Thanks.