{"id":20324131,"url":"https://github.com/opentensor/btwallet","last_synced_at":"2025-04-11T19:40:58.564Z","repository":{"id":255425506,"uuid":"830718311","full_name":"opentensor/btwallet","owner":"opentensor","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-09T19:48:20.000Z","size":729,"stargazers_count":9,"open_issues_count":5,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:05:21.007Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentensor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","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":"2024-07-18T20:57:37.000Z","updated_at":"2025-04-09T19:47:59.000Z","dependencies_parsed_at":"2024-08-29T23:27:21.036Z","dependency_job_id":"bed95eb2-6a83-4bd2-a75c-7e982fe6c74f","html_url":"https://github.com/opentensor/btwallet","commit_stats":null,"previous_names":["opentensor/btwallet"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentensor%2Fbtwallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentensor%2Fbtwallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentensor%2Fbtwallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentensor%2Fbtwallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentensor","download_url":"https://codeload.github.com/opentensor/btwallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248468301,"owners_count":21108789,"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-11-14T19:32:26.499Z","updated_at":"2025-04-11T19:40:58.549Z","avatar_url":"https://github.com/opentensor.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n\r\n# Bittensor Wallet \u003c!-- omit in toc --\u003e\r\n\r\n[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/bittensor)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![PyPI version](https://badge.fury.io/py/bittensor-wallet.svg)](https://badge.fury.io/py/bittensor-wallet)\r\n\r\n---\r\n\r\n## Internet-scale Neural Networks \u003c!-- omit in toc --\u003e\r\n\r\n[Bittensor SDK](https://github.com/opentensor/bittensor/tree/master) • [BTCLI](https://github.com/opentensor/btcli) • [Research](https://bittensor.com/whitepaper)\r\n\r\n\u003c/div\u003e\r\n\r\n## Bittensor Wallet\r\n\r\nThe Bittensor Wallet SDK is a Python interface for a powerful Rust-based Bittensor wallet functionality. You do not need to know Rust to use this Wallet SDK. However, if you want to contribute to the Rust components of this Wallet SDK, the Rust source is located in the [src](./src) directory. You can look at the development history by inspecting the Changelog.md.\r\n\r\n## Documentation\r\n\r\nFor a full documentation on how to use `btwallet`, see the [Bittensor Wallet SDK section](https://docs.bittensor.com/working-with-keys) on the developer documentation site.\r\n\r\n---\r\n\r\n## Before you proceed\r\n\r\nIf you installed either Bittensor SDK version `9.x.x` or BTCLI version `9.x.x` then the Wallet SDK 3.x.x is already installed. The below installation steps are only for a standalone installation of the Wallet SDK 3.x.x package.\r\n\r\n## Install\r\n\r\nFollow the below steps to install the Bittensor Wallet SDK:\r\n\r\n### From PyPI\r\n\r\nUse this option if you want to use the Wallet SDK.\r\n\r\n```bash\r\npython3 -m venv btwallet-venv  # create a virtual env\r\nsource btwallet-venv/bin/activate  # activate the env\r\npip install bittensor-wallet  # install bittensor-wallet\r\n```\r\n\r\n### From source\r\n\r\nUse this option if you want to develop your application using the Wallet SDK.\r\n\r\n```bash\r\npython3 -m venv btwallet-venv  # create a virtual env\r\nsource venv/bin/activate  # activate the env\r\ngit clone https://github.com/opentensor/btwallet.git\r\ncd btwallet\r\npip install maturin\r\nmaturin develop\r\n```\r\n\r\nAfter the `maturin develop` command completes, run the below command:\r\n\r\n```bash\r\npip list\r\n```\r\n\r\nYou will see `bittensor-wallet` in the list on installed packages. This means the installation was successful.\r\n\r\n---\r\n\r\n## Verify your installation\r\n\r\nIn the `python3` interpreter, run the below code to verify that your installation was successful. See an example output below:\r\n\r\n```py\r\n# python3\r\n# Python 3.12.4 (v3.12.4:8e8a4baf65, Jun  6 2024, 17:33:18) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin\r\n# Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nimport bittensor_wallet\r\nprint(bittensor_wallet.__version__)\r\n\u003e\u003e\u003e 3.x.x\r\n```\r\n\r\nThe above will print the Wallet SDK version you just installed, i.e., `3.x.x`, confirming that the installation was successful.\r\n\r\n---\r\n\r\n## Usage examples\r\n\r\n**1. Create a wallet**\r\n\r\nIn the `python3` interpreter, run the below code:\r\n\r\n```python\r\nfrom bittensor_wallet import Wallet\r\n\r\n# creates wallet with name `default`\r\nwallet = Wallet()\r\nwallet.create()\r\n```\r\n\r\nIf a wallet with the name \"default\" already exists, then you will see a message. If it doesn't exist, then the above code will create both a coldkey and a hotkey and displays the following information, including your mnemonic **(mnemonics are replaced with `x` in the below example for security)**:\r\n\r\n```bash\r\nIMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.\r\n\r\nThe mnemonic to the new coldkey is:\r\n\r\nforward xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xx actress\r\n\r\nYou can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:\r\nbtcli w regen-coldkey --mnemonic \"forward xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xx actress\"\r\n\r\nSpecify password for key encryption:\r\nRetype your password:\r\n\r\nIMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.\r\n\r\nThe mnemonic to the new hotkey is:\r\n\r\nfuel xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xxx bind\r\n\r\nYou can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:\r\nbtcli w regen-hotkey --mnemonic \"fuel xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xxx bind\"\r\n\r\nname: 'default', hotkey: 'default', path: '~/.bittensor/wallets/'\r\n\u003e\u003e\u003e print(wallet)\r\nWallet (Name: 'default', Hotkey: 'default', Path: '~/.bittensor/wallets/')\r\n\u003e\u003e\u003e\r\n```\r\n\r\n**2. Pass arguments to a class other than the default**\r\n\r\n```bash\r\nname (str): The name of the wallet, used to identify it among possibly multiple wallets.\r\nhotkey (str): String identifier for the hotkey.\r\npath (str): File system path where wallet keys are stored.\r\nconfig (Config): Bittensor configuration object.\r\n```\r\n\r\nIn the `python3` interpreter, run the below code. See an example below (only partial is shown):\r\n\r\n```py\r\n# python3\r\n# Python 3.12.4 (v3.12.4:8e8a4baf65, Jun  6 2024, 17:33:18) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin\r\n# Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nfrom bittensor_wallet import Wallet\r\n\r\nmy_name = \"my_wallet_name\"\r\nmy_path = \"path_to_my_wallet\"\r\nmy_hotkey = \"name_of_my_hotkey\"\r\n\r\nmy_wallet = Wallet(name=my_name, path=my_path, hotkey=my_hotkey)\r\nmy_wallet.create()\r\n\r\n\u003e\u003e\u003e IMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.\r\n```\r\nThe above will create a wallet with \"my_wallet_name\". \r\n\r\n---\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentensor%2Fbtwallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentensor%2Fbtwallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentensor%2Fbtwallet/lists"}