{"id":19573946,"url":"https://github.com/hexresearch/hexstody","last_synced_at":"2026-06-10T18:32:12.420Z","repository":{"id":37038031,"uuid":"478204771","full_name":"hexresearch/hexstody","owner":"hexresearch","description":"Hot and cold storage for Bitcoin and Ethereum for building you own custody","archived":false,"fork":false,"pushed_at":"2022-11-16T06:46:23.000Z","size":5459,"stargazers_count":1,"open_issues_count":12,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-26T11:17:17.949Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-05T16:06:36.000Z","updated_at":"2024-09-29T16:24:40.000Z","dependencies_parsed_at":"2023-01-20T18:02:17.557Z","dependency_job_id":null,"html_url":"https://github.com/hexresearch/hexstody","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hexresearch/hexstody","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fhexstody","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fhexstody/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fhexstody/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fhexstody/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexresearch","download_url":"https://codeload.github.com/hexresearch/hexstody/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fhexstody/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34165482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-11T06:37:06.828Z","updated_at":"2026-06-10T18:32:12.402Z","avatar_url":"https://github.com/hexresearch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to build\nYou need to run local PostgreSQL instance to allow compiler to check SQL quieries in advance:\n1. Create `hexstody` user with `hexstody` password and allow to create databases for tests:\n```\ncreate role hexstody login createdb password 'hexstody';\ncreate database hexstody owner hexstody;\n```\n2. Run `./hexstody-db/migrate.sh`;\n3. Set `DATABASE_URL` env:\n```\nexport DATABASE_URL=postgresql://hexstody:hexstody@localhost:5432/hexstody\n```\n\nHow to build and run:\n\nTests\n```\ncargo test\n```\n\nOperator key generation tool\n```\ncargo run --bin operator-keygen -- -o operator-key-1 -p\ncargo run --bin operator-keygen -- -o operator-key-2 -p\n```\n\n## Bitcoin regtest network\nWhen `--start-regtest` flag is specified, `hexstody-hot` automatically starts 2 connected BTC nodes and the `hexstody-btc` API instance.\nBy default BTC nodes use 9804 and 9806 RPC ports. The default RPC password and user is \"regtest\".\nThe first node is used by the hexstody itself, while you can use the second node for depositing and withdrawing funds.\n*NOTE*: tis is important to put some flag after the `--operator-public-keys` flag and between the `serve` command so parser knows that the operator keys list is over.\n```\ncargo run --bin hexstody-hot -- --operator-public-keys operator-key-1.pub.pem operator-key-2.pub.pem --start-regtest serve\n```\n\nThen you can interact with BTC nodes via `bitcoin-cli`.\n\nHere are some usefull commands\n```\nbitcoin-cli -rpcuser=regtest -rpcpassword=regtest -rpcport=9806 -generate 101\nbitcoin-cli -rpcuser=regtest -rpcpassword=regtest -rpcport=9806 -named sendtoaddress address=\"bcrt1q32ykh6yllg055v0ev7e39sguvqhft39j4tedg8\" amount=1\nbitcoin-cli -rpcuser=regtest -rpcpassword=regtest -rpcport=9806 getnewaddress\n```\n\n## Full testnet setup\nIn this section we will describe the whole process of starting `hexstody` on testnet network.\nThe main part of the application is `hexstody-hot` package. \nTo run it, you first need to run `hexstody-btc` and `hexstody-eth` packages.\n`hexstody-btc` and `hexstody-eth`, in turn, require Bitcoin node and Ethereum node to be running.\nIn total we need to start 5 different services:\n- Bitcoin node\n- Ethereum node\n- `hexstody-btc`\n- `hexstody-eth`\n- `hexstody-hot`\nEach of them we will start in a separate terminal.\n\nLet's start by launching the Bitcoin node:\n```\nbitcoind -testnet -server -rpcuser=testnet -rpcpassword=testnet -rpcport=8332\n```\n \nNow let's create a Bitcoin wallet and generate cold wallet address:\n```\nbitcoin-cli -rpcuser=testnet -rpcpassword=testnet -rpcport=8332 createwallet testwallet\nbitcoin-cli -rpcuser=testnet -rpcpassword=testnet -rpcport=8332 getnewaddress\n```\nCopy the result and use it as a cold wallet address in the next step\n\nThen start `hexstody-btc` service:\n```\ncargo run --bin hexstody-btc -- serve \\\n    --network testnet \\\n    --node-url http://127.0.0.1:8332/wallet/testwallet\n    --node-user testnet --node-password testnet \\\n    --hot-domain 127.0.0.1:8180 \\\n    --operator-public-keys operator-key-1.pub.pem operator-key-2.pub.pem \\\n    --cold-sat 100000000 --cold-address tb1qmv63peuryphwkhs3jc6mfvx8ncs99x647fsece\n```\n\nTo start Ethereum node clone `hexstody/eth-sandbox` repo and type:\n```\nnix-shell\n./run.sh\n```\n\nStart `hexstody-eth` service:\n```\n./runeth.sh\n```\n\nAnd finally start `hexstody-hot`:\n```\ncargo run --bin hexstody-hot -- \\\n    --operator-public-keys operator-key-1.pub.pem operator-key-2.pub.pem \\\n    --network testnet serve\n```\n\n## ETH testnet node adapter\n\nrun shell:\n```\nnix-shell\n```\nafter entering into nix-shell run to start eth adatper\n```\n./runeth.sh\n```\n\n# Tips and tricks\n\nRun vscode with export to allow rust extension to validate sqlx macros\n\n```\n(export DATABASE_URL=postgres://hexstody:hexstody@localhost/hexstody; code)\n```\n\nRun sass watcher to auto-compile hexstody-public/static/css/styles.scss on every change:\n\n```\nsass --watch --sourcemap=none hexstody-public/static/css/styles.scss:hexstody-public/static/css/styles.css\n```\n\nOmit `--watch` to compile once. `sass` is available in nix-shell \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexresearch%2Fhexstody","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexresearch%2Fhexstody","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexresearch%2Fhexstody/lists"}