decred / atomicswap

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

add ethatomicswap and Ethereum AtomicSwap smart contract #76

Open GlenDC opened 6 years ago

GlenDC commented 6 years ago

Closes #74:

Documented a full TFT-ETH (testnet) atomic swap walkthrough. You can find the documentation here: https://github.com/threefoldfoundation/tfchain/blob/master/doc/atomicswaps/defaultethatomicswap.md

As part of creating this example I made the first testnet TFT-ETH atomic swap:

jmozah commented 6 years ago

@GlenDC The documentation link is not working.

GlenDC commented 6 years ago

@GlenDC The documentation link is not working.

Sorry @jmozah, this PR is very old. Still very eager to get his merged into master though.

Updated the link to the documentation for you. The document is now already living in master of our tfchain repo.

jmozah commented 6 years ago

Thanks @GlenDC. Any reason why this was not merged?

GlenDC commented 6 years ago

You should ask the @decred maintainers. I haven’t received any feedback on this PR. They and community seemed enthusiastic in the initiator issue #74, but haven’t heard anything from anyone since.

jrick commented 6 years ago

Nobody has tested or reviewed this, and I don't have the ability to do so without taking time off other projects to learn solidity.

jrick commented 6 years ago

Thinking about this some more, I feel that a more Linux-like approach would be good here, where individual maintainers all maintain their own subprojects in the tree rather than one single party being responsible for everything. This is already how the repo is structured, but we just haven't been very clear about maintainer responsibilities before.

In other words, all 3rd party tools are not "official Decred" tools but are contributions from the community and the Decred project is not able to take responsibility for each of them. We will still try to fix obvious problems where we can (like the security fix done by #59) but for radically different tools such as this one, we will have to defer to you as the maintainer.

Sound good?

jmozah commented 6 years ago

@jrick Thanks for your response. I came here to build something like this and i see this PR already done. I feel this is a important missing piece. @GlenDC I can test and review this PR if you are ok.

GlenDC commented 6 years ago

Thinking about this some more, I feel that a more Linux-like approach would be good here, where individual maintainers all maintain their own subprojects in the tree rather than one single party being responsible for everything.

Sounds like a sensible approach indeed. I wouldn't mind being the maintainer for ethatomicswap for the time being. I'm not sure how you want to do it. Do you want to grant me also access to the repo so I can merge changes for the subprojects I own, or how would you want to do that @jrick?

Will take your feedback into account later this week @jrick, for now I'm recovering and on sick holiday because of it.

@GlenDC I can test and review this PR if you are ok.

Of course @jmozah, please do test and review as much as you can and want. The more testing and the more feedback, the better.

jrick commented 6 years ago

I'm unsure how it would work logistically (and may depend on how frequently you wish to make changes), but even without direct write access, I would gladly pull any changes you have if they seem reasonable.

jmozah commented 6 years ago

FIXED: I had to run geth with -rpc

@GlenDC I took your 'ethatomicswap' branch from which you issued this PR

I am trying to do an atomicswap between BTC and ETH.

1) Initiate from btc worked fine. 2) auditcontract worked fine 3) Participate from eth shows this error.

ethatomicswap -testnet -account 0xc33c7453fb06c9b19ea4eca55cf29f09214958f6  -s http://localhost:8545 participate 0xc33c7453fb06c9b19ea4eca55cf29f09214958f6 1.0 0b8aeb23474fecd2ace555a82bf93ee5bc792458b41e019322b3489793e5b09d

failed to create participate TX: unexpected error while checking for an existing contract: failed to get swap contract from smart contract (at 2661cbaa149721f7c5fab3fa88c1ea564a683631): abi: unmarshalling empty output
GlenDC commented 6 years ago

Happy you fixed it @jmozah. We do use it ourselves as well, and so far haven't found anything weird. Still, Would be more than happy to start taking contributions and feedback in any way.

dajohi commented 5 years ago

@GlenDC please rebase now that go.11+ is required.

GlenDC commented 5 years ago

@GlenDC please rebase now that go.11+ is required.

Sure I don't mind @dajohi, are there still plans than to in the end merge this into the main branch? or do you mean that we should in our own repo require/update-to Go.11+ and ensure it works against it?

xaur commented 3 years ago

Sad to see this stuck (why?) but there's a chance some of this work will live in DCRDEX, see the discussion of swap contracts at https://github.com/decred/dcrdex/issues/1001 and the open PRs implementing those.