예제 #1
0
NETWORK = "testnet"
# Sender passphrase/password
SENDER_PASSPHRASE = "Boom!"
# Hash Time Lock Contract (HTLC) bytecode
HTLC_BYTECODE = "63aa20821124b554d13f247b1e5d10b84e44fb1296f18f38bbaa1bea34a12c843e01588876" \
                "a914acf8419eecab574c494febbe03fd07fdae7bf2f488ac6702e803b27576a9141d0f671c" \
                "26a3ef7a865d1eda0fbd085e98adcc2388ac68"
# Bitcoin fund amount
AMOUNT = 10_000

print("=" * 10, "Sender Bitcoin Account")

# Initializing sender Bitcoin wallet
sender_wallet = Wallet(network=NETWORK)
# Initializing Bitcoin wallet from passphrase
sender_wallet.from_passphrase(passphrase=SENDER_PASSPHRASE)
# Getting sender wallet information's
sender_private_key = sender_wallet.private_key()
print("Sender Private Key:", sender_private_key)
sender_public_key = sender_wallet.public_key()
print("Sender Public Key:", sender_public_key)
sender_compressed = sender_wallet.compressed()
print("Sender Compressed:", sender_compressed)
sender_uncompressed = sender_wallet.uncompressed()
print("Sender Uncompressed:", sender_uncompressed)
sender_address = sender_wallet.address()
print("Sender Address:", sender_address)
sender_hash = sender_wallet.hash()
print("Sender Hash:", sender_hash)
sender_p2pkh = sender_wallet.p2pkh()
print("Sender P2PKH:", sender_p2pkh)
예제 #2
0
파일: claim.py 프로젝트: gitter-badger/swap
NETWORK = "testnet"
# Bitcoin transaction id/hash
TRANSACTION_ID = "86b21bf4ac171dac4483dc063353b4db3f91541c81e93c66449542b314ed0f8b"
# Recipient passphrase/password
RECIPIENT_PASSPHRASE = "Woo!"
# Sender Bitcoin address
SENDER_ADDRESS = "miAcLpYbaqE8KowBu2PwvqXG6y6vpQcfTJ"
# Bitcoin claim amount
AMOUNT = 10_000

print("=" * 10, "Recipient Bitcoin Account")

# Initializing recipient Bitcoin wallet
recipient_wallet = Wallet(network=NETWORK)
# Initializing Bitcoin wallet from passphrase
recipient_wallet.from_passphrase(passphrase=RECIPIENT_PASSPHRASE)
# Getting recipient wallet information's
recipient_private_key = recipient_wallet.private_key()
print("Recipient Private Key:", recipient_private_key)
recipient_public_key = recipient_wallet.public_key()
print("Recipient Public Key:", recipient_public_key)
recipient_compressed = recipient_wallet.compressed()
print("Recipient Compressed:", recipient_compressed)
recipient_uncompressed = recipient_wallet.uncompressed()
print("Recipient Uncompressed:", recipient_uncompressed)
recipient_address = recipient_wallet.address()
print("Recipient Address:", recipient_address)
recipient_hash = recipient_wallet.hash()
print("Recipient Hash:", recipient_hash)
recipient_p2pkh = recipient_wallet.p2pkh()
print("Recipient P2PKH:", recipient_p2pkh)