RedeemScript not supported...
See original GitHub issueHello,
I tried to create (and broadcast via 3PBP) a Transaction with a SegWit P2SH(P2WPKH) input, followed exactly the example: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/transactions.js#L151
However I kept getting the error:
if (!extracted) throw new Error('RedeemScript not supported "' + bscript.toASM(redeemScript) + '"')
Error: RedeemScript not supported "OP_0 751e76e8199196d454941c45d1b3a323f1433bd6"
Here’s my code:
var bitcoin = require('bitcoinjs-lib');
var testnet = bitcoin.networks.testnet
var keyPair = bitcoin.ECPair.fromWIF('cMahea7zqjxrtgAbB7LSGbcQUr1uX1ojuat9jZodMN87JcbXMTcA', testnet)
var pubKey = keyPair.getPublicKeyBuffer()
var pubKeyHash = bitcoin.crypto.hash160(pubKey)
var redeemScript = bitcoin.script.witnessPubKeyHashOutput(pubKeyHash)
var redeemScriptHash = bitcoin.crypto.hash160(redeemScript)
var scriptPubKey = bitcoin.script.scriptHashOutput(redeemScriptHash)
var address = bitcoin.address.fromOutputScript(scriptPubKey, testnet)
console.log(address);
var txb = new bitcoin.TransactionBuilder(testnet)
txb.addInput('d7291bd8b60c1d9ee14b0f09ac2860c91fe1040824206f53156bda34dd3b563e', 1)
txb.addOutput(address, 450000)
txb.sign(0, keyPair, redeemScript, null, 500000)
var tx = txb.build()
Am I missing something?
Thank you.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Importing redeemscript · Issue #227 · Bit-Wasp/bitcoin-php
Basically I already have the redeemscript and multisig address created with a transaction input. I was trying to figure out how to import...
Read more >redeemScript/witnessScript does not match scriptPubKey for ...
I am trying to retrieve some money from my script which has been signed by three public keys. My final goal is.
Read more >redeemScript does not correspond to witnessScript - Bitcointalk
I create a bash script to generate private and public key, and I will report only the part to create redeem script etc....
Read more >missing information about redeem script and addresses using ...
Dear multichain team, I have the following question using multisignature in MC ver "2.0.1". ... something. Thanks for your support, Fabio.
Read more >Redeem Script, RedeemScript - Bitcoin Glossary
Definition. A script similar in function to a pubkey script. One copy of it is hashed to create a P2SH address (used in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dcousens Thanks, just did a clean up and updated newest version. By some reasons, my machine kept downloading the old version.
My bet is
v2.3.0
, in which case, @hoangan I’d recommend upgrading as several changes and fixes have been added toTransactionBuilder
.