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.1.tar.gz (70.3 kB view details)

Uploaded Source

Built Distributions

bittensor_wallet-2.1.1-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.1-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.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (752.5 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

bittensor_wallet-2.1.1-cp312-cp312-macosx_10_12_x86_64.whl (797.7 kB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

bittensor_wallet-2.1.1-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.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (752.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

bittensor_wallet-2.1.1-cp311-cp311-macosx_10_12_x86_64.whl (800.0 kB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

bittensor_wallet-2.1.1-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.1-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.1-cp310-cp310-macosx_11_0_arm64.whl (751.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

bittensor_wallet-2.1.1-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.1-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.1-cp39-cp39-macosx_11_0_arm64.whl (752.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for bittensor_wallet-2.1.1.tar.gz
Algorithm Hash digest
SHA256 06588cd15b5d2173548bbe6d5e30ea08c4e7c4a1f5eda76fc48a83a426499bf6
MD5 9b1a6b346d5698b180387bb0f74754ff
BLAKE2b-256 65f8d0c267ec4f13a1eb3e3733a3314f3b2f958e929f56cae8b6b4236116900a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5eb3a698d351b7a1311bd95df669dbf8e6d3138a7ce7e2fed07739146e09fc9
MD5 adce1270d3962dd5d46c5ac8777bc241
BLAKE2b-256 da06436c282452682a729e2d63c958ca109b240f8610b86083a7d5449e1c367a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 9339aeb690095d18c615f616140a25f7163717aedf75502a7b5dffbc60ea9c4c
MD5 0cb890064a8650eed595f34f1e13ec10
BLAKE2b-256 7f614db737092b85d0820038274a093cb8116245de6da76f708c0aead603e9a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 405f1c72d15405adc44859066c1a3c3220a6d19430ef582f3aeeaa7ebf87f565
MD5 4e7c747dcf40ba23d2b19ea1315cc0c6
BLAKE2b-256 ca649400ab0a686402c2c957436452e5ad07de916c1c6912b6ec26b608587b0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 b461daa2de078bc43bdf85848c96b19d15a21233cc6c8820c565d558d4f35320
MD5 771c438cd38f426d4484e6f992a72036
BLAKE2b-256 4454cefbc6e56e2f3a497e4986d5d1b1b18ce240dc85a6848eb10ae0f6a9b4bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef05cbf77d11c37291b427d15dc1dc197564493fe6c4f73d87f6f16667a76026
MD5 4c744a6033bf83026f21fb5ab97a5b7a
BLAKE2b-256 7c13e6a35a314774780cd730fdbde1e596d4766547256ad2e267fb91b3073f8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 087727dc7cbe677141e049226849e2aea9717f05fb1d55af9b9679aff4fc0cd2
MD5 e1d1b75886e55fe410784135d2585cb2
BLAKE2b-256 cfdaa6eea85cb8da6e495704ca4dea02929c58c5cde3fe236ab44d4b12d9f164

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e44335b1a8e106aaf9950ce2b353982fad009188e4cc6cac0e8a104b90c68ff
MD5 38371da5771a856698de5f11ff46609a
BLAKE2b-256 3e83b263ecb7cbb6a21c42102b58c7168927b267e35bb1895e48509bb4a1bc6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 7e52b0184aa389399193c0fec0bedc6a4bd5e59f9141b0e68efffe0300b4ac97
MD5 f355d42989a208288c11206f5b90ea55
BLAKE2b-256 7cacb8eb819dcbf46471dc7783846bd4f93bbd196e28a57ce9f7d48723457782

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d1e336b3d4a2e8eabe6a9963ddd7dd3c4e0fc530a7d7be0611617500625d2a0
MD5 6445e0ec6f7174618100a5a7f544a975
BLAKE2b-256 ecc384bc2b0454440287ce645f515860f94afe3bd94e57eb0614da70ea5a93e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 797f7ce5fda6fa1e86b3e9b7feeb969e21bc17071c293898d1e1eacce2a8bfc8
MD5 2dcd4c727eafa53bc59b974a052783c9
BLAKE2b-256 8c9507ecd657de5b96fdebd20be323a2d67d36238577d89a0f01d20a6dfe94c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ae74f7cbfc7ac9f78c3222e418e65320339f4d5ffd9ac866e3dd388e16ab5ad
MD5 eb9e7e5a8b0a60d6d6f128828173802a
BLAKE2b-256 0649a9c7425673727cc277e459bbacf00846505b7208284f87216941157ac237

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 219b05d692b41c5123e5772ea9bdfb38d94d58919fb0013748adeb47ef24b2be
MD5 e4d51f20c3208b3b07278bccac908605
BLAKE2b-256 11b0cb45b838066021bb5fdc19cb7b208f1023f878fafd81d429aa4c4efa4627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 accfd722b2160023b63cbe8a838b13200dbfacfef4fb6eb52836af1e41c2de90
MD5 edbb61e6a50e5492d3402d44fa239ece
BLAKE2b-256 72287c3d906c183eeb89be670f69359a9ec72649c0d9c0ad9b381787ba95960b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e05b39047170767770a7918bdc9bf11fd86b23d0c3b850a18af41314878f23a
MD5 9dafa89513c98ba2a74d774ce291a910
BLAKE2b-256 defd6dfea5398fa90692e2d0f0813030891b1800f46dc75a83eed1cf89c96335

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 58df0024d1ab2d7c9de6e4ed597c32b30b68258a23230fcc76afe75c18fa5eb9
MD5 bf811344e8a25265de0532ccf0ac3fdd
BLAKE2b-256 cf7298ce7ebce3c5f1e79a224f17f7328943021a0579b4bc564a4b933cd9bc21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 559ad67dfd2c6330564c01d18f38c263d7bbf49d0645489f16e8d358f5e2dbe4
MD5 1f7bf9cfb2144b6cc6fc90c317c9b20b
BLAKE2b-256 c81cd184be37980dfbb50e1ff72a478c9d36896072298c077083ceda8eaaca70

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