当前位置: 首页>>代码示例>>Python>>正文


Python BIP32_Account.derive_pubkey_from_xpub方法代码示例

本文整理汇总了Python中account.BIP32_Account.derive_pubkey_from_xpub方法的典型用法代码示例。如果您正苦于以下问题:Python BIP32_Account.derive_pubkey_from_xpub方法的具体用法?Python BIP32_Account.derive_pubkey_from_xpub怎么用?Python BIP32_Account.derive_pubkey_from_xpub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account.BIP32_Account的用法示例。


在下文中一共展示了BIP32_Account.derive_pubkey_from_xpub方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import derive_pubkey_from_xpub [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    else:
        pubkey = x_pubkey
    return pubkey
开发者ID:Geopay,项目名称:electrum-gridcoin,代码行数:14,代码来源:transaction.py

示例2: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import derive_pubkey_from_xpub [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ['02','03','04']:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    else:
        raise BaseException("Cannnot parse pubkey")
    return pubkey
开发者ID:Lexiks,项目名称:electrum,代码行数:16,代码来源:transaction.py

示例3: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import derive_pubkey_from_xpub [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ['02','03','04']:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    elif x_pubkey[0:2] == 'fd':
        addrtype = ord(x_pubkey[2:4].decode('hex'))
        hash160 = x_pubkey[4:].decode('hex')
        pubkey = None
        address = hash_160_to_bc_address(hash160, addrtype)
    else:
        raise BaseException("Cannnot parse pubkey")
    if pubkey:
        address = public_key_to_bc_address(pubkey.decode('hex'))
    return pubkey, address
开发者ID:akshayaurora,项目名称:electrum,代码行数:23,代码来源:transaction.py

示例4: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import derive_pubkey_from_xpub [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ["02", "03", "04"]:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == "ff":
        from account import BIP32_Account

        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == "fe":
        from account import OldAccount

        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode("hex"), s[0], s[1])
    elif x_pubkey[0:2] == "fd":
        addrtype = ord(x_pubkey[2:4].decode("hex"))
        hash160 = x_pubkey[4:].decode("hex")
        pubkey = None
        address = hash_160_to_bc_address(hash160, addrtype)
    else:
        raise BaseException("Cannnot parse pubkey")
    if pubkey:
        address = public_key_to_bc_address(pubkey.decode("hex"))
    return pubkey, address
开发者ID:justinvforvendetta,项目名称:electrum-boli,代码行数:25,代码来源:transaction.py


注:本文中的account.BIP32_Account.derive_pubkey_from_xpub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。