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

Uploaded Source

Built Distributions

bittensor_wallet-2.0.3-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.0.3-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.0.3-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.0.3-cp312-cp312-macosx_11_0_arm64.whl (750.3 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

bittensor_wallet-2.0.3-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.0.3-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.0.3-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.0.3-cp311-cp311-macosx_11_0_arm64.whl (750.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

bittensor_wallet-2.0.3-cp311-cp311-macosx_10_12_x86_64.whl (794.5 kB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

bittensor_wallet-2.0.3-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.0.3-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.0.3-cp310-cp310-macosx_11_0_arm64.whl (751.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

bittensor_wallet-2.0.3-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.0.3-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.0.3-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.0.3.tar.gz.

File metadata

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

File hashes

Hashes for bittensor_wallet-2.0.3.tar.gz
Algorithm Hash digest
SHA256 9609d1ca64d2613e7735fd02f14bd8e86c23c990f5c75aff916ca585381ef1f4
MD5 692d0bef30b707b30f35b9f36d09b532
BLAKE2b-256 14540578be4e3d7b5d2b91b9f5d282f109ef65af5022ed0de9198e8101b8cc50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 931161eb48bc257285f17fb850c94185837901dc66e0bd3c79eb2fb7b8d8f46d
MD5 110216d16eba59c4f8f86db330281464
BLAKE2b-256 a38abe50b956c7b4e0b7cec3920ce3c6a10cbee32e27fb6d3ae5c23377b5cb02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 f95967f4ae71f420875679b9e08506f987aee106a50a2ccbeaf660f5b1876883
MD5 e7a33e2d89ed452fb5219a096b549e24
BLAKE2b-256 e208074a3ac1746cffd07fac37bae24cd127910c16460d91818cc8cdbbd466e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44034d7b61aadc700fa4ec3fc77d6cd764d1cf8455d0aa197770f4018817c4fa
MD5 cedf9cb1a1abed90bafe22f09a7b88eb
BLAKE2b-256 d0aad1e233f5fb3c370079582cf641694651464d625bb3a94a746f0e4f1b1b84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 91784cfd00eaf731e9427fcb6c348d17c3bc871bdfa4ddbea35fa8176a80a198
MD5 3d34c6902af3385b10c30343a483fd5c
BLAKE2b-256 bd82f32fe74f04076c27a0edcfb6a25b78b877ce920c0ad1206466c8b88bd92e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7648fc9505fafb672c139dc6a81f03f0426972fb195e0910020e1a7cf369d24b
MD5 09eccbe866f0ca38b513581a68eabe82
BLAKE2b-256 3b67dbb648e57d0cf3b47c347873c8bf696fbb7b6b779c3a4c7a7515ab8234ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 10cddf36a8d7f4b6b52b1c91281c394a06ede1a3c4384ee7308f01012b27ee14
MD5 e74626747832ef33984361b9d1257dc8
BLAKE2b-256 6cae6870c26051c9dcaa647a3705005d75b66b6388f2959c8b62988d05e9c570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc0514ad290515cac9a2ec8c7abafb053c087097ec7996236796a94ce08416e3
MD5 6afb60c28a3bb9ddd54ce7619d0f8ed8
BLAKE2b-256 893de6d790abae0e0fdf484abf092ceaa676ec100b850a7c9148b2aa68912f6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 7869dc3eb4097e8e2cf3e91aa4b8d35728e9f2101dee0eb4bb8f02be005de9b6
MD5 4b4915b43ab31ef13816f5005c5b2308
BLAKE2b-256 c23f524debd9b451bd68b5ac03961cbbced94b28c8547826541e4c7000855adb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 777adb51fbd502db45af6ea2bc760bf7a5e816136e367f7637a745db09ee3404
MD5 687cccfe8284fe447503de67a586e922
BLAKE2b-256 879f4df2d1ca6061866105139985054e74512181a635c7b3115e4b07ba525e52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 345706298554446a4033b5cc22b472808d469b634162e934e225aecb6222ffb2
MD5 fb508d3ba0ad95eacb747474df73bbfa
BLAKE2b-256 ba1af73e6fa6df8bf5a194738af3a331c07a0ebabc1977bd213610aedade7a41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41975ff4b6561ed2f6f79a040a5c9d6a9e6e42233220875c5815019ab7944320
MD5 d1042738e69a53220055717dd0c9fef8
BLAKE2b-256 95f534d0f3ca2c08f048470aa30e3db1a91678bfdd3cc44d4de0a2880e00f807

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 993bef8fc17f942d476f84cd209374d18c2b9bc875b35978fb9aee583edeba13
MD5 d44cbe1639ac773e77a721f022acf7d4
BLAKE2b-256 7efef8152fe03aedcbeeb53ad430dc1a0770c1862f98a970f9521b3c27387a2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49a44f80e05a78cb3439adeefa76179a3c8439d9232a17e4bf84abe32036ef28
MD5 3105c0744a0043f56c6c41410b05f467
BLAKE2b-256 07ab5194e601329dc741eee511538a1fafa8315f5502b5bbf4eb238be64acc10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e0dc1c513f32696a40fac30a072d5aa40c982d566840f8524a1918e9ce3a65f
MD5 fba3a2920ed63052d98791622054548b
BLAKE2b-256 bb768eb8f4bdcb645189cc26c09cab5d51e225f57f2131dd9cd45e2ccc7d3b8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 b8419d0d5d9b783c52bfd4b0211818ab31ef418635244143fa0679c5085e458a
MD5 8b2d573a2e8cdb13dc83bb3d746b11b3
BLAKE2b-256 7c20ada2c59f5e97d16c699fd1b721f2b6b3e7da3bb3ff407f60fb52f9c709b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bittensor_wallet-2.0.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 beef0968ce2ce7d4c66717580d8c9fdcb224173ae2ce7bfe92009280ac5d6406
MD5 06974b7803a1d2e313d0e73091dc26ff
BLAKE2b-256 7b80051d8664557f727dfd5bffd27c19589bbdc88d969838c48fee6b5a90b447

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