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»Raw Transaction – Error: non-mandatory-script-verify-flag (Script failed operation OP_EQUALVERIFY)
BITCOIN NEWS

Raw Transaction – Error: non-mandatory-script-verify-flag (Script failed operation OP_EQUALVERIFY)

By Crypto FlexsFebruary 12, 20241 Min Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Raw Transaction – Error: non-mandatory-script-verify-flag (Script failed operation OP_EQUALVERIFY)
Share
Facebook Twitter LinkedIn Pinterest Email

Input transaction: single p2wpkh

Output transactions: single p2wsh and single p2wpkh

The following error means that my public key hashes are different when verified. It’s clear that my public key hashes match! The script code and implementation for generating the watch are as follows:

fn get_p2wpkh_scriptcode(utxo: Utxo) -> Vec<u8> 
    let mut script = Vec::new();
    
    script.push(0x19); // 25 bytes , script length

    script.push(0x76); // OP_DUP

    script.push(0xa9); // OP_HASH160

    script.push(0x14); // 20 bytes , public key hash length

    let pubkey_hash = extract_pubkey_hash(&utxo.script_pubkey); //takes last 20 bytes from the scriptpubkey of type 0x0014<pubkeyhash>
    
    script.extend_from_slice(&pubkey_hash); // (pubkey hash)
    
    //print the pubkey hash
    // let pubkey_hash_in_hex = hex::encode(&pubkey_hash);
    // println!("pubkey_hash_in_hex: :?", pubkey_hash_in_hex);

    script.push(0x88); // OP_EQUALVERIFY

    script.push(0xac); // OP_CHECKSIG

    script

    //OK

fn get_p2wpkh_witness(privkey: &(u8; 32), msg: Vec<u8>) -> Vec<u8> 

    let signature = sign(privkey, msg);
    let pubkey = derive_public_key_from_private(privkey);
    let mut witness = Vec::new();

    // let pubkey_hashed = hash160(&pubkey);
    // let pubkey_hashed_in_hex = hex::encode(&pubkey_hashed);
    // println!("pubkey_hashed_in_hex: :?", pubkey_hashed_in_hex);

    witness.push(0x02);
    let signature_length = signature.len() as u8;
    witness.push(signature_length); 
    witness.extend_from_slice(&signature);
    witness.push(0x21);
    witness.extend_from_slice(&pubkey);
    witness


RAW Signature Transactions

020000000001013ccb46c8366e39d7ff36df4f199813aa8b9dc4bed143a0eb9205cf698ca16298c401000000ffffffff0240420f00000000002200202d67ce38ba266a68f0f7c4668e9d0f5584c6da7c454bcc2368bf9fff10135157a086010000000000160014d765749aa66430b85765bdedee488f5fe3c82a8e02473044022062c000ca2cdfcd39de875d0b6a3f3da7af4e5c1ba07bb26e24cef8974cdc1c820220540f540a43027475fe359cc7ae98eddb6fbd09082ef9602c08669448e393d1e7012102d3428014dd5ccf1927c6dc164e6324e2c0945a9f50b84769592e195ae6a40e8a00000000

What other scenarios can cause this error?

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

The strategy has hit the highest market cap since the Rally Bitcoin rally.

July 17, 2025

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
Add A Comment

Comments are closed.

Recent Posts

Monarq Asset Management Appoints Sam Gaer As CIO To Lead Directional Strategy

July 21, 2025

Little PEPE surpasses $ 4 million in pre -sales, emerging as one of the main memes in 2025.

July 21, 2025

Bitcoin Price $ 123K Explosion -Trader Brace for Brake Out

July 20, 2025

Ether Lee Rium breaks $ 3K with 7,200% of the virus L2 coin eyes.

July 20, 2025

XRP Breaks Through $3.5! DL Mining Launches AI Cloud Mining Contracts, Earning Steady Profits Every Day

July 20, 2025

AAVE gains strength as AAVE dominates defect loans with net deposits of $ 50B or more.

July 19, 2025

As XRP Surges, DLMining Platform Opens New High-yield Cloud Mining Opportunities For Holders

July 19, 2025

Missed Out On Bitcoin At $9999? SIM Mining Cloud Mining Brings You New Opportunities For Wealth!

July 19, 2025

NFT is a rebound -there is a teenage NFTS this week.

July 19, 2025

MultiBank Group To List $MBG Token On Gate.io And MEXC During Official Token Generation Event

July 18, 2025

Earn $4,777 Daily! PaxMining Leads 2025’s Record-Breaking Bitcoin Mining Boom

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

Monarq Asset Management Appoints Sam Gaer As CIO To Lead Directional Strategy

July 21, 2025

Little PEPE surpasses $ 4 million in pre -sales, emerging as one of the main memes in 2025.

July 21, 2025

Bitcoin Price $ 123K Explosion -Trader Brace for Brake Out

July 20, 2025
Most Popular

GreenCoin Definitive Guide: How to Invest, Save the Planet, and Make Money at the Same Time – The Defi Info

February 14, 2024

54 Wallets That May Be Part of Binance’s Chainlink (LINK) Accumulation Institutions: Lookonchain

July 3, 2024

TRON DAO at Cornell Blockchain Conference

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