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


Python Key.address方法代码示例

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


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

示例1: test_segwit_create_tx

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
    def test_segwit_create_tx(self):
        from pycoin.tx.tx_utils import create_tx, sign_tx
        from pycoin.tx.Spendable import Spendable
        from pycoin.tx.pay_to.ScriptPayToAddress import ScriptPayToAddress
        from pycoin.tx.pay_to.ScriptPayToAddressWit import ScriptPayToAddressWit
        from pycoin.tx.pay_to.ScriptPayToScriptWit import ScriptPayToScriptWit
        from pycoin.ui import address_for_pay_to_script_wit, script_obj_from_address
        key1 = Key(1)
        coin_value = 5000000
        script = ScriptPayToAddressWit(b'\0', key1.hash160()).script()
        tx_hash = b'\ee' * 32
        tx_out_index = 0
        spendable = Spendable(coin_value, script, tx_hash, tx_out_index)
        key2 = Key(2)
        tx = create_tx([spendable], [(key2.address(), coin_value)])
        self.check_unsigned(tx)
        sign_tx(tx, [key1.wif()])
        self.check_signed(tx)
        self.assertEqual(len(tx.txs_in[0].witness), 2)

        s1 = ScriptPayToAddress(key1.hash160()).script()
        address = address_for_pay_to_script_wit(s1)
        spendable.script = script_obj_from_address(address).script()
        tx = create_tx([spendable], [(key2.address(), coin_value)])
        self.check_unsigned(tx)
        sign_tx(tx, [key1.wif()], p2sh_lookup=build_p2sh_lookup([s1]))
        self.check_signed(tx)
开发者ID:Stevengu999,项目名称:pycoin,代码行数:29,代码来源:segwit_test.py

示例2: vanitygen

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def vanitygen(s):
    s = '1' + s.lower()
    l = len(s)
    while True:
        r = int.from_bytes(os.urandom(32), 'big')
        k = Key(secret_exponent=r)
        if k.address()[:l] == s:
            print('Address:', k.address())
            print('WIF:'. k.wif())
开发者ID:tortxof,项目名称:python-sandbox,代码行数:11,代码来源:btc_vanitygen.py

示例3: test_against_myself

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def test_against_myself():
    """
        Test code that verifies against ourselves only. Useful but not so great.
    """
    from pycoin.key import Key, msg_signing
    from pycoin.encoding import bitcoin_address_to_hash160_sec_with_prefix
    from pycoin.encoding import wif_to_tuple_of_secret_exponent_compressed
    from pycoin.key.msg_signing import parse_signed_message

    for wif, right_addr in [
                    ('L4gXBvYrXHo59HLeyem94D9yLpRkURCHmCwQtPuWW9m6o1X8p8sp',
                            '1LsPb3D1o1Z7CzEt1kv5QVxErfqzXxaZXv'),
                    ('5KYZdUEo39z3FPrtuX2QbbwGnNP5zTd7yyr2SC1j299sBCnWjss',
                            '1HZwkjkeaoZfTSaJxDw6aKkxp45agDiEzN'),
                ]:
        se, comp = wif_to_tuple_of_secret_exponent_compressed(wif)

        k = Key(secret_exponent=se, is_compressed=comp)
        assert k.address() == right_addr

        #print("\nAddr %s compressed=%s" % (right_addr, comp))

        vk = Key(public_pair=k.public_pair(), is_compressed=comp)
        assert vk.address() == right_addr

        h160, pubpre = bitcoin_address_to_hash160_sec_with_prefix(right_addr)
        vk2 = Key(hash160=h160)
        assert vk2.address() == right_addr

        for i in range(1, 30, 10):
            msg = 'test message %s' % ('A'*i)
            sig = msg_signing.sign_message(k, msg, verbose=1)
            #print(sig)
            assert right_addr in sig

            # check parsing works
            m,a,s = parse_signed_message(sig)
            assert m == msg, m
            assert a == right_addr, a

            sig2 = msg_signing.sign_message(k, msg, verbose=0)
            assert sig2 in sig, (sig, sig2)

            assert s == sig2, s

            ok = msg_signing.verify_message(k, sig2, msg)
            #print("verifies: %s" % ("Ok" if ok else "WRONG"))
            assert ok
开发者ID:opendime,项目名称:pycoin,代码行数:50,代码来源:msg_signing_test.py

