Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
Crypto Flexs
Home»BITCOIN NEWS»utxo – Chain 2 transactions in the same block with bitcoinlib in Python
BITCOIN NEWS

utxo – Chain 2 transactions in the same block with bitcoinlib in Python

By Crypto FlexsDecember 9, 20231 Min Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
utxo – Chain 2 transactions in the same block with bitcoinlib in Python
Share
Facebook Twitter LinkedIn Pinterest Email

I asked yesterday if it is possible to have a tx from A to B and B to C in the same block. The second tx consumes the first UTXO (B’s initial balance is 0).

Apparently it is: Can two related “spends” be in the same block?

But now I’m trying to test this with bitcoinlib in Python. My code is:

wallet = Wallet.create('MyWallet',
                        keys = seed_phrase,
                        witness_type = "segwit")

address = wallet.get_key(0).address
address2 = wallet.get_key(1).address
address3 = wallet.get_key(2).address

wallet.transactions_update()

fee = 1_000
send_value = wallet.balance() - fee

tx = wallet.send( ((address2, send_value)),
                    fee = fee,
                    offline = True)

wallet.transaction_import(tx)

send_value2 = send_value - fee

tx2 = wallet.send( ((address3, send_value2)), 
                     account_id = 1,
                     fee = fee,
                     offline = True)

The first tx works fine since the first address has a balance, but the second address fails with:

WalletError: Create transaction: No unspent transaction outputs found or no key available for UTXO's

The problem seems to be getting the first tx for the wallet.

Any ideas on how to fix this? thank you

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Apple, X, Airbnb Eye Stablecoin Integration

June 7, 2025

Does Ethereum start their business? MorningStar Candlestick Pattern tells the story

June 6, 2025

Bitcoin Is An Unreplicable Lifeline In Authoritarian Regimes

June 6, 2025
Add A Comment

Comments are closed.

Recent Posts

How does it affect Bitcoin?

June 7, 2025

Gala Games introduces a step -by -step approach to founder node staking.

June 7, 2025

AB starts in binance

June 7, 2025

ETF publisher’s latest warning -SEC’s approval process ‘Innovation, AIDS GIANTS’

June 7, 2025

Solana (SOL) introduces Alpenglow for faster blockchain agreement.

June 7, 2025

The Foresight Ventures report shows a collection shift where more than 32,000 sellers around the world accept encryption.

June 7, 2025

$ AB is live on Binance, guiding the new era of new cross chain asset mobility.

June 7, 2025

Trump memoin is faced with a $ 520m lock in July and the price drops by 85%.

June 7, 2025

Vaneck launches GPZ ETF for alternative asset managers.

June 7, 2025

Apple, X, Airbnb Eye Stablecoin Integration

June 7, 2025

Strategy to raise almost $ 1B by STRD priority proposal for BTC accumulation

June 7, 2025

Crypto Flexs is a Professional Cryptocurrency News Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of Cryptocurrency. We hope you enjoy our Cryptocurrency News as much as we enjoy offering them to you.

Contact Us : Partner(@)Cryptoflexs.com

Top Insights

How does it affect Bitcoin?

June 7, 2025

Gala Games introduces a step -by -step approach to founder node staking.

June 7, 2025

AB starts in binance

June 7, 2025
Most Popular

Devcon VI: Last week to apply for first tickets and speakers

December 20, 2023

Why TrumpCoin is the future of cryptocurrency – Find out now! – DeFi information

February 29, 2024

Solana ETF Plans Are Moving Forward, Cboe Makes SEC Filing Official

July 10, 2024
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2025 Crypto Flexs

Type above and press Enter to search. Press Esc to cancel.