Example #1
0
 def get_xpub(self, path: List[int]):
     return wally.bip32_key_to_base58(self.derive_key(path), wally.BIP32_FLAG_KEY_PUBLIC)
Example #2
0
 def xpub(self):
     return wally.bip32_key_to_base58(self.extkey,
                                      wally.BIP32_FLAG_KEY_PUBLIC)
Example #3
0
    # calculate mnemonic
    mnemonic = wally.bip39_mnemonic_from_bytes(None, entropy)

    # calculate the seed
    seed = bytearray(64)
    password = ''
    wally.bip39_mnemonic_to_seed(mnemonic, password, seed)

    # calculate master key
    master_key = wally.bip32_key_from_seed(seed, master_key_flags, wally.BIP32_FLAG_SKIP_HASH)
    if args.verbose > 1:
        print('::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::')
        print('Seed:                  {}'.format(seed.hex()))
        print('Mnemonic:              {}'.format(mnemonic))
        print('Master key:            {}'.format(wally.bip32_key_to_base58(master_key, 0)))
        print('::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::')

    # derive a children
    found = False
    for x in range(0, args.children + 1):
        child = x
        if args.hardened == True:
            child = child + 0x80000000
        derived = wally.bip32_key_from_parent_path(master_key, path + [child],  wally.BIP32_FLAG_KEY_PRIVATE);

        if args.verbose > 1:
            print('Derivation:            {}/{}{}'.format(args.derivation, x, hardened_notation))

        if args.address == 'native_segwit':
            # calculate native segwit address
Example #4
0
 def xprv(self):
     return wally.bip32_key_to_base58(self.extkey,
                                      wally.BIP32_FLAG_KEY_PRIVATE)
Example #5
0
 def to_b58(self) -> str:
     return wally.bip32_key_to_base58(self.extkey, self.bip32_flag)