We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

5

bitcoin-cli's signrawtransaction expects a few arguments. You got most of them right, but forgot to add the details for redeeming the actual p2wsh part. Specifically for p2sh(p2wsh), you'd need to provide both : $ bitcoin-cli -tesnet signrawtransaction \ ...


5

It's a Segwit output and hence does not have the address associated with it. The locking script for a Segwit transaction includes the witness version (0 in this case) and the redeem script (which is 43aac20a116e09ea4f7914be1c55e4c17aa600b7). Given that the length of the redeem script is 20-byte, this locking address is pay-to-witness public key hash (P2WPKH)....


3

To generate a P2WSH address, you need to have some script. The most easiest one you can use is a multisig script. You can do this with the addmultisigaddress. If you do something like addmultisigaddress 1 '["37Ju7oTbPfe5qNAHYiAKfdTtVvCSP3TTdL"]' "" "bech32" you should get a P2WSH address.


3

P2WPKH - This stands for "Pay To Witness Public Key Hash" and the scriptPubkey is OP_0 0x14 {20-byte-hash}, where OP_0 is the version, byte 0x14 is the size of the data, and the {20-byte-hash} is a HASH160(PubKey). P2WSH - This stands for "Pay To Witness Script Hash" and the scriptPubkey is OP_0 0x20 {32-byte-hash}, where OP_0 is the version, byte 0x20 is ...


3

First of all, what are you trying to do? Why do you need a P2WSH address? A P2WSH address (and P2SH addresses earlier) send coins to a script, which requires satisfying that script to decode. A script of the form <key> CHECKSIG is wasteful - you should be using P2WPKH instead. In general, you use P2WSH when you have more complex spending requirements ...


2

Native segwit outputs (P2WSH and P2WPKH) do not currently have an address type, so there are no addresses for these outputs.


2

When you push items on the stack you must use an opcode to state how long the item you are pushing is. In this case you want to push 33 bytes so OP_PUSH33 Your script would be: OP_PUSH33 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 OP_CHECKSIG or 210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac. Then your ...


1

As there are no known preimage attacks on RIPEMD160 and SHA256, it is impossible to know what the contents of a redeemScript are given just the scriptHash. So yes, it is impossible to know what conditions are necessary to spend from an address given just the address. That is one of the main points of using scriptHashes: it hides the redeemScript from others ...


1

This is indeed an error in the book: https://github.com/bitcoinbook/bitcoinbook/issues/440 See this diff for the correct steps.


1

Seems to me that ... creating a Pay-to-Witness-Script-Hash (P2WSH) output that would look like this: 0 9592d601848d04b172905e0ddb0adde59f1590f1e553ffc81ddc4b0ed927dd73... means that this hash is an example not derived from the data above


Only top voted, non community-wiki answers of a minimum length are eligible