Archive of the libbitcoin Slack #general channel.
#include <iostream>
#include <vector>
#include <string>
#include <cstdint>
#include <bitcoin/system.hpp>
#include <secp256k1.h>
// http://aaronjaramillo.org/libbitcoin-building-a-raw-transaction
// https://github.com/bitcoin/bips/blob/master/bip-0178.mediawiki
// the obvious stuff that should be covered by the usecase example would be
// (first out we do for P2PKH & P2SH, THEN we extend to all the other four: native & P2SH-wrapped P2WPKH & P2WSH):
/*
g++ \
-std=c++11 \
-o conceptual_usecase_script \
conceptual_usecase_script.cpp \
-fpermissive \
$(pkg-config --cflags libbitcoin-system --libs libbitcoin-system)
*/
using namespace bc;
using namespace bc::system;
using namespace bc::system::chain;
using namespace bc::system::wallet;
using namespace bc::system::machine;
int main(int argc, char const *argv[])
{
// * (unrelated to segwit:) generate an HD wallet
std::cout << std::endl << std::endl << std::setw(40) << std::setfill('-') << "-" << std::endl;
std::cout << std::endl << "* (unrelated to segwit:) generate an HD wallet" << std::endl;
{
data_chunk hd_entropy{16};
pseudo_random_fill(hd_entropy);
data_chunk hd_seed = to_chunk(decode_mnemonic(create_mnemonic(hd_entropy)));
hd_private hd_private_key{hd_seed, hd_private::testnet};
hd_public hd_public_key = hd_private_key.to_public();
std::cout << "\nHd private key: " << std::endl;full file--build-boost arg? install.sh is best when it builds all dependencies and doesn't require system libs (to avoid version conflicts, etc).PKG_CONFIG_PATH=/home/me/install-path/lib/pkgconfig ./install.sh --prefix=/home/me/install-path --build-boostgit reflog?bx settings and see if you can find what it's using instead. I'll be afk a bitexport BX_CONFIG=/path/to/bx.cfg, assuming a bash or bash-like shell? If not, it doesn't have the effect you're looking for.ls -al $BX_CONFIG, a better test would have been to try env | grep BX_CONFIG. If you don't export it, that will return nothing.script[2] ?
And a more general question, what is the sense in the returns of the function extract_output() on payment_address?
https://github.com/libbitcoin/libbitcoin-system/blob/master/src/wallet/payment_address.cpp#L341script[i] extracts the i-th operation of the script. extract_output() returns lists of addresses from within the provided script base on pattern of the script. As for the 'sense' in it, I believe it's very readable in that it's presuming patterns in the script to expect addresses