示例4: _build_signature

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def _build_signature(key, certreqinfo, network):
    secret_exponent = encoding.to_long(256, encoding.byte_to_int, key[0][1].asOctets())[0]
    coin  = Key(secret_exponent=secret_exponent, netcode=network)
    print "building signature for %s address: %s" % (network, coin.address())
    pubkeybitstring = (key[0].getComponentByPosition(2), key[0].getComponentByPosition(3))
    certreqinfoder = encoder.encode(certreqinfo)
    hashvalue = SHA256.new(certreqinfoder)
    dgst = hashvalue.digest()
    dgstaslong = encoding.to_long(256, encoding.byte_to_int, dgst)[0]
    order2 = pycoin.ecdsa.generator_secp256k1.order()
    ## random sign
    generator = pycoin.ecdsa.generator_secp256k1
    rawsig2 = randomsign(generator, secret_exponent, dgstaslong)
    ## deterministic sign
    ##rawsig2 = pycoin.ecdsa.sign(pycoin.ecdsa.generator_secp256k1, secret_exponent, dgstaslong)
    r2, s2 = rawsig2
    print "signature: r: %x s: %x" % (r2, s2)
    if not pycoin.ecdsa.verify(generator, coin.public_pair(), dgstaslong, rawsig2):
        raise SignatureVerifyException("Generated signature r: %x s: %x does not verify against public key %s" % (r2, s2, public_pair))
    signature = ECDSASigValue()
    signature.setComponentByName('r', r2)
    signature.setComponentByName('s', s2)
    dersig = encoder.encode(signature)
    signaturevalue = "'{0}'H".format(binascii.hexlify(dersig))
    bitstring = univ.BitString( value=signaturevalue )
    return rfc2314.Signature( bitstring )
开发者ID:1-Hash,项目名称:UTXOC,代码行数:28,代码来源:utxocsr.py

示例5: test_repr

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
    def test_repr(self):
        key = Key(secret_exponent=273, netcode='XTN')

        address = key.address()
        pub_k = Key.from_text(address)
        self.assertEqual(repr(pub_k),  '<mhDVBkZBWLtJkpbszdjZRkH1o5RZxMwxca>')

        wif = key.wif()
        priv_k = Key.from_text(wif)
        self.assertEqual(repr(priv_k), 'private_for <0264e1b1969f9102977691a40431b0b672055dcf31163897d996434420e6c95dc9>')
开发者ID:Stevengu999,项目名称:pycoin,代码行数:12,代码来源:key_validate_test.py

