Bitcoin
$41,689.59 -0.57%
BTC 209w

BitPay/bitcore-lib has been discontinued, segwit support not merged

Adding coverage by pulling test cases from: https://github.com/bitcoin/bitcoin/blob/master/src/test/transaction_tests.cpp#L422-L612 (nested witness p2sh is only tested currently). There could be additional changes necessary to get the tests to pass.

FWIW: https://github.com/bitcoin/bitcoin/blob/master/src/test/script_tests.cpp#L857 this might also be useful if you don't test against it already. It's mainly for verification purposes, but may turn up bugs outside of this PR.

When working on signing, it's best to define your standard types (p2pk/p2pkh/multisig) and be able to deal with them anywhere P2SH, P2WSH comes in, since both of these can be used in tandem. An example of things maybe going awry is this file: https://github.com/bitpay/bitcore-lib/blob/master/lib/transaction/input/multisigscripthash.js & the multisig.js that was added after. P2SH & P2WSH require general modifications to a plain script-in-txout-script style transaction. AFAICT Bitcoin Core does this as well.

I would submit a patch, but it's not a trivial refactoring.. just my two cents worth! See serializeSimpleSig / serializeSignatures https://github.com/Bit-Wasp/bitcoin-php/blob/master/src/Transaction/Factory/InputSigner.php#L460-544. The if branches for P2SH, then witness, are repeated anywhere in that file that deals with possible combinations of P2SH | P2WSH.

Go to github.com
Recent news
BTC -0.57% youtu.be 20h

BITCOIN MAKES 10 GREEN DAYS IN A ROW馃殌

冒聼聭聡My Twitter冒聼聭聡https://twitter.com/DrunkHodler冒聼聭聡My Telegram冒聼聭聡https://t.me/DRUNKHODLER芒聳潞Listen to me on Apple Podcasts https://podcasts.apple.com/us/podcast/bit...
35
BTC -0.57% btcmanager.com 23h

MicroStrategy Pledges to Keep Buying Bitcoin (BTC)

MicroStrategy has revealed via its Q2 2021 Financial Results report released on July 29, 2021, that it plans to keep investing in its digital asset strategy even as its bitcoin (BTC) holdings are now ...
11