Skip to content
Meheret Tesfaye edited this page May 31, 2020 · 16 revisions

Wallet Class

pybytom.wallet.Wallet

Bytom has only three networks mainnet, solonet and testnet.

Parameter

network (str) - Bytom network, [defaults to solonet].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Initialize wallet from entropy

from_entropy() - Get Bytom wallet from entropy.

Parameter

entropy (str) - Entropy hex string, [required].
passphrase (str) - Secret password/passphrase, [defaults to None].
language (str) - Mnemonic language, [defaults to english].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Initialize wallet from mnemonic

from_mnemonic() - Get Bytom wallet from mnemonic.

Parameter

mnemonic (str) - 12 words mnemonic, [required].
passphrase (str) - Secret password/passphrase, [defaults to None].
language (str) - Mnemonic language, [defaults to None].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="testnet")
>>> wallet.from_mnemonic(mnemonic="舒 使 系 款 株 擾 麼 鄉 狗 振 誤 謀")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Initialize wallet from seed

from_seed() - Get Bytom wallet from seed.

Parameter

seed (str) - Mnemonic seed hex string, [required].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="solonet")
>>> wallet.from_seed(seed="baff3e1fe60e1f2a2d840d304acc98d1818140c79354a353b400fb019bfb256bc392d7aa9047adff1f14bce0342e14605c6743a6c08e02150588375eb2eb7d49")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Initialize wallet from xprivate_key

from_xprivate_key() - Get Bytom wallet from xprivate key.

Parameter

