Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
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

Morgan Stanley’s Bitcoin ETF has been a huge success.

July 24, 2026

FTX plans to pay $900 million to creditors when the fifth distribution begins on July 31.

July 18, 2026

Saylor’s strategic message doesn’t help push the Bitcoin story, says StanChart.

July 12, 2026
Add A Comment

Comments are closed.

Recent Posts

Stocks surpass cryptocurrencies in Hyperliquid. ARK says it changes everything

July 25, 2026

AAVE Price Prediction: $100 is the wall. Factors that can destroy or bury a wall include:

July 25, 2026

Morgan Stanley’s Bitcoin ETF has been a huge success.

July 24, 2026

Ethereum price could spark a new uptrend above $1,550.

July 24, 2026

As market sentiment weakens, DOGE falls below $0.070.

July 24, 2026

RISEx Launches ‘Ignite’ Season 1 Points Program, Following $3B in Volume During the Early Access Phase

July 24, 2026

MEXC Expands Ondo Tokenized Stock Offerings with AI Infrastructure and Mining Assets

July 24, 2026

Crypto Press Releases Continue to Drive Visibility, Trust, and Long-Term Growth for Blockchain Projects

July 24, 2026

CoinRabbit and GoMining Report: Managing Bitcoin Matters More Than Mining Volume

July 23, 2026

MEXC CEO Vugar Usi Marks First 100 Days, Outlines Vision for Responsible Growth and Infinite Opportunities

July 23, 2026

Games Not on GamStop: Tactical Bonus Systems and Flexible Reward Mechanics

July 23, 2026

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

Stocks surpass cryptocurrencies in Hyperliquid. ARK says it changes everything

July 25, 2026

AAVE Price Prediction: $100 is the wall. Factors that can destroy or bury a wall include:

July 25, 2026

Morgan Stanley’s Bitcoin ETF has been a huge success.

July 24, 2026
Most Popular

‘Bitcoin reserves or nothing’ — Ripple comes under fire for pushing multi-asset reserves

January 24, 2025

Nigeria launches first multilingual large language model to drive AI development in Africa

April 21, 2024

The Nigerian company flourished as the CBEX collapsed.

April 20, 2025
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2026 Crypto Flexs

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