decred/atomicswap

How can A receive the DCR and B receive BTC?

zhouzhou84 opened this issue · 3 comments

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

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).

jrick commented

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.