Bitcoin full node and query server

Oct 17, 2018

View in context in the libbitcoin Slack #general mirror.

M
Mlmikael13:23
The P2WSH pubkey script, the hash it contains, is it a single- or dual-iteration SHA256 of the witness program (which is stored in the spending input's witness data)? Could you give me some reference to where LibBitcoin validates or generates such a hash in the pubkey script?
James C.07:56
Hi Mikael, glad that was what you were looking for. There is a P2PKH script “extraction” step from the witness object here: https://github.com/libbitcoin/libbitcoin/blob/master/src/chain/witness.cpp#L436 A couple lines above, you’ll find how the PKH from the witness is moved into a standard P2PKH script template for evaluation. https://github.com/libbitcoin/libbitcoin/blob/master/src/chain/witness.cpp#L363
(edited)