GithubHelp home page GithubHelp logo

nutinaguti / night-bridge Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 2 MB

๐ŸŒ™ Bridge between NEAR Protocol and Ethereum based on LogsBloom

Home Page: https://night-bridge-front.vercel.app/

Shell 2.84% Rust 97.16%
near-protocol bridge ethereum rust web3 p2p

night-bridge's Introduction

Night Bridge

This is my educational project to better understand how the Ethereum and NEAR Protocol works. The essence of the project is to create a trustless bridge between two chains.

! ! ! Yes, I understand that the Bloom Filter is a probabilistic data structure and there is a chance of a false positive test result, but firstly, I considered the probability of such a response to be extremely small, and secondly, this is a training project and I strongly do not recommend using this principle in production ! ! !


The bridge consists of four parts:

Contracts

Currently Ethereum and NEAR smart-contracts deployed in testnet (Goerly and Testnet).

Contract Address Description
FunCoin ETH: 0x918DD8e3F443C1a8535d0F6F266EC20E3a9329e2
NEAR: dev-1669803669965-75235193778699
ERC-20 token
Lite Node NEAR: dev-1669804361266-30686725939679 Smart-contract storing Logs Bloom
Bridge ETH: 0x9431f9bba577B037D97ad6F7086a00eFB572c871
NEAR: dev-1669803549073-25511761548859
Smart-contract validating the transer

How it's work

  1. The oracle receives block headers from Ethereum and takes only the bloom filter from there. Next, the oracle loads this data into the Lite Node contract in NEAR.
  2. The user accesses the Ethereum smart contract and blocks his tokens there. At this moment, a new event is created in the smart contract function, which contains a hash of three values: block number, user address, and the number of tokens.
  3. The user accesses the smart contract in NAP to get their tokens, and provides the hash generated in the event as proof of the locked tokens.
  4. The smart contract checks for the event by three parameters in the bloom filter, and if the proof is valid, mint the specified number of tokens to the user's address.

Known issues and roadmap

  • Build an Oracle
  • Implement sending tokens from Ethereum to NEAR
  • Implement sending tokens from NEAR to Ethereum
  • Gas optimisations
  • Web 2.0 frontend

Any suggestions and comments are welcome

night-bridge's People

Contributors

nutinaguti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

night-bridge's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.