GithubHelp home page GithubHelp logo

ggichuru / atomiccrosschain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daniel-szego/atomiccrosschain

0.0 0.0 0.0 58 KB

Demo atomic cross-chain swap between ethereum and Hyperledger Fabric

Shell 61.02% Go 29.71% Solidity 9.28%

atomiccrosschain's Introduction

Demo Atomic Cross-chain swap between Ethereum and Hyperledger Fabric

  • Ethereum: simple HTLC smart contract for transferring ether from Alice to Bob

    • deploy contract, paramers, revipient, hashlock, timelock in Unix epoch
    • commit: password: finalizing the transfer
    • reverting: if timelock is active, the transfer can be reverted to Alice
  • HLF: Hyperledger Fabric, simple value transfer between Bob and Alice and a HTLC implementation of the value transfer

    • MintToken: minting token to an account
    • Balance: balance token of an account
    • BurnToken: burning token from an account
    • Transfer: normal transfer, transferring from one account to another one
    • TransferConditional: transferring conditional with timelock and hashlock
    • Commit: finalize transfer with the password
    • Revert: revert the password

Atomic Cross-chain swap steps:

  1. Alice creates a secret passwords and creates a sha256(password) hash of it

  2. Alice sends sha256(password) to Bob, Alice abd Bob agress on a t timelock

  3. Both Alice and Bob create HTLC with sha256(password) and t timelock. Alice on Ethereum, Bob on Hyperledger Fabric

  4. Alice Commit the transaction on Hyperledger Fabric, so she gets the HLF token and reveals the "password"

  5. As the "password" is committed, Bob see it and he can commit the transaction on Ethereum, so he can get the ether.

+1. If the transaction is not committed by Alice in step 4, after the timeout explires, all parties can revoke the transactions

atomiccrosschain's People

Contributors

daniel-szego avatar

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.