xprivate_key (str) - Bytom xprivate key, [required].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet()
>>> wallet.from_xprivate_key(xprivate_key="205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Drive wallet from indexes

from_indexes() - Drive Bytom wallet from indexes.

Parameter

indexes (list) - Bytom derivation indexes, [required].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet()
>>> wallet.from_xprivate_key(xprivate_key="205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Drive wallet from index

from_index() - Drive Bytom wallet from index.

Parameter

index (int) - Bytom derivation index, [required].
harden (bool) - BIP 32 key harden, [default to False].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet()
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64", language="japaneses")
>>> wallet.from_index(44)
>>> wallet.from_index(153)
>>> wallet.from_index(1)  # Account
>>> wallet.from_index(0)  # Change False(0)/True(1)
>>> wallet.from_index(1)  # Address
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Drive wallet from path

from_path() - Drive Bytom wallet from path.

Parameter

path (str) - Bytom derivation path, [required].

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet()
>>> wallet.from_mnemonic(mnemonic="舒 使 系 款 株 擾 麼 鄉 狗 振 誤 謀", passphrase="Hello Meheret!")
>>> wallet.from_path("m/44/153/1/0/1")
<pybytom.wallet.wallet.Wallet object at 0x040DA268>

Clean wallet derivation

clean_derivation() - Clean wallet derivation indexes/path.

Return

wallet (Wallet) - Bytom wallet class instance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic(mnemonic="舒 使 系 款 株 擾 麼 鄉 狗 振 誤 謀", passphrase="Hello Meheret!")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.indexes()
["2c000000", "99000000", "01000000", "00000000", "01000000"]
>>> wallet.path()
"m/44/153/1/0/1"
>>> wallet.clean_derivation()
>>> wallet.indexes()
[]
>>> wallet.path()
None

Get entropy

entropy() - Get wallet entropy.

Return

entropy (str) - Entropy hex string.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64", language="korean")
>>> wallet.entropy()
"8d7454bb99e8e68de6adfc5519cbee64"

Get mnemonic

mnemonic() - Get wallet mnemonic.

Return

mnemonic (str) - 12 word mnemonic.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64", language="italian")
>>> wallet.mnemonic()
"occasione pizzico coltivato cremoso odorare epilogo patacca salone fonia sfuso vispo selettivo"

Get passphrase

passphrase() - Get wallet secret password/passphrase.

Return

passphrase (str) - Secret password/passphrase.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64", passphrase="Hello Meheret!", language="italian")
>>> wallet.passphrase()
"Hello Meheret!"

Get language

language() - Get wallet mnemonic language.

Return

language (str) - Mnemonic language.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="solonet")
>>> wallet.from_entropy(entropy="8d7454bb99e8e68de6adfc5519cbee64", passphrase="Hello Meheret!", language="italian")
>>> wallet.language()
"italian"

Get seed

seed() - Get wallet mnemonic seed.

Return

seed (str) - Mnemonic seed hex string.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.seed()
"baff3e1fe60e1f2a2d840d304acc98d1818140c79354a353b400fb019bfb256bc392d7aa9047adff1f14bce0342e14605c6743a6c08e02150588375eb2eb7d49"

Get Bytom xprivate key

xprivate_key() - Get Bytom wallet xprivate key.

Return

xprivate_key (str) - Bytom wallet xprivate key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.xprivate_key()
"205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b"

Get Bytom xpublic key

xpublic_key() - Get Bytom wallet xpublic key.

Return

xpublic_key (str) - Bytom wallet xpublic key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.xpublic_key()
"16476b7fd68ca2acd92cfc38fa353e75d6103f828276f44d587e660a6bd7a5c5ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b"

Get Bytom expand xprivate key

expand_xprivate_key() - Get Bytom wallet expand xprivate key.

Return

expand_xprivate_key (str) - Bytom wallet expand xprivate key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.expand_xprivate_key()
"205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee5102416c643cfb46ab1ae5a524c8b4aaa002eb771d0d9cfc7490c0c3a8177e053e"

Get Bytom blockcenter GUID

guid() - Get Bytom wallet blockcenter guid.

Return

guid (str) - Bytom blockcenter guid.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.guid()
"f0ed6ddd-9d6b-49fd-8866-a52d1083a13b"

Get Bytom child xprivate key

child_xprivate_key() - Get Bytom wallet child xprivate key.

Return

child_xprivate_key (str) - Bytom wallet child xprivate key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.child_xprivate_key()
"e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get Bytom child xpublic key

child_xpublic_key() - Get Bytom wallet child xpublic key.

Return

child_xpublic_key (str) - Bytom wallet child xpublic key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.child_xpublic_key()
"91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e25803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get Bytom private key

private_key() - Get Bytom wallet private key.

Return

private_key (str) - Bytom wallet private key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.private_key()
"e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get Bytom public key

public_key() - Get Bytom wallet public key.

Return

public_key (str) - Bytom wallet public key.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.public_key()
"91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e2"

Get Bytom derivation indexes

indexes() - Get Bytom wallet derivation indexes.

Return

indexes (list) - Bytom derivation indexes.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_path("m/44/153/1/0/1")
>>> wallet.indexes()
["2c000000", "99000000", "01000000", "00000000", "01000000"]

Get Bytom derivation path

path() - Get Bytom wallet derivation path.

Return

path (str) - Bytom derivation path.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="solonet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.path()
"m/44/153/1/0/1"

Get Bytom control program

program() - Get Bytom wallet control program.

Return

program (str) - Bytom wallet control program.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="solonet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.program()
"00142cda4f99ea8112e6fa61cdd26157ed6dc408332a"

Get Bytom balance

balance() - Get Bytom asset balance.

Parameter

asset (str) - Bytom asset, [defaults to BTM asset].

Return

balance (int) - Bytom asset balance.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.balance()
2450000000

Get Bytom address

address() - Get Bytom wallet address.

Parameter

network (str) - Bytom network, [defaults to solonet].

Return

address (str) - Bytom wallet address.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet(network="mainnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.address()
"bm1q9ndylx02syfwd7npehfxz4lddhzqsve2fu6vc7"

Sign message

sign() - Sign message data by private key.

Parameter

message (str) - Message data hex string, [required].

Return

signature (dict) - Signed message data (signature).

>>> from pybytom.wallet import Wallet
>>> message = "1246b84985e1ab5f83f4ec2bdf271114666fd3d9e24d12981a3c861b9ed523c6"
>>> wallet = Wallet(network="testnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.sign(message=message)
"f6624fea84fadccbc1bc72dc384f662468e271c4e32d846bc0a1524470549992c8ffcc3ca43891a30de4235392b0868c506ed254f0f77cc1f2b9c1a2385ddb05"

Verify signature

verify() - Verify signature by public key.

Parameter

message (str) - Message data hex string, [required]. signature (str) - Signed message data, [required].

Return

signature (bool) - Verified signature (True/False).

>>> from pybytom.wallet import Wallet
>>> message = "1246b84985e1ab5f83f4ec2bdf271114666fd3d9e24d12981a3c861b9ed523c6"
>>> signature = "f6624fea84fadccbc1bc72dc384f662468e271c4e32d846bc0a1524470549992c8ffcc3ca43891a30de4235392b0868c506ed254f0f77cc1f2b9c1a2385ddb05"
>>> wallet = Wallet(network="testnet")
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.verify(message=message, signature=signature)
True

Get all Bytom wallet info's

dumps() - Get Bytom all wallet information's.

Parameter

guid (bool) - Bytom blockcenter GUID, [default to False].

Return

dumps (dict) - Bytom all wallet information's.

>>> from pybytom.wallet import Wallet
>>> wallet = Wallet()
>>> wallet.from_mnemonic("indicate warm sock mistake code spot acid ribbon sing over taxi toast")
>>> wallet.from_indexes(["2c000000", "99000000", "01000000", "00000000", "01000000"])
>>> wallet.dumps()
{'entropy': None, 'mnemonic': 'indicate warm sock mistake code spot acid ribbon sing over taxi toast', 'language': 'english', 'passphrase': None, 'seed': 'baff3e1fe60e1f2a2d840d304acc98d1818140c79354a353b400fb019bfb256bc392d7aa9047adff1f14bce0342e14605c6743a6c08e02150588375eb2eb7d49', 'xprivate_key': '205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b', 'xpublic_key': '16476b7fd68ca2acd92cfc38fa353e75d6103f828276f44d587e660a6bd7a5c5ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b', 'expand_xprivate_key': '205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee5102416c643cfb46ab1ae5a524c8b4aaa002eb771d0d9cfc7490c0c3a8177e053e', 'guid': None, 'indexes': ['2c000000', '99000000', '01000000', '00000000', '01000000'], 'path': 'm/44/153/1/0/1', 'child_xprivate_key': 'e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141', 'child_xpublic_key': '91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e25803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141', 'private_key': 'e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141', 'public_key': '91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e2', 'program': '00142cda4f99ea8112e6fa61cdd26157ed6dc408332a', 'address': {'mainnet': 'bm1q9ndylx02syfwd7npehfxz4lddhzqsve2fu6vc7', 'solonet': 'sm1q9ndylx02syfwd7npehfxz4lddhzqsve2gdsdcs', 'testnet': 'tm1q9ndylx02syfwd7npehfxz4lddhzqsve2d2mgc0'}}

Wallet Tools

pybytom.wallet.tools

Get xpublic key

get_xpublic_key() - Get Bytom xpublic key from xprivate key.

Parameter

xprivate_key (str) - Bytom xprivate key, [required].

Return

xpublic_key (str) - Bytom xpublic key.

>>> from pybytom.wallet.tools import get_xpublic_key
>>> get_xpublic_key("205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"16476b7fd68ca2acd92cfc38fa353e75d6103f828276f44d587e660a6bd7a5c5ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b"

Get expand xprivate key

get_expand_xprivate_key() - Get Bytom expand xprivate key from xprivate key.

Parameter

xprivate_key (str) - Bytom xprivate key, [required].

Return

expand_xprivate_key (str) - Bytom expand xprivate key.

>>> from pybytom.wallet.tools import get_expand_xprivate_key
>>> get_expand_xprivate_key("205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee5102416c643cfb46ab1ae5a524c8b4aaa002eb771d0d9cfc7490c0c3a8177e053e"

Change indexes to path

indexes_to_path() - Change derivation indexes to path.

Parameter

indexes (list) - Bytom derivation indexes, [required].

Return

path (str) - Bytom derivation path.

>>> from pybytom.wallet.tools import indexes_to_path
>>> indexes_to_path(["2c000000", "99000000", "01000000", "00000000", "01000000"])
"m/44/153/1/0/1"

Change path to indexes

path_to_indexes() - Change derivation path to indexes.

Parameter

path (str) - Bytom derivation path, [required].

Return

indexes (list) - Bytom derivation indexes.

>>> from pybytom.wallet.tools import path_to_indexes
>>> path_to_indexes("m/44/153/1/0/1")
["2c000000", "99000000", "01000000", "00000000", "01000000"]

Get child xprivate key

get_child_xprivate_key() - Get Bytom get child xprivate key.

Parameter

xprivate_key (str) - Bytom xprivate key, [required].
indexes (list) - Bytom derivation indexes, [default to INDEXES].
path (str) - Bytom derivation path, [default to None].

Return

child_xprivate_key (str) - Bytom child xprivate key.

>>> from pybytom.wallet.tools import get_child_xprivate_key
>>> get_child_xprivate_key("205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get child xpublic key

get_child_xpublic_key() - Get Bytom get child xpublic key.

Parameter

xpublic_key (str) - Bytom xpublic key, [required].
indexes (list) - Bytom derivation indexes, [default to INDEXES].
path (str) - Bytom derivation path, [default to None].

Return

child_xpublic_key (str) - Bytom child xpublic key.

>>> from pybytom.wallet.tools import get_child_xpublic_key
>>> get_child_xpublic_key("16476b7fd68ca2acd92cfc38fa353e75d6103f828276f44d587e660a6bd7a5c5ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e25803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get private key

get_private_key() - Get Bytom private key from xprivate key and this is also the same with get_child_xprivate_key() function.

Parameter

xprivate_key (str) - Bytom xprivate key, [required].
indexes (list) - Bytom derivation indexes, [default to INDEXES].
path (str) - Bytom derivation path, [default to None].

Return

private_key (str) - Bytom private key.

>>> from pybytom.wallet.tools import get_private_key
>>> get_private_key("205b15f70e253399da90b127b074ea02904594be9d54678207872ec1ba31ee51ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"e07af52746e7cccd0a7d1fba6651a6f474bada481f34b1c5bab5e2d71e36ee515803ee0a6682fb19e279d8f4f7acebee8abd0fc74771c71565f9a9643fd77141"

Get public key

get_public_key() - Get Bytom public key from xpublic key.

Parameter

xpublic_key (str) - Bytom xpublic key, [required].
indexes (list) - Bytom derivation indexes, [default to INDEXES].
path (str) - Bytom derivation path, [default to None].

Return

public_key (str) - Bytom public key.

>>> from pybytom.wallet.tools import get_public_key
>>> get_public_key("16476b7fd68ca2acd92cfc38fa353e75d6103f828276f44d587e660a6bd7a5c5ef4490504bd2b6f997113671892458830de09518e6bd5958d5d5dd97624cfa4b")
"91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e2"

Get program

get_program() - Get Bytom control program from public key.

Parameter

public_key (str) - Bytom public key, [required].

Return

program (str) - Bytom control program.

>>> from pybytom.wallet.tools import get_program
>>> get_program("91ff7f525ff40874c4f47f0cab42e46e3bf53adad59adef9558ad1b6448f22e2")
"00142cda4f99ea8112e6fa61cdd26157ed6dc408332a"

Get address

get_address() - Get Bytom address from program.

Parameter

program (str) - Bytom control program, [required].
network (str) - Bytom network, [default to solonet].

Return

address (str) - Bytom address.

>>> from pybytom.wallet.tools import get_address
>>> get_address("00142cda4f99ea8112e6fa61cdd26157ed6dc408332a", "mainnet")
"bm1q9ndylx02syfwd7npehfxz4lddhzqsve2fu6vc7"

Get vapor address

get_vapor_address() - Get Bytom vapor address from program.

Parameter

program (str) - Bytom control program, [required].
network (str) - Bytom network, [default to solonet].

Return

vapor_address (str) - Bytom vapor address.

>>> from pybytom.wallet.tools import get_vapor_address
>>> get_vapor_address("00142cda4f99ea8112e6fa61cdd26157ed6dc408332a", "mainnet")
"vp1q9ndylx02syfwd7npehfxz4lddhzqsve2za23ag"