{"id":28178461,"url":"https://github.com/slycompiler/torram-btc","last_synced_at":"2025-07-07T05:36:25.492Z","repository":{"id":276831501,"uuid":"921095975","full_name":"slycompiler/torram-btc","owner":"slycompiler","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-23T10:35:29.000Z","size":171,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T20:49:03.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/slycompiler.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-23T10:28:47.000Z","updated_at":"2025-01-23T10:35:32.000Z","dependencies_parsed_at":"2025-02-10T17:48:26.298Z","dependency_job_id":"396eb87e-e6bf-458a-bdb7-a65e418afe79","html_url":"https://github.com/slycompiler/torram-btc","commit_stats":null,"previous_names":["hardworking-toptal-dev/torram-btc","slycompiler/torram-btc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/slycompiler/torram-btc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slycompiler%2Ftorram-btc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slycompiler%2Ftorram-btc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slycompiler%2Ftorram-btc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slycompiler%2Ftorram-btc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slycompiler","download_url":"https://codeload.github.com/slycompiler/torram-btc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slycompiler%2Ftorram-btc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264020788,"owners_count":23545377,"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":"2025-05-16T01:12:30.783Z","updated_at":"2025-07-07T05:36:25.488Z","avatar_url":"https://github.com/slycompiler.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Torram\n\nTorram is a Cosmos SDK-based blockchain project with a specialized BTC staking module (btcstake).\n\n## Overview\n\nTorram implements a blockchain system that includes functionality for interacting with Bitcoin transactions and staking mechanisms. The project is built using the Cosmos SDK framework and includes custom modules for BTC-related operations.\n\n## Prerequisites\n\n- Go 1.20 or later\n- Make\n- Docker (optional)\n- Git\n\n## Installation\n\n1. Clone the repository:\n```\ngit clone https://github.com/hardworking-toptal-dev/torram-btc.git\ncd torram\n```\n\n2. Install dependencies:\n```bash\nmake install\n```\n\n## Configuration\n\nThe project includes a default configuration in `config.yml` with:\n- Pre-configured accounts (torram-validator)\n- Validator settings\n- Initial token distribution\n\n## Running the Node\n\n1. Initialize the chain with default denomination:\n```bash\ntorramd init torram --chain-id torram --default-denom torram\n```\n\n2. Create validator key:\n```bash\ntorramd keys add torram-validator --keyring-backend test\n```\n\n3. Add genesis account and create validator:\n```bash\n# Add genesis account\ntorramd genesis add-genesis-account cosmos15x28edujch4hmlvp343nj44evt7a9w9gftxvpw 1000000000000000torram --keyring-backend test\n\n# Create validator transaction\ntorramd genesis gentx torram-validator 100000000000torram --chain-id torram --keyring-backend test\n\n# Collect genesis transactions and validate\ntorramd genesis collect-gentxs\ntorramd genesis validate-genesis\n```\n\n4. Start the chain:\n```bash\ntorramd start --minimum-gas-prices \"0.01torram\"\n```\n\n## Interacting with BTCStake Module\n\n### Query BTC Transactions\n\n1. Fetch BTC transactions for an address:\n```bash\ntorramd tx btcstake fetch-btc-tx \\\n  --btc-address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa \\\n  --from torram-validator \\\n  --chain-id torram \\\n  --gas auto \\\n  --gas-adjustment 1.5 \\\n  --fees 20000torram \\\n  --keyring-backend test \\\n  -y\n```\n\n2. Query stored BTC transactions:\n```bash\ntorramd query btcstake get-btc-txs --btc-address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa --output json\n```\n\n3. Query transaction details:\n```bash\ntorramd query tx \u003cTX_HASH\u003e --output json | jq\n```\n\n### Direct BlockCypher API Query\n\nFor testing purposes, you can query the BlockCypher API directly:\n```bash\ncurl \"https://api.blockcypher.com/v1/btc/main/addrs/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa?unspentOnly=true\"\n```\n\n### Reset and Rebuild\n\nIf you need to reset the chain and rebuild:\n```bash\ntorramd tendermint unsafe-reset-all\nmake install \ntorramd start --minimum-gas-prices \"0.01torram\"\n```\n\n## Features\n\n### BTC Stake Module (btcstake)\n\n#### Project Goal\nThe btcstake module aims to create a cross-chain staking mechanism where:\n- Users can stake Bitcoin to the Torram chain\n- Staking records are maintained on both Bitcoin and Torram chains\n- Unstaking process is verified and recorded on both chains\n- Provides secure and transparent cross-chain staking operations\n\n#### Current Implementation\nThe btcstake module currently provides:\n- Bitcoin transaction verification through BlockCypher API\n- Transaction validation and storage on Torram chain\n- Query functionality for Bitcoin transactions\n- Basic stake address validation\n\n#### Implemented Features\n1. Transaction Verification\n   - Fetches BTC transactions from BlockCypher\n   - Validates transaction details and confirmations\n   - Stores verified transactions in Torram chain\n\n2. Query System\n   - Retrieve stored BTC transactions\n   - Query transaction details\n   - Monitor stake address activities\n\n### Current Limitations and TODOs\n\n#### Authentication and Verification Flow\n1. Wallet Authentication\n   - Users must sign their requests with their Bitcoin private key\n   - Module verifies ownership using public key verification\n   - Example request:\n   ```bash\n   torramd tx btcstake verify-and-stake \\\n     --btc-address \u003cBTC_WALLET_ADDRESS\u003e \\\n     --btc-pubkey \u003cBTC_PUBLIC_KEY\u003e \\\n     --signed-data \u003cENCRYPTED_PAYLOAD\u003e \\\n     --from \u003cCOSMOS_ADDRESS\u003e \\\n     --chain-id torram \\\n     --gas auto \\\n     --fees 20000torram \\\n     --keyring-backend test \\\n     -y\n   ```\n\n2. Transaction Verification Process\n   - Module decrypts signed data using provided public key\n   - Validates wallet ownership and signature\n   - Fetches Bitcoin transactions for the provided address\n   - Verifies staking transactions to Torram's managed BTC address\n   - Example verification query:\n   ```bash\n   torramd query btcstake verify-stake-tx \\\n     --btc-address \u003cBTC_WALLET_ADDRESS\u003e \\\n     --tx-hash \u003cBTC_TX_HASH\u003e \\\n     --output json\n   ```\n\n3. Token Minting/Distribution\n   - After verification, mints wrapped BTC tokens (wBTC) or\n   - Transfers existing staking tokens to user's Cosmos address\n   - Records stake details including:\n     - Bitcoin transaction hash\n     - Stake amount\n     - Timestamp\n     - Cosmos recipient address\n     - Verification signatures\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslycompiler%2Ftorram-btc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslycompiler%2Ftorram-btc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslycompiler%2Ftorram-btc/lists"}