Transcript for #bitcoin-dev 2017/03/14

02:24 Iriez achow101: could you explain the 75 contributor gap outlined by the poster in that thread?
02:25 Iriez Im interested in determining how many contributors to the codebase there was.
02:34 achow101 Iriez: what is that thread even discussing? What repo?
02:35 achow101 oh, nvm, didn't scroll down far enough
02:36 achow101 Iriez: for one thing, you can't compare the branches like that because the branches have changed since the respective .0 releases you are talking about. Also, IIRC the changelog is based on the differences between the latest minor version, and the major release
02:39 achow101 secondly the github compare does not show all commits, only the first 250, out of hundreds, possibly more than a thousand commits made between releases. It is not going to show every commit. You will need to use the git commands for that
06:34 wumpus the commit I use to create the committers list is
06:35 wumpus LC_ALL=C git log --use-mailmap --format='%aN' "$*" | sort -uif | sed -e 's/^/- /'
06:35 wumpus Example: list_authors.sh v0.9.0rc2..0.9.0
06:37 wumpus also sometimes we manually add names if people have done important things for a release but haven't directly committed. it's usually better to over-credit than under-credit
06:37 wumpus but this is only 0-2 names per release, not a whole bunch
12:26 GAit wumpus: on https://bitcoin.org/en/release/v0.14.0#minimum-fee-rate-policies it says "(effectively 3 * 1000 satoshis/kB)" - in the code https://github.com/bitcoin/bitcoin/commit/dd98f04 I see the constant but I'm missing the 3 x, is this an error in the release notes I suppose? the threshold is 1/3 of the spending fee so maybe brought confusion?
12:29 GAit jonasschnelli: yes we support opt-in rbf since mid May of last year
12:32 wumpus GAit: I'm not sure, from the source you'd indeed say it'd be 1000 not 3*1000
12:32 wumpus morcos: any idea?
14:36 morcos GAit: wumpus: Sorry i wasn't sure how to make that text clear... the dust calculation has always included a multiple of 3 in it.
14:37 morcos I was just trying to indicate how to translate from the option you are passing to what is considered a dust amount
14:40 morcos whoops that didn't render well.. i wonder if somehow that text got changed.. but yeah the rate you pass in in is the rate such that at a feerate on a future transaction of (3 * that) it would be a wash to include as input any output created at the threshold
14:41 wumpus thanks, that makes it clearer, so the factor 3 is implicit
14:42 morcos yes...
14:42 morcos nothing has changed..
14:42 morcos interpreted the exact same way it was with the minrelaytxfee option before.. but now that option only controls dust threshold so i wanted to explain it..
15:04 kryptynasium How big is the blockchain dump and how many days would it take to download all the way to the genesis block?
15:05 kryptynasium Forums are saying: The blockchain currently weighs in at about 45 GB - is it still around this number?
15:07 kryptynasium Bitcoin is doomed
15:12 wumpus about 100GB, if you have a fast computer and network connection you can download and validate it in a few hours
15:12 wumpus as for the nihilism take it somewhere else we don't react well to that here
15:23 kryptynasium wumpus: would you be able to estimate the total number of transactions?
15:24 wumpus I don't have those statistics, but I'm sure you can find that somewhere
15:43 kryptynasium wumpus: ~220 million: https://blockchain.info/charts/n-transactions-total?timespan=all FYI
15:45 rublev tes
16:25 Arthur33 Hi everyone. Can somebody help me with something. I have modified net.cpp code in bitcoin core and I'd like to link to new static librairies to make it work. However I cannot where I need to modify the makefile to make it works.
17:00 cluelessperson I'm working on parsing the blockchain when I view a CTxIn, I can't seem to manually spot the input amount, what am I missing here?
17:00 cluelessperson CTxIn(COutPoint(lx('fe2a3e06c80d43797403b4ffa4d070347b41cf5bf7094c41b417308dcb7a2db2'), 1), CScript([x('3044022056f3471291c76281edd02554d893c5bdd3a3c9ec5a3af9e685714d843c2ef81e02207e74d7a583472833053def680475d50b112b4d6ca375e6fdc64ca9f8718ae6cf01'), x('03eef298060801ef649c84a0b616179ca4da87653e5e75e41137fe7f235f1563da')]), 0xffffffff)
17:01 abpa cluelessperson inputs don't contain the values
17:01 abpa Kind of a design oversight in my opinion
17:01 cluelessperson abpa: oh, what does?
17:01 abpa You have to cross reference it with the outpoint utxo
17:01 cluelessperson abpa: probably trying to get size down as much as possible.
17:01 cluelessperson abpa: thanks
17:39 GAit thanks wumpus morcos
17:51 rublev quit
18:02 cluelessperson abpa: what exactly is the utxo?
18:02 abpa just outputs that are not yet spent
18:02 abpa a combination of transaction id and output index
18:03 cluelessperson abpa: so you're saying, I have to reference previous blocks/transaction outputs to determine the input of this block?
18:03 abpa To determine the input value, that's correct
18:03 abpa The input value is the output value it references
18:04 cluelessperson abpa: so I'm thinking I have to query the input referenced utxo from bitcoin rpc?
18:05 abpa cluelessperson yes and you'll need tx index
18:06 cluelessperson abpa: my node has txindex=1 so I think I'm good
18:18 cluelessperson I'm a bit confused, how do you refere to the unspent of a previous transaction?
18:18 cluelessperson you're not always sending the full amount.
18:19 abpa cluelessperson you are always sending the full amount
18:19 cluelessperson abpa: wut?
18:19 abpa You can only fully spend an output
18:19 cluelessperson abpa: I don't understand, how does that allow from splitting 1BTC to 0.5 BTC?
18:20 abpa cluelessperson you can't, you must create a new change output
18:21 cluelessperson abpa: What?
18:21 cluelessperson I remember being able to leave a balance at an address?
18:21 cluelessperson you're saying now that you must send the entire amount always?
18:21 abpa You can only fully spend an output in a transaction, if you want to send a partial amount you send part to the partial destination and part back to yourself to an output you control
18:21 abpa addresses don't really have balances
18:22 abpa That's just a way to visualize multiple outputs that happen to be similar
18:22 abpa cluelessperson you must send the entire output value always
18:23 cluelessperson abpa: so, a transaction where someone left value attached to their own address, was actually a transaction where they had two outputs, to their destination, and the remaining to themselves, anything unaccountd for is a fee?
18:25 abpa cluelessperson if you see a "balance at an address" it is just referencing that they re-used an address
18:26 abpa Which is a no-no
18:27 cluelessperson I understand, however it's only recently that bitcoin core even allowed a deterministic wallet for change addresses and similar.
18:27 abpa Bitcoin Core before that just made new addresses for change
18:27 cluelessperson ah
18:28 cluelessperson abpa: also, when you reference a previous transaction, you're only paying attention to the amount that was sent to your current address?
18:28 abpa The address just encodes what an output would look like
18:29 abpa When you reference a previous transaction you are talking about the transaction that has an output at a certain index
18:29 cluelessperson abpa: I'm confused, addresses are derived from private/public key pairs, no?
18:30 cluelessperson I thought addresses were just used as "id"s to attach values to, then the controlling party can sign ownership to another address
18:30 cluelessperson brb, sorry
18:34 abpa addresses are just encodings of common output scripts that include hashes of key pairs
18:38 cluelessperson abpa: they can't be, I've generated addresses
18:38 cluelessperson private -> public -> address
18:38 abpa What it does it generate a new key, then encodes the key as a part of an output script, then encode that as an address basically
18:39 abpa It's more like private -> public -> pkhash as part of an output script -> address that encodes the output script into a minimal sharing format
18:39 cluelessperson ...
18:42 cluelessperson abpa: You're making it sound like the transaction itself is what generates an address
18:42 cluelessperson and it simply does not
18:42 abpa Transactions have output scripts that describe unlocking conditions
18:42 abpa Addresses are short ways to describe these output scripts
18:43 cluelessperson What do you mean "short way to describe these output script"
18:43 cluelessperson I can generate an address right now, without and output script related to it
18:43 cluelessperson you mean an output script can be setup to deliver to an address under certain unlocking condition?
18:43 cluelessperson like nlock
18:44 cluelessperson abpa: sorry, I don't mean to be difficult, just don't understand.
18:44 abpa Well so a 1** address basically says it is an output script on main network, of script type pay to public key hash, using the hash $hash
18:44 abpa So then you make a transaction with that script type with that $hash value
18:45 abpa Then when the person goes to claim the money they present the public key that goes along with that public key hash and the signature as well to signal that they control the private key that goes along with the public key
18:46 cluelessperson how is it an "output script on main network" ?
18:46 cluelessperson addresses are generated outside of the network
18:46 Chris_Stewart_5 cluelessperson: if it starts with a '1' it has the main network byte prepended to it
18:46 abpa Right but it describes which network it should be used on
18:47 abpa That just communicates your preference for where to receive the money
18:47 cluelessperson what do you mean which network? mainnet?
18:47 abpa Testnet vs mainnet yes
18:47 abpa It's actually just part of the script type byte
18:47 cluelessperson this isn't making any sense
18:47 abpa Maybe you need to read about the fundamentals a bit more
18:48 abpa Like look what data the address is actually encoding
18:48 abpa Look at what output scripts actually look like
18:48 cluelessperson Why would you use an address byte to determine if any value is on the network, If you're using that address on this network, it either has value attached it or it doesn't.
18:48 abpa It's not related to value, just which network you want to be talking about
18:48 Chris_Stewart_5 ^
18:49 Chris_Stewart_5 I can use the same private key -> public key -> pubkey hash on any network
18:49 cluelessperson abpa: an address is just a simple prefix + X + checksum
18:49 abpa the prefix is the network you are talking about + the script type you are talking about
18:49 abpa X is the hash argument to the script type
18:50 cluelessperson abpa: X is a public key...
18:50 abpa Generally it's a hash, in 1xx it is a hash of a public key
18:51 Chris_Stewart_5 cluelessperson: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L130-L133 is where the prefixes are defined
18:51 Chris_Stewart_5 cluelessperson: and X is a public key hash (if you are using P2PKH)
19:00 cluelessperson abpa: yeah, but you're saying an address is an output script, I don't understand that
19:01 cluelessperson an output script might contain an address I believe, along with rules for unlocking..
19:03 Chris_Stewart_5 ^, at best an address is the hash of a script
19:04 Chris_Stewart_5 + network byte and checksum
19:06 cluelessperson Chris_Stewart_5: what do you mean "script"
19:06 cluelessperson addresses are generated completely offline
19:06 cluelessperson scripts are used on the blockchain
19:06 cluelessperson that's mutually exclusive.
19:07 Chris_Stewart_5 pay to script hash literally means you are paying to the 'hash of a script'
19:08 Chris_Stewart_5 so you can generate that script offline, then send the *hash* of that script to an online machine, turn it into an address then sending it to your counterparty
19:08 cluelessperson Chris_Stewart_5: that describes a contract?
19:08 Chris_Stewart_5 that is how multisig works, you are paying to the hash of a multsig script
19:08 Chris_Stewart_5 I think you can use the word 'contract' and 'script' interchangably
19:12 cluelessperson Chris_Stewart_5: oh, so in that case, you create a script/contract offline, send to itss hash, once the terms are filled, the outputs are resolved?
19:12 cluelessperson Chris_Stewart_5: the the other, is just sending to a hash/address, in which the sender can then sign sending to another hash
19:12 Chris_Stewart_5 cluelessperson: Not sure what you mean by 'once the terms are filled'
19:13 cluelessperson Chris_Stewart_5: Contracts/Scripts have inputs.
19:13 cluelessperson no?
19:13 Chris_Stewart_5 cluelessperson: Yes, are you talking about spending a p2sh output?
19:14 Chris_Stewart_5 inputs don't care about what outputs they are funding. All that matters is (sum of inputs) <= (sum of outputs) in terms of coins
19:14 Chris_Stewart_5 wait I got that backwards -- oops.
19:15 Chris_Stewart_5 I suppose we don't want to create coins out of thin air :P.
19:18 cluelessperson AH, so that's what that means
19:18 cluelessperson pubkey hash
19:18 cluelessperson and scripthash
19:18 Chris_Stewart_5 Yep :-). Light bulb going off?
19:19 cluelessperson Chris_Stewart_5: little bit
19:19 cluelessperson So there are two types of addresses, 1. Pubkey hash. Derived from a public key
19:19 cluelessperson 2. Script hash... which I'm still confused on
19:19 Chris_Stewart_5 Eric Lombrozo explained it to me once at a meetup and it took me another 3 or 4 months to actually get what he said haha.
19:19 cluelessperson starts with a 3
19:20 cluelessperson So, I guess i've never used a pay to script hash
19:20 Chris_Stewart_5 cluelessperson: Imagine you have a multsig address that looks like this: OP_0 OP2 <pubkey1> <pubkey2> <pubkey3> OP_3 OP_CHECKMULTISIG
19:20 Chris_Stewart_5 you converact that to hex and then take HASH160(script_hex)
19:21 Chris_Stewart_5 and then add network byte and checksum and voila you have an address that starts with a '3' (p2sh)
19:23 arubi the address doesn't have the 0x00
19:23 arubi it's only in scriptsig, as an input for checkmultisig
19:23 arubi well, the scriptpubkey is what I mean
19:23 cluelessperson okay, so, going back
19:24 cluelessperson I'm trying to decode/view transactions in a block
19:24 cluelessperson I can see outputs, but I cannot see the inputs
19:24 arubi cluelessperson, you're in luck, the block is very mostly only transactions
19:24 arubi really the first 80 bytes are header, then some varint of the amount of transactions, then transactions one after another :)
19:25 Chris_Stewart_5 arubi: Has a better memory than me (and is much better at answering question IMO) :-)
19:25 arubi didn't mean to step on toes, just sharing my past mistakes :)
19:26 cluelessperson https://hastebin.com/raw/epuhacukak
19:27 cluelessperson So I have these inputs
19:27 cluelessperson and two outputs
19:27 arubi cluelessperson, in p2sh redeem, the script goes in first as a single push
19:27 arubi there's one input there
19:27 arubi 3 things on the stack
19:27 arubi from bottom to up, script as a single data push, sig, sig
19:28 arubi where's the 0x00, I don't know :)
19:28 arubi it's a 2-of-2 multisig script which will fail on this stack
19:28 arubi a final 0x00 has to also be pushed because of very cool bugs in checkmultisig(verify)
19:29 arubi oh excuse me, the 0 is in its own line with the txin :)
19:29 arubi should be find if the signatures are correct.
19:29 arubi s/fine :P
19:31 arubi cluelessperson, the input is 7d8c3a2bc4906994f2e4195c05c3fe88e08da9eaf760c598394fda45b057727e:1 , and is redeemed by the stack in CScript(..)
19:32 arubi finally there's the sequence, then both outputs
19:34 cluelessperson Is there some reading I can do that approaches how to understand all this?
19:34 cluelessperson I'm coming in the middle and none of it is intuitive
19:35 arubi hmm, did you see the developer documentation? also the important parts in the code are either very well documented in the comments or are so pretty that you can just read :)
19:36 arubi the wiki has some pretty interesting pages too. the op_checksig page has a very good diagram
19:36 cluelessperson arubi: I'm not sure where the developer documentation is
19:36 cluelessperson I've been looking at the wiki, but it's not an education approach
19:36 arubi https://bitcoin.org/en/developer-documentation
19:37 cluelessperson arubi: thanks
19:37 arubi https://en.bitcoin.it/wiki/OP_CHECKSIG
19:37 arubi very good sources ^
19:38 arubi also there's `bitcoin-tx`, and read the 'help' item for sign rawtransaction for how to set up a json referencing an input
19:38 arubi if you can do that, you can practically run any script easy :)
22:53 cluelessperson I have this
22:54 cluelessperson 0000000000000000000000000000000000000000000000000000000000000000:4294967295 prevout
22:54 cluelessperson what does that mean?
22:55 achow101 cluelessperson: coinbase I think
22:55 cluelessperson trying to get the output to understand a transaction
23:01 cluelessperson OH, there's no txid for the first transaction in a block right?
23:01 phantomcircuit cluelessperson, right
23:02 phantomcircuit or rather it's set to the null representation
23:02 cluelessperson it's just describing who to send txout to
23:02 phantomcircuit which is txid=0 and index=max
23:02 cluelessperson 593a867c45dcf31975a8da2649f100c136d45cbf34aadf7e04115f0261079f09:1
23:02 cluelessperson would be a txid right?
23:04 cluelessperson alright, I'm getting somewhere
23:18 cluelessperson So, I'm supposed to get the utxo or prevout referred to by this transaction, how do I know how much was there? do I look at a certain output?
23:31 luke-jr a number of decent BIPs have negative comments; I suggest perhaps people may wish to provide positive feedback to counter them. https://github.com/bitcoin/bips/pull/500