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»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

21.72% of encryption in the second quarter of 2025

July 11, 2025

As Nano Labs begins to accumulate $ 1 billion, BNB gets a big supporter.

July 5, 2025

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

June 29, 2025
Add A Comment

Comments are closed.

Recent Posts

Encryption Inheritance: Industrial Round Up -January 20125

July 15, 2025

$TAC Token Debuts In TVL As TAC Mainnet Goes Live With Leading DeFi Protocols

July 15, 2025

MultiBank Group Announces 7 Million $MBG Tokens Sold Out In Under One Hour During Initial Pre-Sale

July 15, 2025

Allnodes Among First To Launch Bare Metal Servers Powered By AMD Threadripper 9000 Series

July 15, 2025

Global Cryptocurrency Investors Flock To DNSBTC After Bitcoin Surges

July 15, 2025

The BTC price is withdrawn at almost $ 123K height. XRP approaches the highest resistance ever at $ 3.00.

July 15, 2025

Easily Invest In DL Mining Cloud Mining And Earn $6,000 In Passive Income Every Day

July 15, 2025

Crypto Company is a bank license in the US during Ripple, Circle and Bito Target

July 14, 2025

HeraldEX Defines The Future With Its One-Stop Crypto Platform For Businesses

July 14, 2025

BSGM Engages CXG To Acquire FINRA/SEC-Registered Broker-Dealer To Expand Publicly Traded RWA Tokenization Operations

July 14, 2025

Tornado cash Roman storms insist on Doj Botched Key Telegram evidence.

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

Encryption Inheritance: Industrial Round Up -January 20125

July 15, 2025

$TAC Token Debuts In TVL As TAC Mainnet Goes Live With Leading DeFi Protocols

July 15, 2025

MultiBank Group Announces 7 Million $MBG Tokens Sold Out In Under One Hour During Initial Pre-Sale

July 15, 2025
Most Popular

Learn more about our fully licensed online slots casinos.

April 7, 2024

Are you happy with Bitcoin bulls? The analyst sees the US dollar weakness as a major catalyst.

February 7, 2025

Avalanche (AVAX) price falls as market turmoil continues.

May 11, 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.