{"id":15540640,"url":"https://github.com/chatch/xcat","last_synced_at":"2025-04-23T17:04:00.143Z","repository":{"id":148808905,"uuid":"104420476","full_name":"chatch/xcat","owner":"chatch","description":"Cross chain atomic trades protocol and api for trades between Stellar and Ethereum","archived":false,"fork":false,"pushed_at":"2018-01-23T14:14:50.000Z","size":256,"stargazers_count":36,"open_issues_count":1,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-23T17:03:41.000Z","etag":null,"topics":["blockchain","cross-chain","cryptocurrencies","ethereum","stellar-network","xcat"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/chatch.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-22T02:13:21.000Z","updated_at":"2024-08-18T22:00:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"4025fc7c-ec61-4deb-a098-d04ac05b2ed9","html_url":"https://github.com/chatch/xcat","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/chatch%2Fxcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatch%2Fxcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatch%2Fxcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatch%2Fxcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chatch","download_url":"https://codeload.github.com/chatch/xcat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477810,"owners_count":21437049,"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":["blockchain","cross-chain","cryptocurrencies","ethereum","stellar-network","xcat"],"created_at":"2024-10-02T12:14:12.914Z","updated_at":"2025-04-23T17:04:00.138Z","avatar_url":"https://github.com/chatch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xcat\n\nProtocol and api for doing cross chain atomic trades between Stellar and Ethereum.\n\n## Protocol\n\nStellar XLM \u003c-\u003e Ethereum ETH\n\n* [protocol_stellar_xlm_to_ethereum_eth.md](docs/protocol_stellar_xlm_to_ethereum_eth.md)\n* [protocol-scenario1.js](integration-test/protocol-scenario1.js) - script that walks through scenario 1 of the protocol\n\nStellar Asset \u003c-\u003e Ethereum ERC20 Token\n\n* [protocol_stellar_asset_to_ethereum_erc20.md](docs/protocol_stellar_asset_to_ethereum_erc20.md)\n\n## Progress\n\n### Native Token Swap (XLM \u003c-\u003e ETH)\n\n* [x] Protocol API Scenario 1 (Stellar side initiated)\n* [ ] Protocol API Scenario 2 (Ethereum side initiated)\n* [ ] Built in communication channel (Telehash Links?)\n\nThe protocol for trades initiated from the Stellar side is working as demonstrated by this [script](integration-test/protocol-scenario1.js) which exercises both parties along the path of least resistance. More testing is required around refunds and edge cases.\n\nCommunication would ideally be done by the tool over some channel rather then having users manually send each other data (see last todo item above). These 2 pieces require manual sharing:\n\n* initial trade.json and trade.json.sig signature (intiater sends after running 'new', counterparty run 'verifysig' and 'import' commands)\n* refund tx envelope (party 2 sends to the initiater, initiater puts it in the trade.json file and runs 'status' to continue with the trade)\n\nThese pieces can be found by scanning the ledgers and so don't require communication:\n\n* Ethereum HTLC contract id\n* hash(x) preimage (after submission)\n* deposit and withdraw transactions on both sides\n\n### Asset to Token Swap (Asset \u003c-\u003e ERC20)\n\n* [ ] TODO!\n\n## Trade.json\n\nTrades are defined by a trade.json file conforming to the JSON schema [here](src/schema/trade.json).\n\nExample:\n\n```\n{\n  \"timelock\": 1505729032,\n  \"commitment\":\n    \"22bf0b3d38d2bec7226eeafd6571cdd452d34a79fb4e72f98e246d372c6a9855\",\n  \"stellar\": {\n    \"token\": \"XLM\",\n    \"amount\": 2000.0,\n    \"depositor\": \"GADU5GS223ZOY7LRWDE5IQBGMCNI523FCF5CFP2KPMMU3TKLJ7IPHEJU\",\n    \"withdrawer\": \"GD3BNTEXZF7IG4OSWDJMCZ4V6N4I6XGEWO5Y6P3FYAZ24ARF2DWV2P3L\"\n  },\n  \"ethereum\": {\n    \"token\": \"ETH\",\n    \"amount\": 1.0,\n    \"depositor\": \"0x7ee7d41559284957f1cd6bd14a658bf985d87ad0\",\n    \"withdrawer\": \"0xfc80237acff828e5a69ba27ec506c2296dab2f68\"\n  }\n}\n```\n\n## Develop\n\n### Start Stellar private network\n\n```\ndocker run -it --rm --name horizon-integrationnet -p 8000:8000 zulucrypto/stellar-integration-test-network\n```\n\n### Start Ethereum local network\n\n```\nPHRASE=\"end staff push admit delay abandon ability nurse renew alert stomach jazz\"\ndocker run --rm -it -p 8545:8545 chatch/ethereumjs-testrpc:4.1.3 -m \"$PHRASE\" $@\n```\n\nNOTE: PHRASE is important as the integration tests expect specific accounts to exist.\n\n### Deploy HashedTimelock smart contract\n\n```\ngit clone https://github.com/chatch/hashed-timelock-contract-ethereum\nnpm i -g truffle\ntruffle migrate\n```\n\n### Run tests\n\n```\nnpm run test\n```\n\n### Run integration test\n\n```\nnpm run test-protocol\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatch%2Fxcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatch%2Fxcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatch%2Fxcat/lists"}