-
Notifications
You must be signed in to change notification settings - Fork 100
Home
Anton Bukov edited this page Sep 5, 2019
·
11 revisions
Welcome to the Near <> Ethereum Bridge wiki!
Initial Bridge discussion started here: https://github.com/nearprotocol/bridge/wiki/Data-Structures
The Bridge should be presented by smart contract based light clients and arbitrary trustless actors who wish to forward necessary data between Near and Ethereum blockchains.
The Bridge API should allow:
- Pass arbitrary data between smart contracts in different chains
- Make arbitrary calls between smart contracts in different chains
The Bridge base projects:
- Fully collaterized NEAR stable token in Ethereum network
- Fully collaterized ETH stable token in Near network
- Smart contract based Ethereum proxy-accounts for Near users
- Smart contract based Near proxy-accounts for Ethereum users
Ethereum smart contract should be Near Light Client
Described necessary data structures at this page: https://github.com/nearprotocol/bridge/wiki/Data-Structures
Helpful links:
- Precompiled contract for Ed25519 signature verification: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-665.md
- Ed25519 signature verification in Solidity (1.2M+ gas each ecmul): https://github.com/javgh/ed25519-solidity
Near smart contract should be Ethereum Light Client
Helpful links:
- Ethereum Light Client https://github.com/ethereum/wiki/wiki/Light-client-protocol
- Ethash validation in Solidity: https://github.com/SmartPool/contracts
- Ethash validation in Near: https://github.com/nearprotocol/near-runtime-ts/blob/a2daf139b7d3ccf29730cfee76fbd27c25e9db38/apidoc/modules/_near_.md#check_ethash
- RLP Decoding in Solidity: https://github.com/hamdiallam/Solidity-RLP
-
Build Near Light Client in Solidity
- Parse Near blocks and transactions/logs
- Group Near blocks into Merkle Trees per epoch
- Verify Near validators signatures
- Verify Near transaction originators signatures
-
Build Ethereum Light Client in Near TypeScript
- Parse Ethereum blocks and transactions/logs (RLP)
- Verify Ethereum transaction originators signatures