示例6: test_script_type_pay_to_public_pair

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
 def test_script_type_pay_to_public_pair(self):
     for se in range(1, 100):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             addr = key.address(use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
开发者ID:Bluejudy,项目名称:pycoin,代码行数:12,代码来源:pay_to_test.py

示例7: test_script_type_pay_to_address

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
 def test_script_type_pay_to_address(self):
     for se in range(1, 100):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             addr = key.address(use_uncompressed=b)
             st = script_obj_from_address(addr)
             self.assertEqual(st.address(), addr)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
开发者ID:Bluejudy,项目名称:pycoin,代码行数:12,代码来源:pay_to_test.py

示例8: test_solve_pay_to_public_pair

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
 def test_solve_pay_to_public_pair(self):
     for se in range(1, 10):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             addr = key.address(use_uncompressed=b)
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             hl = build_hash160_lookup([se])
             sv = 100
             solution = st.solve(hash160_lookup=hl, sign_value=sv, signature_type=SIGHASH_ALL)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
开发者ID:Bluejudy,项目名称:pycoin,代码行数:15,代码来源:pay_to_test.py

示例9: test_solve_pay_to_address

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
 def test_solve_pay_to_address(self):
     for se in range(1, 10):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             addr = key.address(use_uncompressed=b)
             st = script_obj_from_address(addr)
             self.assertEqual(st.address(), addr)
             hl = build_hash160_lookup([se])
             sv = 100
             solution = st.solve(hash160_lookup=hl, signature_for_hash_type_f=const_f(sv), signature_type=SIGHASH_ALL)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
开发者ID:Stevengu999,项目名称:pycoin,代码行数:15,代码来源:pay_to_test.py

示例10: _gen

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
	def _gen (self):
		logger.debug ('Generating entropy for new wallet...')

		# Generate entropy
		entropy = bytearray()
		try:
			entropy.extend(open("/dev/random", "rb").read(64))
		except Exception:
			print("warning: can't use /dev/random as entropy source")
		entropy = bytes(entropy)

		if len(entropy) < 64:
			raise OSError("can't find sources of entropy")

		secret_exponent = int(binascii.hexlify (entropy)[0:32], 16)
		wif = secret_exponent_to_wif(secret_exponent, compressed=True, wif_prefix=wif_prefix_for_netcode (self.chain))
		key = Key (secret_exponent=secret_exponent, netcode=self.chain)
		return (str (key.address ()), str (key.wif ()))
开发者ID:contractvm,项目名称:libcontractvm,代码行数:20,代码来源:Wallet.py

示例11: main

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def main():
    parser = argparse.ArgumentParser(
        description='utxocsr.py by MiWCryptoCurrency for UTXOC UTXO based certificate signing request generation (CSR).'
    )
    parser.add_argument('-k', '--key', required=True, type=argparse.FileType('r'), help='Private EC Key')
    parser.add_argument('-f', '--filename', required=True, help='Output CSR Filename')
    parser.add_argument('-n', "--network", help='specify network (default: BTC = Bitcoin)',
                               default='BTC', choices=NETWORK_NAMES)
    parser.add_argument('-t', "--transactionid", required=False, help='transaction id (hex)')
    inputkey=""
    args = parser.parse_args()
    out = args.filename
    network = args.network
    while True:
            line = args.key.readline().strip()
            if not line: break
            inputkey += line + '\n'
    parsed_key = decoder.decode(utility.read_ec_private_pem(inputkey), asn1Spec=utility.ECPrivateKey())
    secret_exponent = encoding.to_long(256, encoding.byte_to_int, parsed_key[0][1].asOctets())[0]
    coin  = Key(secret_exponent=secret_exponent, netcode=network)
    pubaddr = coin.address(use_uncompressed=False)

    if (network=="BTC"):
        uriname = "bitcoin"
    elif (network=="NMC"):
        uriname = "namecoin"
    elif (network=="LTC"):
        uriname = "litecoin"
    elif (network=="DOGE"):
        uriname = "dogecoin"
    elif (network=="BLK"):
        uriname = "blackcoin"

    if not args.transactionid:
        print "Please enter transaction hash to reference in certificate. Leave blank to only encode the address."
        transactionid = raw_input()
        if transactionid == "":
            uri = uriname + ":" + pubaddr
        else:
            uri = uriname + ":" + pubaddr + "?" + "transaction=" + transactionid
    else:
        transactionid = args.transactionid
        uri = uriname + ":" + pubaddr + "?" + "transaction=" + transactionid
    dn = ""
    dn_c = raw_input("Please enter Country (eg: US): ")
    if (dn_c == ""):
        dn_c = "US"
    dn_st = raw_input("Please enter State (eg: California): ")
    if (dn_st == ""):
        dn_st = "California"
    dn_l = raw_input("Please enter City (eg: Sunnyvale): ")
    if (dn_l == ""):
        dn_l = "Sunnyvale"
    dn_o = raw_input("Please enter Organization (eg: Widgets Inc.): ")
    if (dn_o == ""):
        dn_o = "Widgets Inc."
    dn_ou = raw_input("Please enter Organization Unit: (eg: Information Security): ")
    if (dn_ou == ""):
        dn_ou = "Information Security"
    dn_cn = raw_input("Please enter Common Name: (eg: My first UTXOC): ")
    if (dn_cn == ""):
        dn_cn = "My first UTXOC"
    san = raw_input("Please enter Subject Alt Name values (DNS name, blank for none, seperate multiple entries with space): ")
    sanentry = []
    if (san == ""):
        sanentry = 'URI:%s' % uri
    else:
        for entry in san.split(" "):
            sanentry.append('DNS:%s' % entry)
        sanentry.append('URI:%s' % uri)
    dn = "/C=" + dn_c + "/ST=" + dn_st + "/L=" + dn_l + "/O=" + dn_o + "/OU=" + dn_ou + "/CN=" + dn_cn

    attributes={
        'extensionRequest': (
            ('x509basicConstraints', True,
             (False,)),
            ('subjectAlternativeName', False,
             sanentry
            ),
        )
    }

    create_csr_ec(parsed_key, dn, csrfilename=out, attributes=attributes, network=network)
开发者ID:1-Hash,项目名称:UTXOC,代码行数:85,代码来源:utxocsr.py

示例12: secret_to_address

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def secret_to_address(secret_exponent):
    k = Key(secret_exponent=secret_exponent)
    addr = k.address(use_uncompressed=True)
    caddr = k.address()
    wif = k.wif(use_uncompressed=True)
    return secret_exponent, wif, addr, caddr
开发者ID:billy8407,项目名称:bitcoin-privatekey-db,代码行数:8,代码来源:server.py

示例13: _test_sighash_single

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
    def _test_sighash_single(self, netcode):
        k0 = Key(secret_exponent=PRIV_KEYS[0], is_compressed=True, netcode=netcode)
        k1 = Key(secret_exponent=PRIV_KEYS[1], is_compressed=True, netcode=netcode)
        k2 = Key(secret_exponent=PRIV_KEYS[2], is_compressed=True, netcode=netcode)
        k3 = Key(secret_exponent=PRIV_KEYS[3], is_compressed=True, netcode=netcode)
        k4 = Key(secret_exponent=PRIV_KEYS[4], is_compressed=True, netcode=netcode)
        k5 = Key(secret_exponent=PRIV_KEYS[5], is_compressed=True, netcode=netcode)

        # Fake a coinbase transaction
        coinbase_tx = Tx.coinbase_tx(k0.sec(), 500000000)
        coinbase_tx.txs_out.append(TxOut(1000000000, pycoin_compile('%s OP_CHECKSIG' % b2h(k1.sec()))))
        coinbase_tx.txs_out.append(TxOut(1000000000, pycoin_compile('%s OP_CHECKSIG' % b2h(k2.sec()))))

        self.assertEqual('2acbe1006f7168bad538b477f7844e53de3a31ffddfcfc4c6625276dd714155a',
                b2h_rev(coinbase_tx.hash()))

        # Make the test transaction
        txs_in = [
            TxIn(coinbase_tx.hash(), 0),
            TxIn(coinbase_tx.hash(), 1),
            TxIn(coinbase_tx.hash(), 2),
        ]
        txs_out = [
            TxOut(900000000, standard_tx_out_script(k3.address())),
            TxOut(800000000, standard_tx_out_script(k4.address())),
            TxOut(800000000, standard_tx_out_script(k5.address())),
        ]
        tx = Tx(1, txs_in, txs_out)
        tx.set_unspents(coinbase_tx.txs_out)

        self.assertEqual('791b98ef0a3ac87584fe273bc65abd89821569fd7c83538ac0625a8ca85ba587', b2h_rev(tx.hash()))

        sig_type = SIGHASH_SINGLE

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[0].script, 0, sig_type)
        self.assertEqual('cc52d785a3b4133504d1af9e60cd71ca422609cb41df3a08bbb466b2a98a885e', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k0, sig_hash, sig_type)
        self.assertTrue(sigcheck(k0, sig_hash, sig[:-1]))

        tx.txs_in[0].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(0))

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[1].script, 1, sig_type)
        self.assertEqual('93bb883d70fccfba9b8aa2028567aca8357937c65af7f6f5ccc6993fd7735fb7', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k1, sig_hash, sig_type)
        self.assertTrue(sigcheck(k1, sig_hash, sig[:-1]))

        tx.txs_in[1].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(1))

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[2].script, 2, sig_type)
        self.assertEqual('53ef7f67c3541bffcf4e0d06c003c6014e2aa1fb38ff33240b3e1c1f3f8e2a35', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k2, sig_hash, sig_type)
        self.assertTrue(sigcheck(k2, sig_hash, sig[:-1]))

        tx.txs_in[2].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(2))

        sig_type = SIGHASH_SINGLE | SIGHASH_ANYONECANPAY

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[0].script, 0, sig_type)
        self.assertEqual('2003393d246a7f136692ce7ab819c6eadc54ffea38eb4377ac75d7d461144e75', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k0, sig_hash, sig_type)
        self.assertTrue(sigcheck(k0, sig_hash, sig[:-1]))

        tx.txs_in[0].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(0))

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[1].script, 1, sig_type)
        self.assertEqual('e3f469ac88e9f35e8eff0bd8ad4ad3bf899c80eb7645947d60860de4a08a35df', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k1, sig_hash, sig_type)
        self.assertTrue(sigcheck(k1, sig_hash, sig[:-1]))

        tx.txs_in[1].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(1))

        sig_hash = tx.signature_hash(coinbase_tx.txs_out[2].script, 2, sig_type)
        self.assertEqual('bacd7c3ab79cad71807312677c1788ad9565bf3c00ab9a153d206494fb8b7e6a', b2h(to_bytes_32(sig_hash)))

        sig = sigmake(k2, sig_hash, sig_type)
        self.assertTrue(sigcheck(k2, sig_hash, sig[:-1]))

        tx.txs_in[2].script = pycoin_compile(b2h(sig))
        self.assertTrue(tx.is_signature_ok(2))
