No project description provided
Project description
Bittensor Wallet SDK
The 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 directory.
Documentation
For a full documentation on how to use btwallet
, see the Bittensor Wallet SDK section on the developer documentation site.
Before you proceed
- If you installed either Bittensor SDK version
8.1.0
or BTCLI version8.1.0
then the Wallet SDK 2.0.0 is already installed. The below installation steps are only for a standalone installation of the Wallet SDK 2.0.0 package. - IMPORTANT: The Wallet SDK 2.0.0 is compatible only with Bittensor SDK version
8.1.0
and later versions and BTCLI version8.1.0
and later versions. Earlier versions of Bittensor SDK and BTCLI are not compatible with Wallet SDK 2.0.0.
Install
Follow the below steps to install the Bittensor Wallet SDK:
From PyPI
Use this option if you want to use the Wallet SDK.
$ python3 -m venv btwallet-venv # create a virtual env
$ source btwallet-venv/bin/activate # activate the env
$ pip install bittensor-wallet # install bittensor-wallet
From source
Use this option if you want to develop your application using the Wallet SDK.
python3 -m venv btwallet-venv # create a virtual env
source venv/bin/activate # activate the env
git clone https://github.com/opentensor/btwallet.git
cd btwallet
pip install maturin
maturin develop
After the maturin develop
command completes, run the below command:
pip list
You will see bittensor-wallet
in the list on installed packages. This means the installation was successful.
Verify your installation
In the python3
interpreter, run the below code to verify that your installation was successful. See an example output below:
python3
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
Type "help", "copyright", "credits" or "license" for more information.
>>> import bittensor_wallet
>>> print(bittensor_wallet.__version__)
2.0.0
>>>
The above will print the Wallet SDK version you just installed, i.e., 2.0.0
, confirming that the installation was successful.
Usage examples
1. Create a wallet
In the python3
interpreter, run the below code:
from bittensor_wallet import Wallet
# creates wallet with name `default`
wallet = Wallet()
wallet.create()
If 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):
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.
The mnemonic to the new coldkey is:
forward xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xx actress
You 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:
btcli w regen-coldkey --mnemonic "forward xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xx actress"
Specify password for key encryption:
Retype your password:
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.
The mnemonic to the new hotkey is:
fuel xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xxx bind
You 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:
btcli w regen-hotkey --mnemonic "fuel xxxx xxx xxx xxxx xxxx xxxx xxx xx xx xxx bind"
name: 'default', hotkey: 'default', path: '~/.bittensor/wallets/'
>>> print(wallet)
Wallet (Name: 'default', Hotkey: 'default', Path: '~/.bittensor/wallets/')
>>>
2. Pass arguments to a class other than the default
name (str): The name of the wallet, used to identify it among possibly multiple wallets.
hotkey (str): String identifier for the hotkey.
path (str): File system path where wallet keys are stored.
config (Config): Bittensor configuration object.
In the python3
interpreter, run the below code. See an example below (only partial is shown):
python3
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
Type "help", "copyright", "credits" or "license" for more information.
>>> from bittensor_wallet import Wallet
>>> my_name = "my_wallet_name"
>>> my_path = "path_to_my_wallet"
>>> my_hotkey = "name_of_my_hotkey"
>>>
>>> my_wallet = Wallet(name=my_name, path=my_path, hotkey=my_hotkey)
>>> my_wallet.create()
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.
The above will create a wallet with "my_wallet_name".
3. Use your own config
from bittensor_wallet.config import Config
config = Config()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for bittensor_wallet-2.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7afba8280d03901e04e52ad39e037189c9013a2e673b4e5283ef834d85f59149 |
|
MD5 | 0ca5ed0735ceacbf95bc008f7d846c08 |
|
BLAKE2b-256 | a122355c62b006f1ac177844126978905519bb418bd082a85360237dbb9c8322 |
Hashes for bittensor_wallet-2.0.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40480c935c825bb80368dba60149a8bd47a6e2d6ae494bb211658399b7c9297c |
|
MD5 | 0d50b7995f766975839e98d2943d80d9 |
|
BLAKE2b-256 | 26fe00771e4798432b4cfc0352913b1489a1f46daa1268a9ed75e750b1b7adf8 |
Hashes for bittensor_wallet-2.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee70d9fe7ce37e3ee53a175c89c6b9ea864d2dd900d14ee1627ad9ae7c875d41 |
|
MD5 | 75a62e2039845b3ed9be89fa1aba0df7 |
|
BLAKE2b-256 | 2f953694beac5ae1e1a00b0478d568b08ee854d82f33b1f5c78060233c7804ef |
Hashes for bittensor_wallet-2.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a677718367191caac0a0482fbb3703db5fd5ddd0bedff1bc0631242f046a3e4e |
|
MD5 | 0021562ff5098c287c8ef3609437dca3 |
|
BLAKE2b-256 | 80311a78c63a48ea474d0bccaa4c0951023346427845e0215b4311d1b081cec2 |
Hashes for bittensor_wallet-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a249fec7a2e1ad11281a85fb67c5349470f8b3262ce28327f359111523362e |
|
MD5 | 04f59b065b7d61c34dda3c7ddce01c93 |
|
BLAKE2b-256 | 77500bab5dbd017965320a18b518c356caf235bd3210146a5189fe8a2a4a455d |
Hashes for bittensor_wallet-2.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d170775465678f3f75cc5ce6afa15ece5c13ada7419a2bfe00fbc957d9352f1 |
|
MD5 | 0fc6c8d1ae3e16961b713ea8103c1005 |
|
BLAKE2b-256 | 353551cc8d6f610babcfcc352f665b2169807d6f58a2364e0770d1fb0ad9477d |
Hashes for bittensor_wallet-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d4d349e191034dac3a55e45e90f86cec87ac7686d6e8ab0df341ae46a703349 |
|
MD5 | 1a6cc85271024c72069ce5687e043172 |
|
BLAKE2b-256 | c9f4ba21669dda1493537047aa8c1c52e42f4722273d5e3905066eb065adfafd |
Hashes for bittensor_wallet-2.0.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54861a87f0ffa281297be73f08f247485a06ac9c0756b6717ee3acf2193ec9a2 |
|
MD5 | 439bafd86191429f2250c9191288b4bc |
|
BLAKE2b-256 | 77587331c9258771b050d05ca97e245e7d9d78ba9924f987ae967797cfd01b41 |
Hashes for bittensor_wallet-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410bf8547f9739c8cc6ce2a3e3c7f4e4636690bccb151270e68ba04fbd0c2932 |
|
MD5 | ce290c77260b10469912ecd2e3a2bc68 |
|
BLAKE2b-256 | 846c359de694b6adeb338ea7fd4f1b6eea99842241566ff20bdc8d7c59648ea8 |
Hashes for bittensor_wallet-2.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 251c3c9e221818fe192715d0fbcba2a834d935a92e71ac0aa24a8f5e4a7dd604 |
|
MD5 | 34139a90aa1ce3378358d63e37f7b146 |
|
BLAKE2b-256 | 3cfa1ba072ed54c8063b8265b2f80b8d1adebe833ae452ded529d5f6b90a7147 |
Hashes for bittensor_wallet-2.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf5c565ade376c61e6ae795dc83bece85f3f0cc63bde8a889f0cb5ca6b9e9db |
|
MD5 | 7307b5d9d6093774fe8126af04e12170 |
|
BLAKE2b-256 | ba9b5e4cef49700376f6181c6423b64d0d8c97143b82e5c01d04a470d2dd7389 |
Hashes for bittensor_wallet-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e4847a407a1ef7c2a02b2cf09b467e0a47f775f80ba43df5c49a3b353d70ab6 |
|
MD5 | 934fad64e7cf7f22f04d8dc25865fc15 |
|
BLAKE2b-256 | 187961b5cdd3e08ef7321906623353624ddc7b37f38d6ea00a19c8041c161a85 |
Hashes for bittensor_wallet-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a90219f1164839844b48ef15d4415f23fcffbcf3c9a3937b2d1c6442a8ffd3ee |
|
MD5 | 09538cfb8e5e1987f924d29afbc109ca |
|
BLAKE2b-256 | d8cb77c65232fdee5c7846fedb05ca18a52ada40912d8c4452f2a682cafb0414 |
Hashes for bittensor_wallet-2.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 595cd2cf896c11444a55021ba2dd7c1ed09b2cb1757eeeeb61c78cb1ccba86ca |
|
MD5 | 2f8ff583d86396492f0a2c7c0493622e |
|
BLAKE2b-256 | 632bf84c3c77e3a0a78f471cfb7aa6906d901531d61da35149eee4280251f604 |
Hashes for bittensor_wallet-2.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2854c40f3da0b6c0bdd95dc8d003b7b4d4131b176ae8f772a2b9bcfeeecbce9c |
|
MD5 | 1f8c25d5b21a91c156a3afcf8d3f3f82 |
|
BLAKE2b-256 | 4037d12c6dc34bcb67ced81854dd496ebdee746963fa089529e57c1c9e4beeba |
Hashes for bittensor_wallet-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776ca896aac07f1d796af137fa47e89d525ea14b071e2a771955833908b51500 |
|
MD5 | f46bfd10028e19f4f7a442e8ab7a61ad |
|
BLAKE2b-256 | edab24ea40a77ba378141967610db5c0d51ee3d297f645d036fec23b8b214915 |
Hashes for bittensor_wallet-2.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5762f39edb4b647b40fca5a373949c6d1623e79242addbe71b2bf98e466995e |
|
MD5 | da576f3bea04b9437220dd475d520d31 |
|
BLAKE2b-256 | 8498e89e4ad98f2a1e14cbff1d3a5bfe7cd46471522593c0d9fb6d324a3362dd |
Hashes for bittensor_wallet-2.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e0b63d3e0ed733e67d945d56c6f920bdae682ab498a2b81a60493128d20a190 |
|
MD5 | 186ece275c056830fb9e1e039c2598a2 |
|
BLAKE2b-256 | 72bb9868c1953a7058a1e8fbd1cc0b3de2ecf45b05356b2804f9b9d1dfed15c4 |