Transcript for #bitcoin-dev 2017/09/27

10:15 waxwing i've noticed recently that testnet txs often don't get into the next block, which is pretty aggravating. anyone else see that?
10:15 waxwing this one was a few minutes before the block https://testnet.smartbit.com.au/tx/69d8d487ea59af89e664e7d55d587103a896b060b2d2b77c2281f92fbbe612df but not included.
10:16 gmaxwell there are a number of persistant testnet miners that don't mine segwit.
10:22 waxwing gmaxwell, thanks, i wondered if it might be that
10:29 waxwing gmaxwell, good reason for testnet4? :)
10:29 waxwing that and people buying beers with testnet of course :)
10:30 Sentineo are they bying beers with it?
10:37 gmaxwell I haven't had much hashrate on it for a while, but what I should do is put some back and split it 50 50 between mining segwit invalid blocks and mining normally.
10:38 gmaxwell that should just keep the non-segwit stuff forked off.
11:03 omarsh Hey folks, what is the recommended way to handle multisig wallets? any concerns on BIP45? I know it has some drawbacks and an alternative BIP was posted on mailing list to address these concerns recently any suggestions about it?
12:25 molz Sentineo, no, waxwing was making a joke in reference to roasbeef's tweet, roasbeef showed someone how LN worked and made a joke he paid for a beer with test coins
12:26 molz gmaxwell, we're dying for a new testnet, so if you can help we would appreciate it :)
12:37 Sentineo molz: lol ok thanks for clarifying. I would be in the wrong belief that testnets have beer buying value :P
12:38 molz haha
12:38 waxwing heh on my testnet 0.14.0 on a vps, been running for some weeks, estimatefee 1 -> -1, estimatefee 2 -> '0.01011568'
12:39 waxwing and i was wondering why the absurd fee warning triggered.
12:44 waxwing who knew that one day a feature with 'segregated' in its name would suffer from testnet apartheid
12:52 molz waxwing, v0.15.0 is much better on estimatesmartfee
12:58 waxwing hmm. in terms of time value of money i may actually be genuinely better off testing on mainnet right now.
12:59 waxwing well, i guess it rather depends on whether my tests involve risk of loss. there was that one time i "donated" 400 segnet coins to the community :)
14:37 sdfgsdfg ffs... you are all awesome
14:38 sdfgsdfg keep up the good work
15:50 boltzar hello guys. i have a small issue. i own an exchange website and i usually use bitcoind to send the bitcoin to my clients. With these problems in the bitcoin network sometimes i have activated these options walletrejectlongchains=false , limitancestorcount=1000 , limitdescendantcount=1000 . If i didn't activate these my api would stop working on 25 unconfirmed transactions . The issue is:
15:50 boltzar on my bitcoind server after i make 25 unconfirmed transactions they stop showing on blockchain.info for example untill they confirm ( the payments are made because i can see the tx hashes ) . Now i use another bitcoin api from block.io . Using their api i can make the same a lot of unconfirmed transactions , but their transactions are showing on blockchain.info even if there are over 25.
15:50 boltzar for example look here : https://blockchain.info/address/39RwB8D6fg8mA1m7VGAGobKRtZM1vHV99F?filter=7# . Currently 48 unconfirmed transactions. What do i have to activate on my bitcoind server so i can see all the tx hashes like on their api ?
15:51 Sentineo to see txes that are not yours you need txindex=1
15:52 Sentineo nah sorry, misread, ignore me ;)
15:53 boltzar it's no problem
15:53 boltzar to make it short. on block.io api i can see the entire long chain of 50 unconfirmed transactions and on my bitcoind api i can see only the first 25 even if i have 50 unconfirmed transactions
16:11 boltzar anybody ?
16:12 Sentineo it is not that crowded here, u need to wait ;) Folks will join later i am sure
16:16 boltzar just a stupid question. in my bitcoind.conf i don't have any addnode=... but it works ok
16:17 boltzar do i need to have these lines ? i've taken them from the bitcoin.conf examples
16:17 boltzar # Use as many addnode= settings as you like to connect to specific peers
16:17 boltzar #addnode=69.164.218.197
16:17 boltzar #addnode=10.0.0.2:8333
16:46 Sentineo no addnodes is not needed, you find them through dns seed and from other peers
16:48 boltzar ok.
17:06 molz boltzar, i think bitcoin core allows only 25 unconfirmed txs
17:15 boltzar it allows more, but i'm now talking about the displaying in blockchain
17:16 boltzar the example i showed backs up what i'm saying
17:16 BlueMatt boltzar: a) this is not a bitcoin core issue, b) this channel is for bitcoin core dev, not support (you might wish to try #bitcoin), c) spending lots of unconfirmed change like that risks them getting malleated out from under you, at which point you'd have to recreate all the txn, not sure how your wallet ended up with so few utxos that you are always spending unconfirmed change, but you should probably avoid doing that
17:17 boltzar BlueMatt i get lots of orders and have to send the btc to my clients
17:17 boltzar the orders come at time difference thats why i create separate transactions
17:18 esotericnonsense on bc.i the information looks like nonsense anyway.
17:18 esotericnonsense whatever they mean by 'balance' is negative.
17:19 boltzar on balance it's negative because those are outgoing transactions. so the negative value is main balance - that amount...
17:20 boltzar if there were incoming it would be +500 ...
17:20 boltzar the main idea is that on blockchain it appears the transaction infos
17:20 boltzar after i hit 25 tx, bitcoind generates the txid but it doesnt appear on bc.i
17:20 BlueMatt oh, I misread which channel it was
17:20 BlueMatt anyway, yea, this is a blockchain.info issue
17:21 BlueMatt well, kinda
17:21 BlueMatt boltzar: you didnt really answer my question, though, why do you have so few utxos available that you end up creating long chains?
17:21 BlueMatt boltzar: just having to send transactions doesnt imply you'll always hit long chains
17:23 boltzar i know for sure that it's a setting from bitcoind.. BlueMatt i have a lot of unconfirmed transactions just because of the blockchain mempool is full sometimes.
17:23 boltzar i get for example 30 orders in 20 minutes and they don't confirm . the last few days i had unconfirmed transactions for 10 hours...
17:24 esotericnonsense boltzar: chains, not transactions
17:24 esotericnonsense it's not unusual to have unconfirmed transactions, what is unusual is to have long chains which spend from unconfirmed parents
17:25 BlueMatt boltzar: you set a setting in bitcoind to change your mempool policy so that your node will accept transactions that others will not. This results in your transactions not being relayed around the network, hence why they do not appear on block explorers
17:25 boltzar because i use the same balance and return address to send to all my clients
17:25 boltzar BlueMatt and why does transactions from block.io appear ?
17:26 BlueMatt you should be a) not using long chains, which is the largest issue here, b) if you need transactions to confirm quicker, using either cpfp or rbf (though rbf means you also cant chain transactions well)
17:26 BlueMatt they probably have a connection to blockchain.info or whatever, I guarantee those transactions will not show up on other block explorers (nor will they be mined any differently from yours)
17:27 boltzar BlueMatt on the bitcoin address that i provided you it's also a long chain
17:27 BlueMatt a transaction appearing on blockchain.info is not itself indication of much
17:27 boltzar well let me check.
17:27 boltzar https://blockexplorer.com/tx/a81b47d9e08ececb9984860c305a7f2dbb78a189b3baf5fb5731a807eb814d5f
17:28 boltzar they appear also on other explorers
17:28 boltzar that's why i say it's a bitcoind setting
17:29 arubi it doesn't count if you used their api to broadcast these
17:29 boltzar arubi it's different wallet...
17:29 boltzar my bitcoind uses 1 wallet and block.io uses another wallet
17:29 arubi okay, anyway, what you're doing is messy. I really can't help
17:29 BlueMatt boltzar: that transaction does not have >25 parents
17:29 BlueMatt (it has 24, actually)
17:29 BlueMatt hence why it shows up
17:30 BlueMatt "it's a bitcoind setting" <-- its a bitcoind setting that only effects you, it does not effect your peers, and other nodes on the network will not relay transactions with 25+ parents
17:30 boltzar how could that be possible ? my block.io uses same bitcoin address and same return address
17:31 esotericnonsense it sounds to me like you're getting confused with addresses, addresses are irrelevant here, it's the number of chained unconfirmed transactions
17:31 esotericnonsense i.e. tx a is unconfirmed, b spends from a, c spends from b, d spends from c....
17:32 BlueMatt boltzar: I recommend you read the bitcoin.org docs on what the format of transactions are, it may be quite illuminating https://bitcoin.org/en/developer-guide#block-chain
17:33 boltzar thank you for the tip
17:33 boltzar indeed i don't know all of these...
17:33 boltzar 2 weeks ago i've heard for the first time about return address :)
17:34 boltzar can you tell me how can i connect a blockexplorer to my bitcoind ?
17:35 boltzar for example i will build a blockexplorer, my tx id's that don't show on blockchain.info ... i want for them to show on my own blockexplorer
17:35 boltzar it's about my customers, i want to show them a proof that the payment is made
17:36 esotericnonsense if you've changed your own settings to allow transactions that other nodes will not relay, the payment has effectively not been made until other nodes accept it into their mempools, it's in some sort of 'pre-unconfirmed' state
17:38 BlueMatt boltzar: can you clarify a bit more what your use-case is that requires such long chains? your customers are ok waiting an extended period of time before their txn confirm, fine, but why do you have so few utxos in your wallet? do you regularly consolidate utxos or so?
17:39 boltzar i know. but to be honest i didn't find any solution in my api so i can make a lot of payments and for all to appear in the blockchain. to get an idea i make about 5000 transfers per day...
17:40 BlueMatt boltzar: have you looked into sendmulti?
17:40 BlueMatt ie sending to multiple people in one tx?
17:40 BlueMatt this will save you further on fees, and since youre willing to take a while to send payments, why not consolidate while you're at it
17:41 boltzar BlueMatt i can't use sendmulti. i have to send the bitcoin when i receive the money from my client and i get the the orders at a time difference ...
17:41 BlueMatt boltzar: making 5000 transfers outbound per day isnt the issue, the question is if you also have inbound, why can you not use those utxos?
17:42 BlueMatt boltzar: wait, you have to send the btc outbound instantly but your clients dont mind waiting a day to get it confirmed?
17:42 boltzar BlueMatt i don't understand what you mean by "do you regularly consolidate utxos or so?"
17:42 boltzar BlueMatt exactly.
17:42 BlueMatt you have strange customers...
17:42 boltzar i know.
17:42 BlueMatt anyway, does your wallet usually sit near 0 balance?
17:42 boltzar no. always have 1 bitcoin at least
17:43 BlueMatt well, I mean does it usually sit relatively low compared to the volume you are doing
17:43 belcher you could also use RBF to add outputs to unconfirmed txes instead of spending unconfirmed change
17:43 boltzar no . my transactions are usually 5-10-20 $
17:43 BlueMatt like if your txn are all for 0.001 btc, but you usually have 1 btc, I'd find it strange that you dont have available utxos
17:43 BlueMatt are you manually selecting utxos or are you using bitcoin core's built-in coin selection?
17:44 boltzar i think the problem is how i built the api
17:45 esotericnonsense it sounds like you're doing some weird thing with address reuse to me
17:45 esotericnonsense attempting to use addresses as 'accounts' of some sort, which doesn't really make sense
17:45 esotericnonsense it shouldn't be necessary to reuse addresses in the way that is seen in some of those links above
17:46 boltzar for example if i have 5 confirmed tx's in my wallet when i first send a payment, i use all those tx's and i will end up with only one tx in listunspent
17:47 esotericnonsense right, that shouldn't be happening unless you're sending a large amount that requires use of 5 utxos
17:47 BlueMatt ah, yes, why are you doing that?
17:47 BlueMatt why not use bitcoin core's built-in utxo selection?
17:47 BlueMatt or some other set of inputs instead of all of them
17:47 esotericnonsense if you're doing something like recombining all utxos into a single change address each time, you're basically enforcing that every new transaction is another one in the 'chain', it means that all previous tx must be confirmed for that one to be
17:47 boltzar BlueMatt my script is automatic. it's how i wrote the code
17:48 boltzar i know that's a big issue for me, but to be honest i didn't find a good programmer to help me.
17:48 BlueMatt wait, so you wrote your own wallet
17:48 boltzar posted jobs on major websites. found people that told me they are experts and when i told them i wanted to use segwit for all my transactions they asked me what is that :)
17:48 BlueMatt why not use an existing wallet?
17:49 boltzar no no. you didn't understand me. i'm using a php script to send bitcoins
17:49 boltzar i'm using sendrawtransaction function
17:49 esotericnonsense boltzar: right, but you don't need to do that. bitcoind can handle transactions for you.
17:49 BlueMatt why not sendtoaddress?
17:49 boltzar esotericnonsense i know it can handle, i want to use the same return address
17:50 BlueMatt "return address"?
17:50 BlueMatt what is a "return address"
17:50 esotericnonsense you don't need to and shouldn't be reusing addresses in this way
17:50 boltzar sendtoaddress returns the remaining funds from a transaction to another btc address
17:50 boltzar i want to use the same address
17:50 BlueMatt oh, you can still do that!
17:50 esotericnonsense as I said, it sounds like you're trying to use addresses as some sort of accounting mechanism
17:50 BlueMatt have you looked at fundrawtransaction?
17:51 boltzar esotericnonsense it's easier for me to track the remaining balance using just 1 address
17:51 BlueMatt boltzar: I believe what you want is fundrawtransaction's changeAddress option
17:51 boltzar BlueMatt i've heard of that, i didn't try it
17:51 BlueMatt (I agree with esotericnonsense, you absolutely should avoid doing this, but if its absolutely a requirement for you, look at fundrawtransaction)
17:51 boltzar also sendtoaddress doesn't use segwit
17:52 boltzar i add a segwit address to my wallet, when i first send a transaction, the balance is moved to a non-segwit address
17:52 boltzar and the next transaction will not be witness signed
17:52 boltzar i've tried it
17:54 boltzar i will try fundrawtransaction , i'm a bit afraid, but i will try it
17:54 esotericnonsense i'm afraid of this entire system in general :P
17:54 boltzar yeah me too
17:54 boltzar i'm afraid i will leave some bugs out ...
17:55 boltzar it's not the first time i get hacked...and usually when i find a good method that works i'm trying to stick to it for as long as i can
17:55 esotericnonsense i suggest either finding a well tested solution (that may or may not include segwit for the time being), or at a minimum spending a _lot_ of time on testnet trying to break it
17:56 esotericnonsense on the address reuse thing, if there's actually a specific reason for you to do it, go ahead, but it really seems to me like you're using it as a hack around actually having a proper accounting system, which is a huge red flag to me
17:56 boltzar well i tried to find a good developer..but it's kind of hard to find. good devs don't have time for me.
17:57 boltzar well don't laugh but i use that address like i said to keep track of my balance easy
17:57 esotericnonsense i'm not laughing, i am petrified for your customers :P
17:57 boltzar i have the blockchain app installed on my phone , and the re-use address at my watch
17:57 boltzar this way i can track easy
17:57 boltzar that's the only reason to be honest. i know it's stupid...
17:58 BlueMatt boltzar: i mean why? if someone steals your money its already too late
17:58 boltzar BlueMatt no no...to keep track of my balance for example if balance is running low i will come online and fund my bitcoin
17:58 BlueMatt why not set up that on your server?
17:59 BlueMatt just call getbalance in a loop and send yourself an email if its low
17:59 esotericnonsense (you also want to know why it's low...)
17:59 boltzar i know. and to see all the latest transactions ?
18:00 boltzar i would have to make another script that displays all my latest transactions
18:00 esotericnonsense well you make the outgoing transactions, so you know what those are
18:00 esotericnonsense you can use walletnotify to notify on incoming (there are probably better solutions)
18:01 boltzar yes, but i want them to be displayed.. like i said, i would have to make some sort of api to replace the blockchain app
18:01 boltzar i know this sounds stupid for you guys...but it's just how i've done it for years since i used the blockchain api
18:01 esotericnonsense if you run bitcoin-qt instead of bitcoind you could just look at them
18:01 esotericnonsense ?
18:03 boltzar on my phone ? i doubt..
18:03 molz boltzar, i just did a tx with "sendtoaddress" to a segwit address on testnet, it does send to a segwit address, i've done this before but to make sure again so i just tested it
18:04 esotericnonsense molz: he wants to use segwit change addresses probably
18:04 BlueMatt okok, whatever, so you want to have one change address...thats a terrible idea, but, yea, the solution to your problem is to create a blank tx with just the output you want, then call fundrawtransaction with the changeAddress option set, then signrawtransaction (at which point you can automatically verify it before you broadcast), then sendrawtransaction
18:04 boltzar yes. and the change address is not segwit
18:04 BlueMatt its a bit more of a set of hops, but then you get what you want without long chains of txn
18:04 BlueMatt as for segwit change, I dont believe that will be supported until 0.15.1
18:04 BlueMatt but that should be relatively soon
18:04 BlueMatt though maybe p2sh-wrapped change works
18:04 BlueMatt I'm not 100% sure on that last one
18:04 esotericnonsense i mean if you want the bare minimum hacky solution (which is what you seem to want) all you need to do is ensure that you don't merge all utxos every single tx
18:05 esotericnonsense just use the minimum set necessary
18:05 BlueMatt or that, yea
18:05 boltzar BlueMatt so you're saying that in version 0.15.1 the change addresses will be segwit ?
18:05 boltzar that means sendtoaddress will work with segwit change address right ?
18:06 BlueMatt there will be an option in 0.15.1, yes
18:06 boltzar esotericnonsense about hacking i meant that i'm afraid when i build the code i will make a mistake or leave a bug...
18:10 boltzar anyway thanks for your help guys. now i know what to do... fundrawtransaction
18:10 BlueMatt or the other suggestion
18:10 BlueMatt <esotericnonsense> i mean if you want the bare minimum hacky solution (which is what you seem to want) all you need to do is ensure that you don't merge all utxos every single tx
18:10 BlueMatt but up to you
18:18 boltzar that's my main goal. i know that this way i will avoid the long chain
18:25 boltzar one more question and i'm off. does fundrawtransaction use unconfirmed tx's also to fund the transaction ?
20:09 kebman Know any good resources on how to programmatically sign messages with a Bitcoin address?
20:10 kebman Or rather, I've managed to sign a message, and locally validate it - but places like http://www.coinig.com/
20:10 kebman *not
21:45 omarshi You can use bitcoin-cli tool, if you want to do it in bash script, you can find more info here https://bitcoin.org/en/developer-examples#transactions There also plenty of libraries in variety of high level languages if you want as well.