Bitcoinlib – Earlybirds Invest https://earlybirdsinvest.com Latest Crypto News Sat, 19 Jul 2025 00:18:49 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.8 https://i0.wp.com/earlybirdsinvest.com/wp-content/uploads/2024/12/cropped-New-Project-2024-12-17T235703.455.png?fit=32%2C32&ssl=1 Bitcoinlib – Earlybirds Invest https://earlybirdsinvest.com 32 32 240146708 Unable to get TapRoot address using Bitcoinlib https://earlybirdsinvest.com/unable-to-get-taproot-address-using-bitcoinlib/ https://earlybirdsinvest.com/unable-to-get-taproot-address-using-bitcoinlib/#respond Sat, 19 Jul 2025 00:18:49 +0000 https://earlybirdsinvest.com/unable-to-get-taproot-address-using-bitcoinlib/

I’ve tried several methods to get the Taproot address from the private key using Bitcoinlib, but I’ve continued to get a different address than what you get with a Taproot wallet, such as Unisat or OKX wallet.

Then, after many attempts, I found the command Address.parse And I tried to use it to get all the parameters of the address to replicate it.

Surprisingly, even if you create a class with exactly the same parameters and of course the same private key, the derived addresses will be different.

from bitcoinlib.keys import Key, Address

# keys are for testing purposes
private_key_hex = '25eee8288d42567475d1453843ce57b16b6ba5b6c0661cb2a439fff44c4d455d'
private_key_wif="KxVSwjuqNb6qe3KTLsHG5nYA3WFEqrjyKnGbwgHAreiWsqrwffuh"

k = Key(private_key_wif)
#k.info()
public_key_hex = '02fdf741bc2b1efe52873d748ca438798ad0133b25c388bc50423aed26df8ffbd7'
public_key_hex_uncompressed = '04fdf741bc2b1efe52873d748ca438798ad0133b25c388bc50423aed26df8ffbd7db6b1b700bd2475709f586d7a0105d29b0e4a3017b259e01bc32b220342ab33a'

addr = Address.parse('bc1pfkde37d8chuqa6tgwvp7rwmtl7vvd20ql6g5433xxpdah30t7nushrsrlu')
print(addr.as_dict())

testAddr = Address(
    data = public_key_hex,
    hashed_data = None,
    prefix = 'bc',
    script_type="p2tr",
    compressed = None,
    encoding = 'bech32',
    witness_type="taproot",
    witver = 1,
    depth = None,
    change = None,
    address_index = None,
    network = 'bitcoin',
    network_overrides = None
)
print(testAddr)

I’m not sure if the problem is that it doesn’t have a Bith32M encoding.

If anyone knows how to solve this problem or a workaround, they’ll be really appreciated!

]]>
https://earlybirdsinvest.com/unable-to-get-taproot-address-using-bitcoinlib/feed/ 0 48421
How can I get the actual balance of XPub in Python Bitcoinlib? https://earlybirdsinvest.com/how-can-i-get-the-actual-balance-of-xpub-in-python-bitcoinlib/ https://earlybirdsinvest.com/how-can-i-get-the-actual-balance-of-xpub-in-python-bitcoinlib/#respond Sun, 09 Mar 2025 13:23:59 +0000 https://earlybirdsinvest.com/how-can-i-get-the-actual-balance-of-xpub-in-python-bitcoinlib/

goal

Create a wallet feature for at least Watch only in Python. Included send I’ll be sitting in the future too.

detail

I’m already sharing my code on GitHub (in Python). I’m looking for some feedback and trying to clarify some of the concepts I lack.

You can make any ideas, but here are the specific questions I have. I’m a complete noob in the Bitcoin world, so some clarifications are appreciated.

question

  • Is that there? bitcoinlib Python library interface with Authentic Bitcoin blockchain? I understand that there are some kind of test chain where you can get free test coins. But is there a tutorial on how to use it, especially using the Python library?
  • Seed word generated data/seed.txt Using Blue Wallet (BW), XPUB exposed by BW matches what was returned by CustomWallet.get_xpub method. However, the receiving address from BW is do not have Match CustomWallet.get_address method. What does that mean? I understand that under Xpub there are multiple (infinite?) receiving addresses, but is that why?
  • If you send SATS to the address generated by CustomWallet.get_addressif initialized with the same species, will it appear in my blue wallet? And the other way around?
  • Should wallet.transactions(include_new=True) Please tell me about unconfirmed transactions. I have an unconfirmed transaction (in the actual blockchain I sent it from Trezor), but it doesn’t show up when calling a method in Python.
  • You should do Wallet.balance() Do you show the actual balance of a method blockchain wallet? I transferred some amount to the wallet that BW is displaying, but my code says it’s zero balance. What gives?
  • What is the best way to send and receive multiple transactions through code? Authentic Blockchain works as much as possible, but will it be wasted my sat?
]]>
https://earlybirdsinvest.com/how-can-i-get-the-actual-balance-of-xpub-in-python-bitcoinlib/feed/ 0 24153