decred / atomicswap

On-chain atomic swaps for Decred and other cryptocurrencies.
https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps/
ISC License
507 stars 232 forks source link

How can A receive the DCR and B receive BTC? #85

Closed zhouzhou84 closed 6 years ago

zhouzhou84 commented 6 years ago

Description

A only has the bitcoin address n1Sp6GY2CWVy51EHtBoeSNPYHB7zfXoHAd and B only has the DCR address TsRTbDbF8eHKQZgSLRoQJfrH2hv6U66w4WU ,and the last two steps are "A redeem the 0.1DCR from B, B redeem the 0.1BTC from A", How can they receive other's coin??

jrick commented 6 years ago

Each counterparty provides an address for the coin they want to receive to the other counterparty. These addresses are included in the contract such that the private key of the address, and the secret, is necessary to redeem the contract output in the normal redemption path (no refund).

zhouzhou84 commented 6 years ago

But if I send 1BTC and want to receive 1DCR, which address can I check if I receive the1DCR, and if I want to use this 1DCR to transfer, how can I do? On 2018-08-13 21:11 , Josh Rickmar Wrote: Each counterparty provides an address for the coin they want to receive to the other counterparty. These addresses are included in the contract such that the private key of the address, and the secret, is necessary to redeem the contract output in the normal redemption path (no refund). — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jrick commented 6 years ago

Please (re)read the README, you seem to be still be confused about how this works. The swap does not occur with funds being sent directly to any P2PKH address (n for bitcoin testnet, and Ts for decred testnet). Instead, payments are made into contract outputs that both parties are able to redeem, and when the participant's contract output is redeemed, the secret is revealed by the initiator and the participant party is able to redeem from the initiator's contract. If you are using a block explorer, you should watch for that contract output being spent, not that funds arrive at any address.