Close Menu
  • Home
  • Bitcoin
    • Bitcoin Atm Machines
    • Bitcoin Books
      • Bitcoin Jobs
        • Bitcoin Price Prediction
        • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gifts
    • Bitcoin Gift Card
    • Bitcoin Mining
    • Bitcoin Wallets
  • Technology
  • Shop
    • Bitcoin Atm Machine
    • Bitcoin Coins
    • Bitcoin Coins, Wallets,Shirts,Books,Gifts
    • Bitcoin Mining Machine
    • Bitcoin Mining Machine Full Set Up
    • Computers and Accessories
    • USB Flash Drives
    • Mini Bitcoin Mining Machine
What's Hot

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

Tesla’s China Rivals Report Steady August Sales Performance Amid Intense Price Competition: What Investors Should Know – XPeng (NYSE:XPEV), NIO (NYSE:NIO), Li Auto (NASDAQ:LI)

March 18, 2025

IEEE President’s Note: Why Students Should Stay with IEEE

March 18, 2025
Facebook X (Twitter) Instagram
  • Bitcoin
  • Bitcoin Books
  • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gift Card
Facebook X (Twitter) Instagram
farm-bitcoin.com
  • Home
  • Bitcoin
    • Bitcoin Atm Machines
    • Bitcoin Books
      • Bitcoin Jobs
        • Bitcoin Price Prediction
        • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gifts
    • Bitcoin Gift Card
    • Bitcoin Mining
    • Bitcoin Wallets
  • Technology
  • Shop
    • Bitcoin Atm Machine
    • Bitcoin Coins
    • Bitcoin Coins, Wallets,Shirts,Books,Gifts
    • Bitcoin Mining Machine
    • Bitcoin Mining Machine Full Set Up
    • Computers and Accessories
    • USB Flash Drives
    • Mini Bitcoin Mining Machine
farm-bitcoin.com
Home » How to spend from a custom P2SH script using bitcore-lib
How to spend from a custom P2SH script using bitcore-lib
Bitcoin

How to spend from a custom P2SH script using bitcore-lib

adminBy adminMarch 18, 2025No Comments1 Min Read
Share
Facebook Twitter LinkedIn Pinterest Email


I could not find anywhere on the web about it. I was hopeless until I noticed that I could, without modifying the library.

First choose a similar class in Bitcore-lib.

  • multisigscripthash (<== suggested) or publickeyhash for P2SH outputs
  • multisig or publickey for bare script outputs (don’t use these, these are nonstandard)

Then copy it to a new file in your project such as this one**. Do not use typescript classes even if your project is of kind Typescript.

Then change require paths. Also require inherit from NPM. As in the boilerplates above, we need to inherit from Transaction.Input

A function such as “buildP2SHPushIn” in the example should produce the redeemscript. Remember, the last element of P2SH redeem scripts is a push of the P2SH script.

And finally use addInput instead of the higher-level function from to add inputs as shown here**


**The examples are for Bitcoin Cash, but they can be used the same way in Bitcoin. Do not copy from them, however!



Source link

Post Views: 31
bitcorelib custom P2SH script Spend
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
admin
  • Website

Related Posts

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

PEPE Whales Set Out To Be Bullish With FOLKI and Mpeppe (MPEPE) With 500x Gains Between Them

March 18, 2025

private key – Safest way of long term holding

March 18, 2025

Restoring trust and equity in the digital age through decentralized AI

March 18, 2025
Add A Comment
Leave A Reply Cancel Reply

Subscribe to Updates

Get the latest creative news from farm-bitcoin about crypto, bitcoin, business and technology.

Please enable JavaScript in your browser to complete this form.
Loading
About Us
About Us

At Farm Bitcoin, we are passionate about unlocking the potential of cryptocurrency and blockchain technology. Our mission is to make the world of digital currencies accessible and understandable for everyone, from beginners to seasoned investors. We believe that cryptocurrency represents the future of finance, and we are here to guide you through this exciting landscape.

Top Insights

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

Tesla’s China Rivals Report Steady August Sales Performance Amid Intense Price Competition: What Investors Should Know – XPeng (NYSE:XPEV), NIO (NYSE:NIO), Li Auto (NASDAQ:LI)

March 18, 2025

IEEE President’s Note: Why Students Should Stay with IEEE

March 18, 2025
Get Informed

Subscribe to Updates

Get the latest creative news from farm-bitcoin about crypto, bitcoin, business and technology.

Please enable JavaScript in your browser to complete this form.
Loading
Facebook X (Twitter) Instagram Pinterest
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
Copyright 2024 Farm Bitcoin Design By Prince Ayaan.

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

Go to mobile version