Transcript for #bitcoin-dev 2017/11/18

10:57 txter Anyone here use CLion?
11:34 txter Anyone here added libbitcoin to a cmake file in Clion?
13:51 hkjn0 what's the best way to monitor requests to JSON-RPC?
13:51 hkjn0 I have a SPV client (Samourai wallet) connecting to my node, and I'd like to better understand what requests the client is sending my node
13:52 hkjn0 (as well as monitor any failed requests)
14:49 cluelessperson could someone potentially help me understand the rationale behind segwit's design?
14:50 cluelessperson hkjn0: bitcoin core's bitcoin.conf has a debug feature
14:50 cluelessperson hkjn0: you can set, debug=<module> or something
14:51 arubi cluelessperson, what about its design? which part are you asking about?
14:51 cluelessperson arubi: I'm not against the idea of offchain scaling, but I feel SegWit is... hacky
14:51 arubi how so?
14:52 cluelessperson hkjn0: -debug=<category>
14:52 cluelessperson hkjn0: Output debugging information (default: 0, supplying <category> is optional). If <category> is not supplied or if <category> = 1, output all debugging information.<category> can be: addrman, alert, bench, cmpctblock, coindb, db, http, libevent, lock, mempool, mempoolrej, net, proxy, prune, rand, reindex, rpc, selectcoins, tor, zmq, qt.
14:52 cluelessperson hkjn0: So! add, debug=rpc in your bitcoin.conf
14:53 cluelessperson arubi: Well for one thing, the idea of "block weight" and "transaction weight" is really confusing at first.
14:55 arubi I agree it's confusing at first, but it does make sense to price bytes differently in a transaction if you want to make consolidating utxos as easy as breaking a single utxo
14:56 cluelessperson arubi: well, so I read that you add up the bytes..
14:57 cluelessperson (Transaction Data - Witness) + Witness/4
15:03 hkjn0 thanks cluelessperson, I guess that's an option..
15:04 hkjn0 was hoping for an RPC or endpoint to query request counts for JSON-RPC, similar to how getpeerinfo gives info about the peers
15:04 arubi say just the common input spending a p2pkh, it has 32 bytes of txid, 33 bytes pubkey and 72 bytes signature. a common p2pkh output is about 1/4 of that size
15:05 arubi (I see I was disconnected so might have missed a line from you cluelessperson )
15:13 arubi s/so two inputs weigh as much as one out/so two inputs weigh as much as two outs/ ^, sorry, so it costs the same in weight to consolidate inputs 2->1 and to break 1->2, so there's more incentive to consolidate when paying
15:16 arubi and because the new signature scheme is a lot easier to validate and doesn't explode when there are many inputs, it's also safer
15:17 txter I'm looking through the bitcoin explorer API and not seeing this; I want to extract a private key out of a backup.dat. What's the easiest way to achieve this?
15:18 arubi is that a core wallet?
15:21 txter yup
15:21 arubi so you can load it in core and dump the specific private key that you need
15:22 txter alrighty
15:24 arubi if you don't want to sync or scan the chain, you can create a new empty datadir with just the wallet file, run bitcoind with -connect=0, dump the key and shut down
15:24 arubi just do all these stuff with a copy of the wallet file, not the actual backup :)
15:25 txter arubi: Thanks, I was actually getting the whole chain to do this. Nice though to be able to do it with out getting the whole chain
15:25 txter Well, I don't have the wallet file, but the backup is backed up in more than one place so
20:24 aFeijo hi folks, I'm using bitWasp php lib to generate the wallet addresses. Can I use an XPUB from a segwit wallet too? It works, addresses are generated, but they dont match when we check it from Nano S app
21:26 txter I'm going through Mastering Bitcoin and I think I found a possible error. Andreas is creating a vanity address miner, code is here: https://github.com/bitcoinbook/bitcoinbook/blob/second_edition/code/vanity-miner.cpp
21:27 txter In the match_found function he checks if the next character in the vanity name matches the next character in the address
21:27 txter But he uses std::tolower on the address character
21:28 txter So basically if I look for the vanity address '1A' it will never find it, because it's always lower casing the characters.