Atomic swap cryptocurrency protocol. Live version here: https://swap.online. Atomic swap library at http://github.com/swaponline/swap.core.
- Clone swap.core to same directory where
swap.react
is
swap.core/...
swap.react/...
- Do
npm i
cd swap.react
npm i
- For dev mode
npm run start
, for prodnpm run build
npm run start
BTC -> ETH
Alice wants to sell BTC and buy ETH, Bob instead wants to sell ETH and buy BTC.
- Alice creates order for 1 BTC -> 10 ETH
- Bob pushes a 'Buy' button in the orders list and is redirected to /swaps/eth-btc/:id page.
- Alice is notified about Bob and is redirected to /swaps/btc-eth/:id page.
- Alice is asked to create a 'Secret Key'.
- The system automatically generates the 'Secret Hash', shows it to Alice and sends to Bob.
- The system automatically calls the ETH Swap contract method to create a swap.
- The system asks Bob to sign the transaction (Bob fund the ETH Swap contract here).
- The system automatically creates a BTC Swap script.
- Alice is notified that Bob fund the ETH Swap contract. The system asks Alice to fund the script (Alice fund the script here).
- Bob is notified that Alice fund the script.
- The system automatically sends the ETH Swap contract address to Alice and the script to Bob.
- Alice signs a call to the ETH Swap contract to withdraw ETH.
- Bob is notified that Alice did withdraw. Bob signs a call to the ETH Swap contract to receive the secret.
- Bob signs the BTC script method to withdraw 1 BTC.