{"id":19345219,"url":"https://github.com/farukterzioglu/hdwallet","last_synced_at":"2025-04-06T08:15:41.800Z","repository":{"id":41261068,"uuid":"296444824","full_name":"farukterzioglu/HDWallet","owner":"farukterzioglu","description":"A generic HD wallet for Elliptic Curve (Secp256k1) and Edwards-curve (Ed25519) based crypto currencies like Bitcoin, Ethereum, Cosmos, Tezos, Tron, Cardano, Polkadot, Avalanche, FileCoin and more.","archived":false,"fork":false,"pushed_at":"2023-04-20T20:12:33.000Z","size":575,"stargazers_count":76,"open_issues_count":12,"forks_count":34,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-29T01:59:27.480Z","etag":null,"topics":["avalanche","bip32","bitcoin","cardano","cosmos","crypto-currency","ed25519","filecoin","hd-wallet","polkadot","secp256k1","tezos","tron"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farukterzioglu.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":"2020-09-17T21:19:50.000Z","updated_at":"2024-06-21T14:06:26.227Z","dependencies_parsed_at":"2024-06-21T14:06:23.947Z","dependency_job_id":"ad2b1040-fd80-42c0-ad5f-2d26cb4e00a9","html_url":"https://github.com/farukterzioglu/HDWallet","commit_stats":{"total_commits":204,"total_committers":6,"mean_commits":34.0,"dds":"0.17156862745098034","last_synced_commit":"64d69b71192ee9d973f082d064ff0d813abd27f0"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukterzioglu%2FHDWallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukterzioglu%2FHDWallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukterzioglu%2FHDWallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukterzioglu%2FHDWallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farukterzioglu","download_url":"https://codeload.github.com/farukterzioglu/HDWallet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451666,"owners_count":20940944,"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":["avalanche","bip32","bitcoin","cardano","cosmos","crypto-currency","ed25519","filecoin","hd-wallet","polkadot","secp256k1","tezos","tron"],"created_at":"2024-11-10T04:05:36.076Z","updated_at":"2025-04-06T08:15:41.781Z","avatar_url":"https://github.com/farukterzioglu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/v/HDWallet.Secp256k1)](https://www.nuget.org/packages/HDWallet.Secp256k1/)\n[![Build status](https://ci.appveyor.com/api/projects/status/20y31c79trpa6gim?svg=true)](https://ci.appveyor.com/project/farukterzioglu/hdwallet) \n\n## HD Wallet\n\nA generic HD wallet for Elliptic Curves (Secp256k1/Secp256r1) and Edwards-curve (Ed25519) based crypto currencies.  \n\n#### Supported blockchains\n\n- Avalanche  \n- Bitcoin  \n- Cardano  \n- Ethereum  \n- FileCoin  \n- Neo3  \n- Polkadot  \n- Solana  \n- Stacks  \n- Terra  \n- Tezos  \n- Tron  \n- Bitcoin-like (Litecoin, Dash, Doge, ...) (WIP)\n\nHD wallets can be generated from mnemonic (w/ or w/o passphrase) or from extended private key (xprv) and non-hd wallets can be generated directly from private key.  \n\nHD wallets can derive sub accounts, and from that accounts external (deposit) wallets or internal (change) wallets can be derived. Using generated wallets, addresses can be retrived by implementing address generators for related crypto currency. \n\n### SDK (.Net Core)   \nAn SDK for wallet creation in a hierarchical and deterministic way. From one mnemonic, multiple wallets can be created for multiple blockchains. You don't need to store private keys for multiple crypto addresses. They can be re-created deterministically.\n.Net developers can use this SDK to create HD wallet within their programs. This SDK doesn't store secrets or manage wallet. Mnemonic (or seed/private key) need to be given for wallet creation.  \nAlso regular wallet can be created from private keys. \n\n### SDK for new blockchains (.Net Core)\nBy using HDWallet.Secp256k1 project, any Elliptic Curve (Secp256k1) based crypto currency wallet can be generated by defining the purpose (e.g. BIP44) and the coin type (e.g. 195 for Tron).  \nHDWallet.Tron project is already ready to go HD wallet for Tron (TRX) which uses HDWallet.Secp256k1 project.  \n\nBy using HDWallet.Ed25519 project, any Edwards-curve (Ed25519) based crypto currency wallet can be generated by defining purpose (e.g. BIP44) and coin type (e.g. 1852 for Cardano). \n\n### API\nAn API can be hosted as Docker container or run as .Net Core app and will receive requests for address generation. Generated addresses (or private keys) won't be stored and will be re-generated when ever queried.  \n\n### Sign server (WIP)\nIf activated within config, a sign server with receive messages to be signed and in reponse, signature and public key that signed the message will be returned.  \n\n## How To \n### How to use the SDK\nSample for generating an HD Wallet for Bitcoin (purpose: BIP84, coin type: 0) from mnemonic and getting the first account's first deposit wallet;  \n```csharp\nIHDWallet\u003cBitcoinWallet\u003e bitcoinHDWallet = new BitcoinHDWallet(\"conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch\", \"\");\nvar depositWallet0 = bitcoinHDWallet.GetAccount(0).GetExternalWallet(0);        \nvar address = depositWallet0.Address;\n```  \n\nSample for generating HD Wallet (m/44'/0'/0') from extended private key;  \n```csharp\nvar accountExtendedPrivateKey = \"xprv9xyvwx1jBEBKwjZtXYogBwDyfXTyTa3Af6urV2dU843CyBxLu9J5GLQL4vMWvaW4q3skqAtarUvdGmBoWQZnU2RBLnmJdCM4FnbMa72xWNy\";\nIAccount\u003cBitcoinWallet\u003e accountWallet = new Account\u003cBitcoinWallet\u003e(accountExtendedPrivateKey);\n\nvar depositWallet0 = accountWallet.GetExternalWallet(0);\n```\n\n### How to use the API  \n#### For multiple accounts\n```bash\ncurl 'https://localhost:5001/bitcoin/0/external/0' \ncurl 'https://localhost:5001/bitcoin/0/external/1'\ncurl 'https://localhost:5001/bitcoin/0/internal/0'\ncurl 'https://localhost:5001/bitcoin/0/internal/1'\n```\n\n#### For single account\n```bash\ncurl 'https://localhost:5001/bitcoin/account/external/0'\ncurl 'https://localhost:5001/bitcoin/account/internal/0'\n```\n\n#### Signing (WIP)\n```bash\ncurl -X POST 'https://localhost:8080/api/v1/tron/account/0/address/0/sign' --header 'Content-Type: application/json' --data-raw '{\n    \"message\":\"MESSAGE-TO-SIGN\"\n}'\n\n{\n  \"signature\" : \"[SIGNATURE]\",\n  \"publickey\" : \"[PUBLICKEY]\"\n}\n```\n\n### How to Run \nWith Docker [WIP]  \n```bash\n➜  ~ docker run -e mnemonic=\"conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch\" -e passphrase=P@55PHR@S3 -p 8080:80 hdwallet-api \n\n➜  ~ docker run -e accounthdkey=xprv9xyvwx1jBEBKwjZtXYogBwDyfXTyTa3Af6urV2dU843CyBxLu9J5GLQL4vMWvaW4q3skqAtarUvdGmBoWQZnU2RBLnmJdCM4FnbMa72xWNy -p 8080:80 hdwallet-api \n```\n\nFrom terminal  \n```bash\n➜  ~ dotnet hdwallet-api.dll\n```\n\n### Authentication\nCookie based [WIP]  \nCookie based authentication activated by default. As the application starts, a cookie file created at `~/.hdwallet/.cookie` (can be configured w/ `--cookiefile` flag). Api user can authenticate with Basic Authentication using credentials in cookie file.  \n\nIf one wants to activate sign server feature, a flag is needed as `--signserver`  \n\n### Configuration\n#### from appSettings.json\n```json\n{\n  \"mnemonic\" : \"conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch\",\n  \"passphrase\" : \"P@55PHR@S3\"\n}\n\n{\n  \"accounthdkey\" : \"xprv9xyvwx1jBEBKwjZtXYogBwDyfXTyTa3Af6urV2dU843CyBxLu9J5GLQL4vMWvaW4q3skqAtarUvdGmBoWQZnU2RBLnmJdCM4FnbMa72xWNy\"\n}\n```\n\n#### from Environment\n```bash\n➜  ~ export MNEMONIC=\"conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch\"\n➜  ~ export PASSPHRASE=P@55PHR@S3\n➜  ~ export ACCOUNTHDKEY=xprv9xyvwx1jBEBKwjZtXYogBwDyfXTyTa3Af6urV2dU843CyBxLu9J5GLQL4vMWvaW4q3skqAtarUvdGmBoWQZnU2RBLnmJdCM4FnbMa72xWNy\n\n➜  ~ dotnet hdwallet-api.dll\n```\n#### from parameters\n```bash\n➜  ~ dotnet hdwallet-api.dll --mnemonic \"conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch\" --passphrase P@55PHR@S3\n\n➜  ~ dotnet hdwallet-api.dll --accounthdkey xprv9xyvwx1jBEBKwjZtXYogBwDyfXTyTa3Af6urV2dU843CyBxLu9J5GLQL4vMWvaW4q3skqAtarUvdGmBoWQZnU2RBLnmJdCM4FnbMa72xWNy\n```\n\n\nSample for signing messages with generated wallets;  \n```csharp\n...\nvar signature = depositWallet0.Sign(messageBytes);\n```\n\n### Build the api   \n```bash\ndocker build -f src/HDWallet.Api/Dockerfile -t hdwallet-api .\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukterzioglu%2Fhdwallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarukterzioglu%2Fhdwallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukterzioglu%2Fhdwallet/lists"}