{"id":13632901,"url":"https://github.com/ZenGo-X/JugglingSwap","last_synced_at":"2025-04-18T05:33:45.852Z","repository":{"id":105881733,"uuid":"284499531","full_name":"ZenGo-X/JugglingSwap","owner":"ZenGo-X","description":"Scriptless atomic cross-chain (and cross-curve) swap protocol based on a fair exchange of secrets.","archived":false,"fork":false,"pushed_at":"2021-01-19T22:44:18.000Z","size":33272,"stargazers_count":33,"open_issues_count":1,"forks_count":8,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-09T01:35:46.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZenGo-X.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-02T16:31:10.000Z","updated_at":"2024-07-16T09:32:18.000Z","dependencies_parsed_at":"2024-01-14T07:18:30.426Z","dependency_job_id":"744fa751-5df8-4dee-950b-a7132e6d23c1","html_url":"https://github.com/ZenGo-X/JugglingSwap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenGo-X%2FJugglingSwap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenGo-X%2FJugglingSwap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenGo-X%2FJugglingSwap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenGo-X%2FJugglingSwap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZenGo-X","download_url":"https://codeload.github.com/ZenGo-X/JugglingSwap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249437046,"owners_count":21271997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:03:24.545Z","updated_at":"2025-04-18T05:33:45.845Z","avatar_url":"https://github.com/ZenGo-X.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"## JugglingSwap\n\nA scriptless _atomic cross-chain (and cross-curve) swap_ protocol based on a fair exchange of secrets and threshold-signatures. See [paper](https://arxiv.org/abs/2007.14423).\nDemonstrating a BTC/ETH swap.\n\n### Installation\n\n1. Install Rust.\u003cbr\u003e\n   This demo was tested on rustc 1.38.0-nightly (0b680cfce 2019-07-09);\n2. Clone and build the repository:\n```\n$ git clone https://github.com/KZen-networks/atomic-swaps\n$ cd ./atomic-swaps\n$ yarn install\n$ yarn run build \n```\n\n### Demo\n\nYou can use the command line demo, using 3 different shells, one for each of the different actors: a maker, a taker and a server.\n\n#### Server\nThe server functions as both the co-signer of wallet owners (i.e. the maker and the taker) and as a hub for communication between them when performing a make/take order request and the atomic swap itself.\n```\n$ cd ./dist/demo\n$ export DEBUG=server  # see useful logs throughout the demo\n$ chmod +x ./server.js\n$ ./server.js run\nServer listening on port 8001\n```\n\n#### Maker\n```\n$ cd ./dist/demo\n$ export DEBUG=user,maker  # see useful logs throughout the demo\n$ chmod +x ./maker.js\n$ ./maker.js --help\nUsage: maker [options] [command]\n\nOptions:\n  -h, --help                                                      display help for command\n\nCommands:\n  address|a [options]\n  balance|b\n  make|m \u003csourceCurrency\u003e \u003csourceAmount\u003e \u003ctoCurrency\u003e \u003ctoAmount\u003e  Make an order\n  help [command]                                                  display help for command\n```\nFor example, the maker would want to swap BTC for ETH.\u003cbr\u003e\nYou'll first need to send some Bitcoin Testnet coins to the maker's address. One available faucet is: https://testnet-faucet.mempool.co/.\u003cbr\u003e\nTo get the maker's address:\n```\n$ ./maker.js address\nmys4d22g8t9h9j3W3JDDbPynYgh2dBj9tw\n```\nThen, you can make an order request (do not kill the process when done):\n```\n$ ./maker.js make BTC 0.0001 ETH 0.001\ndone\n```\n\n#### Taker\n```\n$ cd ./dist/demo\n$ export DEBUG=user,taker  # see useful logs throughout the demo\n$ chmod +x ./taker.js\n$ ./taker.js --help\nUsage: taker [options] [command]\n\nOptions:\n  -h, --help           display help for command\n\nCommands:\n  address|a [options]\n  balance|b\n  orders|o             Get all orders\n  take|t \u003corderId\u003e     Take an order\n  help [command]       display help for command\n```\nFirst, deposit some (ropsten) ether into the taker's ETH address. One available faucet is: https://faucet.ropsten.be/.\u003cbr\u003e\nTo get the taker's address:\n```\n$ ./taker.js address\n0x6eddb5f4826f0943069f5b09cade32c5e0bbcae6\n```\nGet all available orders (made by makers):\n```\n$ ./taker.js orders\n[ { id: '10121dc1-49ac-426d-823a-af757c798aad',\n    sourceCurrency: 'BTC',\n    destinationCurrency: 'ETH',\n    sourceAmount: '0.0001',\n    destinationAmount: '0.001' } ]\n```\nThen, execute an order using its id:\n```\n./taker.js take 10121dc1-49ac-426d-823a-af757c798aad\n```\nEventually, you'll see logs of the following formats at the maker's and taker's shells, respectively:\n```\nExecuted ETH withdraw: 0x5b780bdb57a69fc0c5b0e1c8a43764a702e50202eb3a73524db48744396c94a7\n```\n```\nExecuted BTC withdraw: edef8ac64f9dcd2a1ee8dcea964249a4a23e9f83f827f17ea65d0f2ed7aefcf8\n```\nThese transactions complete the cross-chains atomic-swap between the parties.\n\n |![Demo](https://raw.githubusercontent.com/KZen-networks/JugglingSwap/master/demo.gif \"Bitcoin \u0026 Ethereum Atomic Cross Chain Swap\")|\n |:--:|\n\n\n## Contact\n\nFeel free to [reach out](mailto:github@kzencorp.com) or join ZenGo X [Telegram](https://t.me/joinchat/ET1mddGXRoyCxZ-7) for discussions on code and research.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZenGo-X%2FJugglingSwap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZenGo-X%2FJugglingSwap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZenGo-X%2FJugglingSwap/lists"}