Atomic crosschain interchange transactions (Bitcoin-Ethereum)

Lykke is semi-centralized exchange that means that matched trades are lodged on a blockchain (Bitcoin or Ethereum). A single trade inbetween two parties is a interchange of two kinds of assets inbetween those two parties. See more about Lykke Ethereum integration here Lykke is integrating Ethereum

The following assets can be exchanged:

1. Assets interchanges on the Bitcoin blockchain

  • Colored coins interchanges
  • Colored coin vs Bitcoin exchanges

Two. Assets interchanges on the Ethereum blockchain

  • Ethereum Tokens exchanges
  • Ethereum Token vs Ether exchanges

Trio. Crosschain interchanges

  • Bitcoin vs Ether exchanges
  • Bitcoin colored coin vs Ether exchanges
  • Ethereum token vs Bitcoin interchanges

Crosschain exchange assumes that Alice transfers asset to Bob on the Bitcoin blockchain and at the same time Bob transfers another asset to Alice on the Ethereum blockchain. Such two transfers should be made te trustless way &ndash, exchange voorwaarde be atomic operation (see more Atomic cross-chain trading).

Proof-of-concept for Crosschain interchanges is required to be implemented. There are the following scripts should be covered:

Script I. Bob pays very first

1. Bob&rsquo,s transfer on Ethereum is based on a wise contract protected with a hash H calculated from Bob&rsquo,s secret preimage R. Alice can redeem Bob&rsquo,s payment only by providing secret R. Bob&rsquo,s transfer to Alice can be canceled if it is not redeemed by Alice during 48 hours.

Two. Alice&rsquo,s transfer is a bitcoin HTLC transaction that has the following output

  • Bob&rsquo,s signature and secret preimage R which hashes to revocation hash H
  • Alice&rsquo,s signature and OP_CHECKSEQUENCEVERIFY <,24 hours>,

Trio. Bob redeems the HLTC during 24 hours and exposes his secret R. Otherwise Alice can get hier coins back.

Four. Alice should redeem Bob&rsquo,s payment with providing exposed secret R into clever contract. Otherwise Bob can cancel his clever contract payment.

Script II. Alice pays very first

1. Alice generates secret preimage R and calculates public hash H. Alice transfers assets with bitcoin HTLC transaction that has the following output

  • Bob&rsquo,s signature and secret preimage R which hashes to revocation hash H
  • Alice&rsquo,s signature and OP_CHECKSEQUENCEVERIFY <,48 hours>,

Two. Bob transfers assets to Alice using Ethereum wise contract protected with a Alice&rsquo,s public hash H. Bob can cancel the clever contract transfer if it is not redeemed by Alice during 24 hours.

Three. Alice can redeem Bob&rsquo,s payment by providing secret R into contract. Bob gets clever contract event notification exposing Alice&rsquo,s secret R to Bob.

Four. Bob should redeem Alice&rsquo,s bitcoin HTLC payment with exposed R during 24 hours. Otherwise Alice can get hier coins back.

Toneelpodium preference

Very recommended that Bitcoin part would be implemented on C# using NBitcoin. Ethereum part would be implemented on C# using Nethereum.

Linksaf

Current version of Ethereum contracts for tradable tokens on Lykke exchange:

Related movie: How to specie out Bitcoin Litecoin and Ethereum


Leave a Reply