Wallet can be thought of as a group of user accounts. Each wallet has its own seed. A private key that represents an account can be generated by hashing the seed and a nonce.
In Python SDK we have a Wallet
class that represents a wallet on the VSYS blockchain.
The seed of the wallet.
import py_vsys as pv
# wal: pv.Wallet
print(wal.seed)
Example output
Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)
Register a new wallet(i.e. generate a new seed)
import py_vsys as pv
wal = pv.Wallet.register()
print(wal)
Example output
<py_vsys.account.Wallet object at 0x10650bc40>
Instantiate Wallet
from an existing seed.
import py_vsys as pv
seed_str = "choose icon security demise fashion robot file dune green play social define clump hedgehog issue"
wal = pv.Wallet.from_seed_str(seed_str)
print(wal.seed)
seed = pv.Seed(seed_str)
wal = pv.Wallet(seed)
print(wal.seed)
Example output
Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)
Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)
Get the Account
object for a certain nonce.
import py_vsys as pv
# ch: pv.Chain
wal = pv.Wallet.register()
acnt0 = wal.get_account(chain=ch, nonce=0)
print(acnt0.addr)
acnt1 = wal.get_account(chain=ch, nonce=1)
print(acnt1.addr)
Example output
Addr(ATraTqyhkHfbMAJawsyZeikkgS3nxy2iM5A)
Addr(AUCkJmLvAYsHjS9vV9NZ32XJ5BBYGPvvatJ)