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»Bitcoin Core-Trying to use UTXO as a custom script
BITCOIN NEWS

Bitcoin Core-Trying to use UTXO as a custom script

By Crypto FlexsMarch 31, 20252 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Bitcoin Core-Trying to use UTXO as a custom script
Share
Facebook Twitter LinkedIn Pinterest Email

To unlock, the lock script is 15 and the maximum value is smaller than 8. Therefore, Python performed this script, replicated the top 3, checked whether it was under 15 years of age, and checked for less than 15.

ex2a_txout_scriptPubKey = (OP_3DUP,OP_8,OP_LESSTHAN,OP_VERIFY,OP_8,OP_LESSTHAN,OP_VERIFY,OP_8,OP_LESSTHAN,OP_VERIFY,OP_ADD,OP_ADD,OP_15,OP_EQUALVERIFY)

Send it with this function response = send_from_P2PKH_transaction(amount_to_send, txid_to_spend, utxo_index, ex2a_txout_scriptPubKey)

def send_from_P2PKH_transaction(amount_to_send, txid_to_spend, utxo_index, txout_scriptPubKey):
    # Step 1: Create the txin
    txin = CMutableTxIn(COutPoint(lx(txid_to_spend), utxo_index)) #now we have txin

    # Step 2: Create the txout
    txout = CMutableTxOut(amount_to_send * COIN, CScript(txout_scriptPubKey))

    # Step 3: Create the transaction
    tx = CMutableTransaction((txin), (txout))

    # Step 4: Create the txin_scriptPubKey (from the address holding the UTXO)
    txin_scriptPubKey = my_address.to_scriptPubKey()

    # Step 5: Create the signature
    sig = create_OP_CHECKSIG_signature(tx, txin_scriptPubKey, my_private_key)

    # Step 6: Set the txin's scriptSig value (signature + public_key)
    txin.scriptSig = CScript((sig, my_public_key))

    # Verify the transaction
    VerifyScript(txin.scriptSig, txin_scriptPubKey, tx, 0, (SCRIPT_VERIFY_P2SH,))

    # Broadcast the transaction
    return broadcast_transaction(tx)

It works at Classic P2PKH, but when using txout_scriptpubKey, the response is as follows.

`400 Bad Request sendrawtransaction RPC error -26: scriptpubkey`

Thank you for your help. I don’t know where I was wrong on the script. I used 8 first, but I thought I had to use OP_8, but it still doesn’t work. Edit: Also not accept it "(OP_5, OP_EQUAL)". You can’t accept anything other than p2pkh.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Bitcoin aims for $ 115K after US CPI data prefers investors.

June 11, 2025

Paris can be traded!

June 11, 2025

Controversy over the names of BIP177 and Bitcoin?

June 10, 2025
Add A Comment

Comments are closed.

Recent Posts

$ 7.5m kilo X hacking inside

June 15, 2025

Encryption horror and greed index: Israel-high in Iran’s tension

June 15, 2025

The Etther Leeum Foundation supports the Tornado Cash Dev for $ 500K.

June 14, 2025

How to implement encryption for B2B repetitive revenue and payment?

June 14, 2025

How to claim vault12 promotional code for Android and iOS

June 13, 2025

How Locals Went From Ordinary People To Billionaires, And You Can Do It Too!

June 13, 2025

Seize The Opportunity! Fans Hash Is Giving Away $500 For A Limited Time To Help You Easily Unlock Crypto Wealth And Open A New Chapter Of Wealth.

June 13, 2025

Portfolio construction for Q3: The reason for combining chainlink (link) and pol (EX-MATIC) can be a victory strategy.

June 13, 2025

Polemos Announces TGE And A Game-Changing Strategic Partnership With BUFF Accelerating Web3 Adoption

June 12, 2025

​Bitpanda Opens The Gate To Web3 With Vision (VSN)

June 12, 2025

New USDT/USDC Stablecoin Mining Platform Launches — Secure, Flexible, And High-Yield DeFi Opportunity

June 12, 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

$ 7.5m kilo X hacking inside

June 15, 2025

Encryption horror and greed index: Israel-high in Iran’s tension

June 15, 2025

The Etther Leeum Foundation supports the Tornado Cash Dev for $ 500K.

June 14, 2025
Most Popular

Stashes Announces $STSH Token Presale with Multi-Chain Accessibility

September 21, 2024

Crypto experts say now is the time to get into Dogecoin. Here’s why:

April 2, 2024

Altcoin ‘euphoria’ phase begins when market cap increases by 16% — Trader

December 30, 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.