Skip to main content

No project description provided

Project description

Bittensor Wallet SDK

Discord Chat License: MIT PyPI version


Internet-scale Neural Networks

Bittensor SDKBTCLIResearch

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. You can look at the development history by inspecting the Changelog.md.

Documentation

For a full documentation on how to use btwallet, see the Bittensor Wallet SDK section on the developer documentation site.


Before you proceed

  1. If you installed either Bittensor SDK version 8.1.0 or BTCLI version 8.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.
  2. IMPORTANT: The Wallet SDK 2.0.0 is compatible only with Bittensor SDK version 8.1.0 and later versions and BTCLI version 8.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()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bittensor_wallet-2.1.0.tar.gz (69.5 kB view details)

Uploaded Source

Built Distributions

bittensor_wallet-2.1.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl (3.0 MB view details)

Uploaded PyPy manylinux: glibc 2.5+ i686

bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (3.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

bittensor_wallet-2.1.0-cp312-cp312-macosx_11_0_arm64.whl (750.2 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

bittensor_wallet-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl (791.1 kB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (3.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

bittensor_wallet-2.1.0-cp311-cp311-macosx_11_0_arm64.whl (750.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

bittensor_wallet-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl (794.4 kB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (3.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

bittensor_wallet-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (751.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (3.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

bittensor_wallet-2.1.0-cp39-cp39-macosx_11_0_arm64.whl (751.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

Details for the file bittensor_wallet-2.1.0.tar.gz.

File metadata

  • Download URL: bittensor_wallet-2.1.0.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for bittensor_wallet-2.1.0.tar.gz
Algorithm Hash digest
SHA256 d98ee62f270fca3a68735631dbaa031bdeafda7b1381d570a0a32d6ef7bbc5a1
MD5 3b615725d54c022fd66472d4e3dca672
BLAKE2b-256 6f7ac730da7e778926841312df149f12502885e020b8c3c219889739e880b88e

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f49a91d5006c165427ce5ea500f0d45cde877f78025a0b2f61afdab4d715e542
MD5 cff189a14c0d6112473c4c96ef21a141
BLAKE2b-256 8b2623a43a2210ae5eea83b74a20160b1c11c24a44ac5b77be68b7a453be444e

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 34072e19abf96d8462d58fb9b7a6fe3a8881b08011e6d4bb66ca6fa0ac490785
MD5 b2d927fa6d78b7ae64e132a494b74b7c
BLAKE2b-256 e01223072297221ed68ea6b60d151cd2c682ed5cf9957aa67f0b251145574785

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53e88f4f089b5d49bc46585b6b2ba9c228df6df55382cf16249790f05fd919d6
MD5 b07729b6b6e11a305359e8abbf0ce5a8
BLAKE2b-256 b3517434d03025e8f6c7dc6b04366dd68250eccc5e7590a4c18aadcaf99815d5

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 d4b804ebd5a218be74ca46ad11a1d7ae1958e6bd537c2591c1b9bbd260be04d4
MD5 f9883d9bf82159a608c4b359f13f99c8
BLAKE2b-256 43b13d0d0a14e67376826e64956070486581ae7d96a8ed0ae981437bf55b8177

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6410cc0379f885ccd219e482644325b84d65b3831e9d8f58eff1ff812d02305a
MD5 e4b4de5eefdae852a8f61b9b6b435a0c
BLAKE2b-256 6e0ea9b695f836af8bf883eb9a073f6dffabc18f68116c17f55090cd07b6125a

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1afaeedf607007724f2091975fed9f4cef3681436132539ecc606cba6f105ff6
MD5 4b7f27c471386310ac5ffe7cd8d7cf85
BLAKE2b-256 86eff8e3ece1baa02b866d682cf3c4711f7ed85768c3062a744df55b3513388c

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 839d51445370c7cf05352c757f0cd4dba0b40e28713843ab254af1641c2a8c71
MD5 598ad750c320e7b8997a83d622520eb4
BLAKE2b-256 c00d9e547799e5e05d4e27fc23b1319e8df52596fa2f9bd36adbd6b39d0b207b

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 a89447cda666f077ed7cf616a2fc2593783e5dbde0495a1b57ec37a4228fa31f
MD5 8318e0ef92d3115b39b9c6b4a04ea680
BLAKE2b-256 51228cbbfff20623f4f6992ca45139fa30e01c782002ef3828064e67bed09f53

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a732add8e1d40dd81feb1a0da79c66524e25e2e4df3c4c8b9da9af39693a94bc
MD5 0e70526e492dc624d08d4077425a0d07
BLAKE2b-256 3de200a90e4c3b1a56df5cf1f614f7d668bed4db5f066a99126cf41e9ae41c3a

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8b6d8572643a1be74efc4f2f28e0344926f442ade026033d74c899556cc0bd3d
MD5 f5992dd9898f235716b3147e379614d9
BLAKE2b-256 72e50190c58b8549b4d99978a9bd255b626f701bb81a1e4f528056184cd3c6c1

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28eeee16d19df866aae14db8fda28f9beb78a7917df2b4eb829c6e259fc23391
MD5 160b2fb9b16d56e4adc4f91455fa3368
BLAKE2b-256 cb9e5a256c0acbd900f1be19492bd9da363e0d09a991afaa200ec052ab906e3c

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 548de11db359767662b27cb9320441addc3a779ac6ba43cf323febbfc73a0228
MD5 c1b1054ff76ec4f4522106c8eca8b58d
BLAKE2b-256 828acf838b6dd999141612a96e607098f137fa42129ecb6a79258837521aa0b8

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e59e0188b1e697a9920d50c569fab037d0f31709fba7925ee427eb645e5fd513
MD5 d8cc03a054e6c79e3a975f2a89ef3308
BLAKE2b-256 4980de43528f9eaa51b3dfeaebad28368296210ff1a03e548ff75237b2bcc26e

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0c3ec468a4173e1eceb230ef40050f24b0715caddcc9447ce373fca07f18604
MD5 7dc1a2011482007a361e1d6fe978c914
BLAKE2b-256 6532a02d7d4628a207527cc43399b15776b5dc46a62d6f37758281bc511f1d13

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 bedbab843561809793eaafac3690261fdbac8c62031cdad7aec68668b78b07a2
MD5 97fc9cc9220c1179f57e03fcd34aedfd
BLAKE2b-256 ab4117c3edfdd158eb63bb85ece524d728a260cdc38cc89458558499252c9732

See more details on using hashes here.

File details

Details for the file bittensor_wallet-2.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bittensor_wallet-2.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 827ad9908e03ef7542d14d207e6f62b43c34f2db65f303c3918e97459487eedf
MD5 467031357342941e496efb216d8f3090
BLAKE2b-256 d196e9976412beef7701ceb4ba589b05e254e1ebd98c7884b37b9025dc981066

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page