Peace Relay is a system of smart contracts that aim to allow for cross-EVM-chain communication using relay contracts.
These contracts will be able to verifiy merkle-patricia proofs about state, transactions, or receipts within specific blocks.
This, along with the wonderful Ethash verification work done by SmartPool, allows for trustless cross chain transfers of all tokens on any EVM chain. This implementation uses the merkle-patricia proofs implemented by Zac Mitton.
Some important notes:
PeaceRelay
contract so then other proofs like transaction proof or account state proof can be verified based on merkle roots in block header. Right now in the early stage of Peace Relay we assume the block header submitted is the correct header from counter chain. In the future, these headers will be verified based on PoW within and chain re-organization will be taken care of.How it works step by step:
PeaceRelay
contracts deployed on both ETH and ETC, ETCLocking
contract deployed on ETH and ETCToken
contract deployed on ETC. PeaceRelay
contract stores block headers. ETCLocking
contract locks/unlocks the ethers in ETH. ETCToken
contract mints/burns tokens in ETC.
PeaceRelay
contract on both ETH and ETC and submits headers into the contract
PeaceRelay
contract on ETC and vice versaETCLocking
on ETH and ETCToken
on ETCETCLocking.lock
function along with amount of ethers to lock
ETCLocking.lock
function, there's no way this function will abort(throw) unless no enough gas is provided for execution, so in order to make sure that ethers did get locked in we require that transaction sender must provide with enough amount of gasETCToken.mint
function provided with proof from step 5
ETCToken.burn
to burn the tokensETCLocking.unlock
function provided with proof from step 7 to unlcok ethers