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.0a5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6c54190a4f00ce7392afab2d4f062ca60ba5b65a4e940b8083d83423eb0ef43 |
|
MD5 | ec079dff36e4e2ee2420d6954814d133 |
|
BLAKE2b-256 | 291a86cd5245b5054a5fdc8761f933144f62efada641c33f6252d8a9250a9ae0 |
Hashes for bittensor_wallet-2.0.0a5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b87e2e1505c631a106ef7b81de4ba9e3d258cd651dc744a17e47a8221b7d755 |
|
MD5 | 36b770eed572225a79c9d6df2c849620 |
|
BLAKE2b-256 | 330920ab96a2c46bc0eaa9e5a9fc54ded3a3e2024fb597ce4593558b2a72fceb |
Hashes for bittensor_wallet-2.0.0a5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709cb2aa486157d0e6aa3747d5536f78bef7c0c134e4e6671bc17f7fd709437c |
|
MD5 | 7493f715042f9576995826a49df05ab9 |
|
BLAKE2b-256 | 89d8ededed136afd457b2d8fbe3071311b7a51c03d620ae424218836a1a5b4ab |
Hashes for bittensor_wallet-2.0.0a5-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d3f3887ef84cf98e329655b86040a3a104cc84886a21ece32a1ee2b17857ac4 |
|
MD5 | 954339e9647d0f1c88dd8ad15dc89524 |
|
BLAKE2b-256 | 84dfa0f99ae6ce29edd8c4d76c3ba530a52f8bc3c1f9d8d9ab16a85de3713b34 |
Hashes for bittensor_wallet-2.0.0a5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 506bbf53ed293a06444136e7ff3be9aa4bb4b88935bdaabd5da7fdcddad3e303 |
|
MD5 | 12ba513a556dd70767c2e746e8b42c23 |
|
BLAKE2b-256 | 8e07f39afba5e22de9528c7c20c5eeae60d82b11000f89fab6288c853acb3387 |
Hashes for bittensor_wallet-2.0.0a5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c8114df568d067bd4fe3a4559def03afb96003191a0ec332d80c734b0d429f7 |
|
MD5 | 1e4b6816e21284dbae17877d927ad118 |
|
BLAKE2b-256 | 9da98f19638f4f5b8d7129505759896fc0baee5b70af344244c05772ef31b3ed |
Hashes for bittensor_wallet-2.0.0a5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcea5b44db74daeea047ebb9bb1ebeb12a3fb2e68dcea948fdbcb739bb2789aa |
|
MD5 | 4c40fdf003fcdee99381c5c1a0d5799b |
|
BLAKE2b-256 | 8edbab339156a22d511a448b2b9c7859e069385b94055734de4506f13edb8c34 |
Hashes for bittensor_wallet-2.0.0a5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85a234c771c3e72ca1deaac29526b2731d85606f9a2a0e9810b15664d565c06 |
|
MD5 | f236b9f15f36487b7c733a4695596c43 |
|
BLAKE2b-256 | e8cc27d5c3762e12882e16e274bd749868936523c18b099fa57a0d70a33e5932 |
Hashes for bittensor_wallet-2.0.0a5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 499ef88b292647d085413ebbb26c5d33cf83d89ae751649c83b31d073b810c94 |
|
MD5 | 2deb2b685029b12a4cc8e4481ded2929 |
|
BLAKE2b-256 | 0ff92f7d9d494ec187d29d829001cb366f3cd57c93f920f5b318c10358e4de21 |
Hashes for bittensor_wallet-2.0.0a5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edfe54378e57d480330eb1df3923592519b5996143ded9fb35915d436a7fa1dd |
|
MD5 | 45e6b5c50ffeacc5a37c8ad2161cf5f9 |
|
BLAKE2b-256 | 8ea4df12bc6721a0ed9404c489e035753973642391372d217560d365cf751f3e |
Hashes for bittensor_wallet-2.0.0a5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2beed52dd8143c97a11d4f5d5f0b14e00ec8012ba078c92209617faacc1aa5a3 |
|
MD5 | 5cc286dcfa94c69b67177d8b1d03c885 |
|
BLAKE2b-256 | 3f9aed19ec40a2f5fca12366196883e33d21162bd9dc0bf47422a367e3a56e54 |
Hashes for bittensor_wallet-2.0.0a5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ec2264b5bbfe397f85d1f14f9d6cd7a89c3eb2381b595d16833b2ca3c19ba4 |
|
MD5 | 08cc49b316ad260cc0e7f140b121ccf4 |
|
BLAKE2b-256 | 758313bdc8b049cdf36673b83923f6e5140fa5ba36e3572fde09b2d2e6f47052 |
Hashes for bittensor_wallet-2.0.0a5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486da1358fb8f473dbb6c21ce70e467c1a99a15e071603a708cc5025428571db |
|
MD5 | c6c0e526f481eb0518f21da345217ac4 |
|
BLAKE2b-256 | 573c5e93d6be9286400b26e6882beefdba49602ecd3249478daf2d5445ddbc25 |
Hashes for bittensor_wallet-2.0.0a5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47505e036de26f70bd90c908042f3634ab29ab6b3e8f737e881feee359d8cb87 |
|
MD5 | df5db859c729c546d555f01c117f615d |
|
BLAKE2b-256 | ea02d5b355c121fb2c95f20cb497808014df7ca6a7bbf6f425d937b3b03b2ec9 |
Hashes for bittensor_wallet-2.0.0a5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f831065d95e7915cb26cd2b03b9f0e93dff704ca6b0314de16ee6d265b1cf05 |
|
MD5 | e20c52a97963e8c0044cfa1f68245fbe |
|
BLAKE2b-256 | 1bc5ad701e5498782c20f572924e280996b39f193d639f5739a6568e2e165a77 |
Hashes for bittensor_wallet-2.0.0a5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b48d754853673ad00f9510311b100bdb4ef7e09fefda46ebaa96001e9b23e879 |
|
MD5 | a76788c4c297872f25ad5ef97efa750f |
|
BLAKE2b-256 | 7349e91252837cdc22a7be0f005694f7f47710115075e845e9815932a182fd73 |
Hashes for bittensor_wallet-2.0.0a5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0959af49eade4cba123503c7ac32af1167e67a428b7a93ce851b2213c28e5ab |
|
MD5 | 2bda63fa0306e1914172d1c69e831c57 |
|
BLAKE2b-256 | 4cec740b1d33457ead01c0de3b8383037603f6074f29232776dda40e11f4e5e7 |
Hashes for bittensor_wallet-2.0.0a5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30f28623178617ff9e3b2a54c940c43f95005a7b13bd4b912c5f8cbc28aa48f4 |
|
MD5 | 763fc432360124c777bb07ce3244a6f5 |
|
BLAKE2b-256 | 9f0498056c9f7f88e89c70e659c12870bc4410d3bba154e7e120ba62dda752f3 |