The Cryptonomics™
  • Home
  • Blockchain
  • Bitcoin
  • Ethereum
  • NFTS
  • Altcoin
  • Mining
  • Consulting
Reading: ordinals – I can not create NFT as a result of “`mandatory-script-verify-flag-failed (Invalid Schnorr signature)”}“`?
Share
Please enter CoinGecko Free Api Key to get this plugin works.
The Cryptonomics™The Cryptonomics™
Font ResizerAa
Search
  • Home
  • Blockchain
  • Bitcoin
  • Ethereum
  • NFTS
  • Altcoin
  • Mining
  • Consulting
Follow US
  • About Us
  • Advertising Solutions
  • Privacy
  • Terms
  • Advertise
Copyright © MetaMedia™ Capital Inc, All right reserved
The Cryptonomics™ > Bitcoin > ordinals – I can not create NFT as a result of “`mandatory-script-verify-flag-failed (Invalid Schnorr signature)”}“`?
Bitcoin

ordinals – I can not create NFT as a result of “`mandatory-script-verify-flag-failed (Invalid Schnorr signature)”}“`?

admin
Last updated: February 1, 2025 4:46 pm
admin Published February 1, 2025
Share
ordinals – I can not create NFT as a result of “`mandatory-script-verify-flag-failed (Invalid Schnorr signature)”}“`?


I create assortment efficiently however I can not create nft

import * as ecc from 'tiny-secp256k1';
import * as bitcoin from "bitcoinjs-lib";
import * as cbor from 'cbor';
import { Pockets } from "./pockets";
import { Shopper } from "./shopper";
import { tweakSigner } from './utils';

bitcoin.initEccLib(ecc);

const SEND_UTXO_LIMIT = 100;

const TESTNET_FEERATE = 20;

export class Nft extends Shopper {
  collectionAddress: string;
  parentInscriptionTXID: string;
  
  constructor({ collectionAddress, parentInscriptionTXID }) {
    tremendous();
    this.collectionAddress = collectionAddress;
    this.parentInscriptionTXID = parentInscriptionTXID;
  }

