Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • TRADE
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • TRADE
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

Bitcoin is integrated into less than $ 108,000, but the eyes are set for $ 115,000.

June 29, 2025

Sequans starts $ 384M Bitcoin Treasury Initiative with Swan Bitcoin Partnership.

June 23, 2025

ECB Chairman Lagarde aims to seize the global order to strengthen the Euro’s global position.

June 17, 2025
Add A Comment

Comments are closed.

Recent Posts

Valhalla Goes Today: FLOKI has been developed for 3 years and debuts the play MMORPG.

July 4, 2025

The Open Platform Is First Unicorn In Web3 Ecosystem In Telegram At $1bn Valuation

July 3, 2025

The mindset of Retail Investors

July 3, 2025

Cooking.City Bringing Back Value Redistribution To Solana Fair Launches

July 3, 2025

XRP rebounds are interested in APT miners cloud mining.

July 3, 2025

The market will select US regulatory stable coins more than CBDCS every day of CBDCS every day.

July 3, 2025

Best Crypto PR Agency Packages : What to Look For & Where to Start

July 3, 2025

Looking for an Affordable Crypto PR Agency? Here’s What to Know Before You Spend

July 3, 2025

Crypto PR Packages for Startups: What You Need & How to Choose the Right One

July 3, 2025

Cheap Crypto Press Release: How to Promote Your Project Without Overpaying

July 2, 2025

The Ultimate Guide to Crypto Public Relations Packages

July 2, 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

Valhalla Goes Today: FLOKI has been developed for 3 years and debuts the play MMORPG.

July 4, 2025

The Open Platform Is First Unicorn In Web3 Ecosystem In Telegram At $1bn Valuation

July 3, 2025

The mindset of Retail Investors

July 3, 2025
Most Popular

How to get Magic Eden’s diamond rewards ahead of the NFT token airdrop

February 4, 2024

Taiko, ‘ZK rollup equivalent to Ethereum’, raises $15 million

March 2, 2024

Defi Development finds $ 1B to increase Solana Investments and expand the Treasury.

April 26, 2025
  • 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.