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

By no means Drink Alone: A Information to Turkish Espresso

May 31, 2025

Bono Tells Joe Rogan That 300,000 Folks Have Died From DOGE-Led USAID Cuts: Elon Musk Calls Him A Liar, Says ‘Zero Folks Have Died’

May 31, 2025

The transaction historical past made to the handle through the Electrum Testnet pockets will not be displayed

May 31, 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: 38
bitcorelib custom P2SH script Spend
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
admin
  • Website

Related Posts

The transaction historical past made to the handle through the Electrum Testnet pockets will not be displayed

May 31, 2025

Marsses.com Evaluate: 0.48% to 0.85% Every day For 303 to 386 days

May 31, 2025

SEC Drops Binance Lawsuit, Ending Years of Authorized Stress

May 30, 2025

April 2025 Work Progress: KAS, ZEC, CKB Updates

May 30, 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

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.

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
Top Insights

By no means Drink Alone: A Information to Turkish Espresso

May 31, 2025

Bono Tells Joe Rogan That 300,000 Folks Have Died From DOGE-Led USAID Cuts: Elon Musk Calls Him A Liar, Says ‘Zero Folks Have Died’

May 31, 2025
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