Archive of the libbitcoin Slack #general channel.
wallet::decode_mnemonic(my_word_list, my_string) won't compile with the 2nd string (passphrase) parameter. In the source code, the preprocessor directive #ifdef WITH_ICU precedes the specific function signature with 2 args in question.
Could it be that I am building it wrong? wallet::decode_mnemonic(my_word_list) with single argument no probs.
https://github.com/libbitcoin/libbitcoin/blob/master/include/bitcoin/bitcoin/wallet/mnemonic.hpp#L78-L87active_forks argument in script.to_string(active_forks). It seems this argument is the same as the block version miner signaling for softforks, but as far as I can tell, only affects "nop2->CLTV" or "nop3->CSV" in the returned string. So to get CLTV or CSV as the string output, I have to explicitly input the uin32_t active_fork argument with the respective bit activated.
Q: Why only specifically these 2 cases, and only for the tx script.to_string method?
Thanks in advance!!witness_oplist.push_back(operation(witness_script.to_data(false)));
...it adds a OP_PUSHDATA1/76/Hex(4c) in front of it.
Why does it add the 4c opcode?
That doesn't seem to happen if I push back, lets say operation(to_chunk(my_hash_digest))
Here is just the [witnessScript], a 2/3 multisig, parses fine with bx script-decode:
5221026ccfb8061f235cc110697c0bfb3afb99d82c886672f6b9b5393b25a434c0cbf32103befa190c0c22e2f53720b1be9476dcf11917da4665c44c9c71c3a2d28a933c352102be46dc245f58085743b1cc37c82f0d63a960efa43b5336534275fc469b49f4ac53ae
After pushing it to the operation::list, I serialise it and get:
4c695221026ccfb8061f235cc110697c0bfb3afb99d82c886672f6b9b5393b25a434c0cbf32103befa190c0c22e2f53720b1be9476dcf11917da4665c44c9c71c3a2d28a933c352102be46dc245f58085743b1cc37c82f0d63a960efa43b5336534275fc469b49f4ac53ae
(notice the leading hex(4c))
Any help much appreciated!operation(data_chunk&& uncoded, bool minimal=true).0x4b will require a preceding opcode OP_PUSHDATA1 , OP_PUSHDATA2 depending on the data size? I will have a closer look to better understand the multiple possible mappings you mentioned.
But there are still 2 observations I cannot explain:
1) Looking at a P2SH(P2WSH) example from the BIP143 proposal, I noticed the [witnessScript] data in the witnessScript simply has a preceding cf to indicate the number of following data bytes, but no OP_PUSHDATA. I noticed cf>4b.
2) When I try to pass the script object /w the data operation OP_PUSHDATA1 to the witness object: witness my_witness(script.to_data(false), false);, it remains empty. Witness objects constructed from scripts with simple data pushes, such as [number of bytes][data bytes], work fine.
Based on the BIP143 example and my troubles with the above witness object, I am guessing the witness doesn't work with the OP_PUSHDATA opcode.
Could that be? Thanks in advance!