开发者ID:Bluejudy,项目名称:pycoin,代码行数:91,代码来源:sighash_single_test.py

示例14: main

# 需要导入模块: from pycoin.key import Key [as 别名]
# 或者: from pycoin.key.Key import address [as 别名]
def main():
    parser = argparse.ArgumentParser(
        description='ECkey2coin.py by [email protected] for UTXO based Certificates UTXOC.',
        epilog='Known networks codes:\n  ' \
                + ', '.join(['%s (%s)'%(i, full_network_name_for_netcode(i)) for i in NETWORK_NAMES])
    )
    parser.add_argument('-k', '--key', required=False, type=argparse.FileType('r'), help='The EC private key in PEM format')
    parser.add_argument('-q', '--qrfilename', required=False, help='QR code output filename')
    parser.add_argument('-n', "--network", help='specify network (default: BTC = Bitcoin)',
                                default='BTC', choices=NETWORK_NAMES)
    args = parser.parse_args()
    network = args.network
    inputprivatekey = ''
    if args.key:
        keyfile = args.key        
        while True:
            line = keyfile.readline().strip()
            if not line: break
            inputprivatekey += line + '\n'
        print 'Loaded EC Key from %s' % keyfile
    else:    
        print ('Please enter EC KEY in pem format:')
        inputprivatekey  = ''
        while True:
            line = raw_input().strip()
            if not line: break
            inputprivatekey += line + '\n'
    if not args.qrfilename:
        qrfilename = raw_input("Please enter qrcode output filename: ")
    else:
        qrfilename = args.qrfilename
    pkey = decoder.decode(read_pem(inputprivatekey), asn1Spec=ECPrivateKey())
    print 'Key loaded'
    if not isValidECKey(pkey[0]):
        print "EC Key Supplied cannot be used"
        exit
    print "Key Validated OK"
    inputkey = encoding.to_long(256, pycoin.encoding.byte_to_int, pkey[0][1].asOctets())[0]
    if inputkey:
        key = Key(secret_exponent=inputkey, netcode=network)
        btcsecret = key.secret_exponent()
        btcpublic = key.public_pair()
        hash160_c = key.hash160(use_uncompressed=False)
        hash160_u = key.hash160(use_uncompressed=True)
        qrimg = qrcode.QRCode (
            version=1,
            error_correction=qrcode.constants.ERROR_CORRECT_L,
            box_size=10,
            border=4,
        )
        qrimg.add_data(key.address(use_uncompressed=False))
        qrimg.make(fit=True)
        img = qrimg.make_image()
        img.save(qrfilename)
    print"----------------- BEGIN EC PRIVATE KEYS -----------------"
    print "Secret:     %d" % btcsecret
    print "Secret hex: %x" % btcsecret
    print "wif:        %s" % key.wif(use_uncompressed=False)
    print "----------------- END EC PRIVATE KEYS -----------------------------"
    print "----------------- BEGIN PUBLIC KEY -----------------------------"
    print "Public X: %d" % btcpublic[0]
    print "Public Y: %d" % btcpublic[1]
    print "hash160 uncompressed: %s" % b2h(hash160_u)
    print "Sec: (uncompressed): %s" % b2h(key.sec(use_uncompressed=True))
    print "%s address: %s (uncompressed)" % (key._netcode, key.address(use_uncompressed=True))
    print "Public X (hex): %x" % btcpublic[0]
    print "Public Y (hex): %x" % btcpublic[1]
    print "Sec: %s" % b2h(key.sec(use_uncompressed=False))
    print "hash160 compressed: %s" % b2h(hash160_c)
    print "----------------- END PUBLIC KEYS -----------------------------"
    print "------------------ BEGIN %s ADDRESSES -------------------------" % key._netcode
    print "%s address: %s" % (key._netcode, key.address(use_uncompressed=False))
    print "------------------ END %s ADDRESSES -------------------------" % key._netcode
开发者ID:1-Hash,项目名称:UTXOC,代码行数:75,代码来源:eckey2coin.py


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