  async deploy(pockets: Pockets, { metadata, commonContentUrl,  itemOwnerAddress }) {
    const txidBuffer = Buffer.from(this.parentInscriptionTXID, 'hex');
    const inscriptionBuffer = txidBuffer.reverse();
    
    const metaProtocol: Buffer = Buffer.concat([Buffer.from("parcel.bitmap", "utf8")]);

    const pointer1: quantity = 546 * 1;
    const pointerBuffer1: Buffer = Buffer.from(pointer1.toString(16).padStart(4, '0'), 'hex').reverse();

    const contentBufferData: Buffer = this.contentBuffer(commonContentUrl);
    const contentBufferArray: Array = this.splitBuffer(contentBufferData, 400);

    const ordinal_script = this.createTapscript({
      metadata, 
      publicKey: pockets.internalPubkey,
      inscriptionBuffer,
      pointerBuffer1: pointerBuffer1,
      metaProtocol,
      contentBufferArray
    });

    const scriptTree = {
      output: ordinal_script,
    };

    const redeem = {
      output: ordinal_script,
      redeemVersion: 192,
    };

    const internalPubkey = pockets.internalPubkey;

    const ordinal_p2tr = bitcoin.funds.p2tr({
      internalPubkey,
      community: pockets.community,
      scriptTree,
      redeem,
    });

    let utxos, utxo, psbt;
    // utxos = await this.getUTXO(pockets.deal with);
    // utxo = utxos.discover((utxo) => utxo.worth > SEND_UTXO_LIMIT);
    // if (utxo === undefined) throw new Error("No btcs");
    // let redeemPsbt = pockets.redeemSendUTXOPsbt(utxo);
    // redeemPsbt = pockets.signPsbt(redeemPsbt);
    // let redeemFee = redeemPsbt.extractTransaction().virtualSize();
    // //4532b27cf67d922318ad473b601a67192ee212679e39e50130cdc517d3595c44
    // psbt = pockets.sendUTXOPsbt(utxo, redeemFee, ordinal_p2tr.deal with);
    // let signerOfPsbt = pockets.signPsbt(psbt)
    // const txHex = signerOfPsbt.extractTransaction().toHex();
    // await this.sendTransaction(txHex);

    // Получаем UTXO
    utxos = await this.getUTXO(ordinal_p2tr.deal with);

    // console.log(await this.waitUntilUTXO(ordinal_p2tr.deal with));
    if (!utxos || utxos.size === 0) {
      throw new Error("No UTXOs discovered.");
    }
  
    utxo = utxos.discover((utxo: any) => utxo.worth > SEND_UTXO_LIMIT);
    if (utxo === undefined) throw new Error("No btcs");
    psbt = new bitcoin.Psbt({ community: pockets.community });
    //tb1ppfqcpem2kd0l9dymat0uxdtv54cz4npty87yk2ctnj6vtk47zxjs9xac6d


    //const parentInscriptionUTXOs = await this.getUtxos(this.collectionAddress);
    // console.log(this.collectionAddress, parentInscriptionUTXOs, "parentInscriptionUTXOs");
    // return;
    const parentInscriptionUTXO = {
      txid: this.parentInscriptionTXID,
      vout: 0,
      worth: 526
    }
    psbt.addInput({
      hash: parentInscriptionUTXO.txid,
      index: parentInscriptionUTXO.vout,
      witnessUtxo: {
        worth: parentInscriptionUTXO.worth,
        script: pockets.output,
      },
      tapInternalKey: internalPubkey
    });

    psbt.addInput({
      hash: utxos[0].txid,
      index: utxos[0].vout,
      tapInternalKey: internalPubkey,
      witnessUtxo: { worth: utxos[0].worth, script: ordinal_p2tr.output! },
      tapLeafScript: [
        {
          leafVersion: redeem.redeemVersion,
          script: redeem.output,
          controlBlock: ordinal_p2tr.witness![ordinal_p2tr.witness!.length - 1],
        },
      ],
    });

    psbt.addOutput({
      deal with: itemOwnerAddress, //Vacation spot Deal with
      worth: 546,
    });

    psbt.addOutput({
      deal with: itemOwnerAddress, //Vacation spot Deal with
      worth: 546,
    });
    const price = 1200000;

    const change = utxos[0].worth - 546 * 1;
    console.log(change, 'change');

    const signer = tweakSigner(pockets, psbt);
    psbt.signInput(0, signer);
    psbt.signInput(1, pockets.keyPair);
    psbt.finalizeAllInputs()
    const tx = psbt.extractTransaction();
    console.log(tx.virtualSize())
    console.log(tx.toHex());
    return this.pushTransaction(tx.toHex());
  }
  
  contentBuffer = (content material: string) => {
    return Buffer.from(content material, 'utf8')
  }

  splitBuffer = (buffer: Buffer, chunkSize: quantity) => {
    let chunks = [];
    for (let i = 0; i < buffer.size; i += chunkSize) {
      const chunk = buffer.subarray(i, i + chunkSize);
      chunks.push(chunk);
    }
    return chunks;
  };

  createTapscript({
    metadata,
    publicKey,
    inscriptionBuffer,
    pointerBuffer1,
    metaProtocol,
    contentBufferArray
  }) {
    const metadataBuffer = cbor.encode(metadata);
    const childOrdinalStacks = [
      publicKey,
      bitcoin.opcodes.OP_CHECKSIG,
      bitcoin.opcodes.OP_FALSE,
      bitcoin.opcodes.OP_IF,
      Buffer.from("ord", "utf8"),
      1, 1,
      Buffer.concat([Buffer.from("text/plain;charset=utf-8", "utf8")]),
      1, 2,
      pointerBuffer1,
      1, 3,
      inscriptionBuffer,
      1, 5,
      metadataBuffer,
      1, 7,
      metaProtocol,
      bitcoin.opcodes.OP_0,
    ];

    contentBufferArray.forEach((merchandise: Buffer) => {
      childOrdinalStacks.push(merchandise)
    });
    childOrdinalStacks.push(bitcoin.opcodes.OP_ENDIF)
    console.log(childOrdinalStacks);
    return bitcoin.script.compile(childOrdinalStacks);
  }
}

