Giter Site home page Giter Site logo

atomiccrosschainswaps's Introduction

CrossAtomicChainSwaps

Experimental implementation of several different cross chain atomic swaps

workshop slides can be found at: https://docs.google.com/presentation/d/1v2pJ5A90hEDm7kPlvFesA6z0LAYHrx0cUSVHkJMBBhM/edit?usp=sharing

HTLC Hash TimeLock Contracts:

    1. Alice HTLC on Chain 1 (simple contract creation with parameters, like : 0x14723a09acff6d2a60dcdf7aa4aff308fddc160c, "0x558FA4A7D00B6EC794475955E49AE6C4732A2E7F6EC4C251718C68CA68619338", 1 )
    1. Bob HTLC on Chain 2
    1. Simplified HTLC in ethereum
    1. ERC 1630 Ethereum proposal for standard HTLC: ethereum/EIPs#1631
    1. Asset transfer contract on chain 2 transferring the ownership of Bob's house
    1. Time patched solidity contracts for demo

Simple atomic swap protocol with HTLC for money transfer

  1. Alice creates hash and digest and agrees in expiration time with Bob
  2. Alice deploys AliceHTLC_Chain1 contract on chain 1 and transfers money to the contract (meaning that the money has been conditionally transferred to Bob)
  3. Bob deploys BobHTLC_Chain2 on chain 2 and transfers money to the contract (meaning that the money has been conditionally transferred to Alice)
  4. Alice claims her money from Bob on chain 2 unveiling the secret by calling the BobHTLC_Chain2 contract.
  5. Bob see the secret key, so he can claim his money from Alice on chain 1 by calling the claim function of the AliceHTLC_Chain1 contract with the secret.

Creating test scenario like with the following parameters: AliceHTLC_Chain1: 0x14723a09acff6d2a60dcdf7aa4aff308fddc160c, "0x558FA4A7D00B6EC794475955E49AE6C4732A2E7F6EC4C251718C68CA68619338", 1 BobHTLC_Chain2: 0xca35b7d915458ef540ade6068dfe2f44e8fa733c, "0x558FA4A7D00B6EC794475955E49AE6C4732A2E7F6EC4C251718C68CA68619338", 1

Simple atomic swap protocol with HTLC for asset exchange

  1. Alice creates hash and digest and agrees in expiration time with Bob
  2. Alice deploys AliceHTLC_Chain1 contract on chain 1 and transfers money to the contract (meaning that the money has been conditionally transferred to Bob)
  3. Bob deploys BobHouse_Chain2 on chain 2 and initiates the house transfer by calling the initializeHouseTransfer function that conditionally transfers the house to Alice
  4. Alice claims the house from Bob on chain 2 unveiling the secret by calling the BobHouse_Chain2 contract.
  5. Bob see the secret key, so he can claim his money from Alice on chain 1 by calling the claim function of the AliceHTLC_Chain1 contract with the secret.

Simple multihop payment routing

  1. Alice creates hash and digest and agrees in expiration time with Bob
  2. Alice deploys AliceHTLC_Chain1 contract on chain 1 and transfers money to the contract (meaning that the money has been conditionally transferred to Bob)
  3. Bob deploys BobHTLC_Chain2 on chain 2 and transfers money to the contract (meaning that the money has been conditionally transferred to Charlie)
  4. Alice reveals the secret to Charlie
  5. Charlie claims her money from Bob on chain 2 unveiling the secret by calling the BobHTLC_Chain2 contract.
  6. Bob see the secret key, so he can claim his money from Alice on chain 1 by calling the claim function of the AliceHTLC_Chain1 contract with the secret.

atomiccrosschainswaps's People

Contributors

daniel-szego avatar danielszego 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.