My hash
020000000001022f46fff10752aca1cf98a36f0176f4cbbdb22cc510d4ceddc972b76d0ce2cd020000000000ffffffff3a28cb2ac63846cdb0751c3ce87b2745a4a4bbdbeb85e02225e2d8b952eee18d0000000000ffffffff022202000000000000225120932a0391d2ec13cb8f303ded9297ece089f739b3ced40bc98eebdd277fdb9c9d2202000000000000225120932a0391d2ec13cb8f303ded9297ece089f739b3ced40bc98eebdd277fdb9c9d014070a9429d26549e9c451f0ae1ea4855b7d7bbcd2f726179b72ca227c26c2833fad94026a13d25e23870d472a7013f395b3840b1fe6bcd86eb8d75189bf88eb9510340ba9b3c4973046074ab49faca606e09874fc7b43abccaccca15ce29d35fcae62eac1dadc4fb460b0342d5431972d7f2a86160325c0e5dec831182adf376ff8545e8206705021108c86f6f7249e85d233414afa8eeaadaea2bad863b2ccce504126879ac0063036f7264010118746578742f706c61696e3b636861727365743d7574662d3801020222020103202f46fff10752aca1cf98a36f0176f4cbbdb22cc510d4ceddc972b76d0ce2cd02010528a264747970656b54657374204e46542023316b6465736372697074696f6e6954657374205465737401070d70617263656c2e6269746d6170003f68747470733a2f2f617277656176652e6e65742f4933326c517668673341514c583444632d334e48557773434e366e75382d6c78477352634e7765336372346821c06705021108c86f6f7249e85d233414afa8eeaadaea2bad863b2ccce50412687900000000

Assortment deal with tb1ptewa8cpn7a9562s8saakyqdtlm34q6xjx7d7vp8x99sxx7kr8resvfp9x6
Mother or father Inscription Tx 02cde20c6db772c9ddced410c52cb2bdcbf476016fa398cfa1ac5207f1ff462f



Supply hyperlink

You Might Also Like

Coinbase Denies Attacking Binance as Alleged Media Leak Fuels Trade Tensions

Technique Co-Founder Hints at One other Bitcoin Buy

Kraken expands entry throughout LATAM, launching native funding in Argentina and Mexico

Snoop Dogg Drops NFT Presents on Telegram

Bitcoin Turns up the Warmth: Problem Jumps Almost 8% as Payouts Dip

Share This Article
Facebook Twitter Email Copy Link Print
Previous Article Bitcoin and Ethereum ETFs see 5M in inflows as SEC swiftly approves Bitwise’s new mixed fund Bitcoin and Ethereum ETFs see $655M in inflows as SEC swiftly approves Bitwise’s new mixed fund
Next Article High Crypto Gainers As we speak Feb 1- Fuel, NEO, Kava, Brett High Crypto Gainers As we speak Feb 1- Fuel, NEO, Kava, Brett
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe to our newslettern

Get Newest Articles Instantly!

- Advertisement -
Ad imageAd image
Popular News
Ethereum Breaks Essential ,800 Degree — Can Bulls Maintain For Main Rally?
Ethereum Breaks Essential $2,800 Degree — Can Bulls Maintain For Main Rally?
The journey to a mature asset administration system
The journey to a mature asset administration system
High 3 Meme Coin Gems Price Shopping for Earlier than Could 2024 – PEPE, WIF, and DOGEVERSE
High 3 Meme Coin Gems Price Shopping for Earlier than Could 2024 – PEPE, WIF, and DOGEVERSE

Follow Us on Socials

We use social media to react to breaking news, update supporters and share information

Facebook Instagram Linkedin Pinterest Tiktok Twitter Youtube
The Cryptonomics™

Cryptonomics Magazine is your premier digital source for blockchain insights, offering cutting-edge research, news, interviews, and ICO updates for everyone from entrepreneurs to institutions. We drive blockchain knowledge and growth.

Subscribe to our newsletter

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

Ethereum Breaks Essential $2,800 Degree — Can Bulls Maintain For Main Rally?
July 14, 2025
UK Banks Shouldn’t Challenge Stablecoins
July 14, 2025
Lloyds acquires Thriveni & advances inexperienced mining at Surjagarh challenge
July 14, 2025
Grok Reward For Hitler Triggers ‘MechaHitler’ Meme Coin Frenzy
July 14, 2025
Coinbase Denies Attacking Binance as Alleged Media Leak Fuels Trade Tensions
July 14, 2025
Copyright © The Cryptonomics™ , All right reserved
  • About Us
  • Advertising Solutions
  • Privacy
  • Terms
  • Advertise
Join Us!

Subscribe & Stay Ahead of the Curve with Cryptonomics !

Zero spam, Unsubscribe at any time.
Welcome Back!

Sign in to your account

Lost your password?