1 2017-02-10 01:02:56 <bsm117532> Another regtest monkey wrench...I need a segwit only wallet. But at block 0 on regtest segwit isn't enabled. Is there a way to get it enabled from block zero?
2 2017-02-10 07:03:41 <jimpo> Can someone explain what the fClient flag means?
3 2017-02-10 08:16:50 <waxwing> bsm117532: what's wrong with just mining N blocks (where N is a number i can't remember)
4 2017-02-10 08:17:09 <waxwing> oh i guess maybe it's the mining part you're interested in?
5 2017-02-10 13:39:22 <RxMcDonald> Anyone knows how to convert uint256S to int and back?
6 2017-02-10 13:39:48 <RxMcDonald> I got this value 0x000000000000000000000000000000000000000000000005c13f99f6d0b1a908 and I want to make it a zero or 1 or just w/e I want ?
7 2017-02-10 13:46:03 <RxMcDonald> well, nvm i guess it's not a big deal for now
8 2017-02-10 14:51:35 <RxMcDonald> Anyone here?
9 2017-02-10 14:51:52 <RxMcDonald> TZander: You there? ðŸââ¹
10 2017-02-10 14:54:59 <RxMcDonald> I don't understand why It can't find then LogPrintf in chainparams.cpp after adding #include "util.h" ... ?
11 2017-02-10 15:33:50 <RxMcDonald> anyone here?
12 2017-02-10 15:35:14 <Chris_Stewart_5> RxMcDonald: will the uint256 fit inside of an 'int'?
13 2017-02-10 15:38:34 <RxMcDonald> Chris_Stewart_5: I'm not sure, but i kind of have a different problem now
14 2017-02-10 15:40:32 <RxMcDonald> it's still kind of the same problem though
15 2017-02-10 15:41:26 <RxMcDonald> want to print some debug info and it's throwing expression ('std::ostream' (aka 'basic_ostream<char>') and 'const uint256') Chris_Stewart_5
16 2017-02-10 15:42:15 <RxMcDonald> invalid operands to binary expression, so I guess i need to convert that to something for ostream or pass the right string placeholder, i.e. %s ?
17 2017-02-10 15:42:28 <Chris_Stewart_5> call .ToString() on uint256?
18 2017-02-10 15:43:05 <Chris_Stewart_5> https://github.com/bitcoin/bitcoin/blob/master/src/uint256.h#L54
19 2017-02-10 15:43:28 <RxMcDonald> member reference base type uint32_t aka unsigned int is not a structure or union
20 2017-02-10 15:44:33 <RxMcDonald> I guess I fixed it with %u instead of %s
21 2017-02-10 15:45:33 <RxMcDonald> now I broke something, it says symbols not found for architecture x86_64, linker command failed
22 2017-02-10 15:45:47 <RxMcDonald> so, i don't think I fixed anyhting, nice
23 2017-02-10 15:46:22 <RxMcDonald> gonna build again from sracth and see if that fixes it
24 2017-02-10 15:53:47 <RxMcDonald> Chris_Stewart_5: so, now I'm getting undefined symbols for x86_64 every time I try to compile it, fml
25 2017-02-10 15:54:22 <RxMcDonald> do you know how to find the exact place and reason for this? xD
26 2017-02-10 16:00:08 <Chris_Stewart_5> I'm sure honestly, can you paste the line of code in here? Or in pastebin or something?
27 2017-02-10 16:00:17 <Chris_Stewart_5> I'm *not* sure*
28 2017-02-10 16:02:34 <RxMcDonald> Chris_Stewart_5: I created a new issue on SO http://stackoverflow.com/questions/42163624/undefined-symbols-for-architecture-x86-64-when-compiling-bitcoin-from-source-in
29 2017-02-10 16:02:52 <RxMcDonald> The problem could be related to trying to print a uint256 value I guess ?
30 2017-02-10 16:04:13 <Chris_Stewart_5> I would put that piece of code in your question as it is relevant
31 2017-02-10 16:05:51 <RxMcDonald> I made too many changes already I'm, not sure where the error could be anymore fml
32 2017-02-10 16:08:03 <RxMcDonald> I think i'm going to checkout the whole file, chainparams.cpp and see if that fixes it
33 2017-02-10 16:09:45 <RxMcDonald> lmao still getting the same error
34 2017-02-10 16:13:50 <RxMcDonald> 3k compile errors and growing, nice
35 2017-02-10 16:14:13 <RxMcDonald> yep, same problem
36 2017-02-10 16:16:33 <RxMcDonald> I think it could be related to qt ?
37 2017-02-10 16:16:40 <RxMcDonald> gonna try building from the cli
38 2017-02-10 16:19:13 <RxMcDonald> trying with the latest git commit before adding all these changes
39 2017-02-10 16:27:30 <Abstrct> Hi all, I'm looking for some help understanding the decoded read-out of a segwit transaction. Specifically (xtn) afa25ec695f2a3ee662da65e3d8379f87ff6aacb4517c212a7d7b21c063a274b
40 2017-02-10 16:28:11 <Abstrct> I'm hoping to trace it back to the previous input but I'm getting a tad lost in the data presentated and the docs
41 2017-02-10 16:29:18 <Chris_Stewart_5> RxMcDonald: I'm not familiar with qt at all unfortunately :-(
42 2017-02-10 16:29:22 <Abstrct> previous output*
43 2017-02-10 16:29:44 <RxMcDonald> Chris_Stewart_5: no it's not qt problem I think
44 2017-02-10 16:29:55 <Chris_Stewart_5> Abstrct: You should be able to paste it a block explorer and retrieve that tx
45 2017-02-10 16:30:08 <arubi> Abstrct, there is no previous output. it's the generation tx
46 2017-02-10 16:30:09 <RxMcDonald> I'm re compiling the version from the last git commit I made so if that works I fucked up somewhere along the way
47 2017-02-10 16:30:14 <Abstrct> for the vin, I see it has "coinbase": "03d3971000fe8d039358fe20230a000963676d696e6572343208000000000000000000", "txinwitness": [ "0000000000000000000000000000000000000000000000000000000000000000" ], "sequence": 4294967295
48 2017-02-10 16:30:37 <Abstrct> from the core decoderawtransaction rpc call
49 2017-02-10 16:30:37 <arubi> right, that's the coinbase
50 2017-02-10 16:32:04 <RxMcDonald> yea it looks like it's working
51 2017-02-10 16:32:45 <Abstrct> so this one links back to block reward that went to a segwit addy?
52 2017-02-10 16:33:44 <arubi> the block reward is sent to a normal p2pkh address
53 2017-02-10 16:34:04 <arubi> Abstrct, https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Commitment_structure
54 2017-02-10 16:35:40 <Abstrct> ya, I've read that a number of times but it's just not clicking for me :/
55 2017-02-10 16:35:52 <arubi> where are you stuck?
56 2017-02-10 16:37:36 <Abstrct> I'm not quite sure where the disconnect is for me. I like to think I understand what segwit is doing at a high level but I'm looking at that VIN and the BIP and I just don't see how it works.
57 2017-02-10 16:38:13 <arubi> again I ask, what specifically doesn't work for you? :) I mean, what do you expect to happen, and what happens instead?
58 2017-02-10 16:38:33 <Abstrct> My goal is to identify the previous output that this vin spends
59 2017-02-10 16:39:05 <Abstrct> but I'm not seeing the relatinoship between the two
60 2017-02-10 16:39:11 <arubi> there is not previous output
61 2017-02-10 16:39:45 <arubi> this is the transaction that pays the block reward. there's only coinbase where the input will usually be
62 2017-02-10 16:39:46 <waxwing> it's a secret scam in bitcoin, don't tell anyone :)
63 2017-02-10 16:40:04 <arubi> hehe yea, if you run enough miners, you can actually create bitcoins from thin air!
64 2017-02-10 16:40:31 <Abstrct> ok, so this is the block reward. great
65 2017-02-10 16:40:44 <molz_> Abstrct, which block is this?
66 2017-02-10 16:41:00 <arubi> 1087443 on testnet
67 2017-02-10 16:41:04 <Abstrct> 000000000a39c29f2a52b92bdd3492ebe692e6b719b993f82f0792ba6329b337
68 2017-02-10 16:41:09 <molz_> oh
69 2017-02-10 16:41:17 <molz_> i kept looking on mainnet lol
70 2017-02-10 16:41:26 <molz_> thanks arubi
71 2017-02-10 16:41:27 <Abstrct> heh no, xtn
72 2017-02-10 16:41:33 <arubi> I wish we had segwit on mainnet :)
73 2017-02-10 16:41:55 <Abstrct> not until I understand it pls D:
74 2017-02-10 16:42:12 <arubi> :)
75 2017-02-10 16:42:46 <molz_> well arubi there's still a lot of misunderstanding on segwit out there... blew my mind
76 2017-02-10 16:43:41 <arubi> yea tell me about it, it gets repeated so much that to some folks it looks like genuine information
77 2017-02-10 16:43:44 <Abstrct> so why in this case would the txwitness = "0000000000000000000000000000000000000000000000000000000000000000"
78 2017-02-10 16:43:51 <Abstrct> what is this representing?
79 2017-02-10 16:44:04 <arubi> the witness reserved value
80 2017-02-10 16:45:02 <molz_> hm .. block 1087443 didn't mind segwit version though
81 2017-02-10 16:45:08 <molz_> mine*
82 2017-02-10 16:45:41 <arubi> I guess you mean the bip9 version? it's because it's already activated on testnet
83 2017-02-10 16:46:33 <molz_> or blocktrail is wrong
84 2017-02-10 16:47:09 <arubi> https://testnet.smartbit.com.au ftw
85 2017-02-10 16:47:31 <Abstrct> does anybdoy have an example of a tx with a segwit output being spent?
86 2017-02-10 16:47:50 <Abstrct> I mean, i could generate one.. but if you happen to have one handy
87 2017-02-10 16:48:36 <molz_> i have plenty
88 2017-02-10 16:49:42 <molz_> https://testnet.smartbit.com.au/tx/f70f161d77717cf30cec3560df6d26f463f001673a5c7c35383bcd646cc5feca
89 2017-02-10 16:51:01 <Abstrct> ok, this makes a lot more sense
90 2017-02-10 16:51:03 <Abstrct> thnx
91 2017-02-10 16:52:52 <molz_> decoderawtransaction for that tx: http://paste.ubuntu.com/23967663/
92 2017-02-10 16:53:42 <Abstrct> This is what I always expected to see, basically no changes aside from some additioinal crap
93 2017-02-10 16:53:58 <arubi> \o/ soft fork
94 2017-02-10 16:54:35 <Abstrct> I think it was actually that second vout in the transaction I posted that was my actual bug, and appears unrelated to segwit
95 2017-02-10 16:55:39 <arubi> you mean the one in op_return? that's where the commitment for segwit data is
96 2017-02-10 16:57:06 <Abstrct> ok, that makes sense too
97 2017-02-10 16:57:35 <Abstrct> but I can also not care about it in what I'm working on (famous last words..)
98 2017-02-10 17:03:13 <Abstrct> Thanks for all your help
99 2017-02-10 17:06:13 <arubi> cheers
100 2017-02-10 18:27:38 <jimpo> Can someone explain what the fClient flag means?
101 2017-02-10 18:30:13 <arubi> jimpo, it would help if you provide context
102 2017-02-10 18:32:00 <jimpo> I've been poking around parts of Bitcoin core and found this flag https://github.com/bitcoin/bitcoin/blob/master/src/net.h#L604
103 2017-02-10 18:32:24 <jimpo> It looks like some sort of light, reduced verification mode
104 2017-02-10 18:32:32 <jimpo> that's been around since v0.1
105 2017-02-10 18:33:17 <jimpo> I still feel like I don't have the full picture on this flag and was hoping someone could shed some light
106 2017-02-10 18:34:14 <arubi> yea I see, looks like 'fClient = false; // set by version message' in net.cpp so maybe worth to look at "version message"
107 2017-02-10 18:34:27 <arubi> really haven't messed with p2p stuff at all
108 2017-02-10 19:15:53 <molz_> arubi, how did he get this from that block: <Abstrct> so why in this case would the txwitness = "0000000000000000000000000000000000000000000000000000000000000000"
109 2017-02-10 19:28:11 <arubi> it's called the witness reserved value, it's the witness for the coinbase "input|output", it says "0x20 0x0000000000000000000000000000000000000000000000000000000000000000" which is just a push operation that pushes 0x0000...
110 2017-02-10 19:28:45 <arubi> it's in the witness part of the transaction
111 2017-02-10 19:30:44 <arubi> (the generation transaction of that block)
112 2017-02-10 22:49:30 <RxMcDonald> Is the genesis block hard-coded somewhere in the chainparams.cpp?
113 2017-02-10 22:51:46 <RxMcDonald> trying to start a new blockchain
114 2017-02-10 22:55:45 <achow101> RxMcDonald: yes
115 2017-02-10 22:56:28 <RxMcDonald> achow101: oh nice, so just changing that value will start a new blockchain? where is it exactly?
116 2017-02-10 22:56:34 <achow101> https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L19
117 2017-02-10 22:56:53 <achow101> it actually builds the block and hashes it, then checks the hash, so you will need to change the assert
118 2017-02-10 22:57:38 <achow101> https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L19 and the line after will need to be changed if you change the genesis block in CreateGenesisBlock
119 2017-02-10 22:58:45 <RxMcDonald> so, what do I do if I want to start a new blockchain?
120 2017-02-10 22:58:51 <RxMcDonald> just change the assert?
121 2017-02-10 22:59:02 <RxMcDonald> or the genesis = ?
122 2017-02-10 22:59:29 <RxMcDonald> change this ? genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
123 2017-02-10 23:00:30 <achow101> you have to change the assert to match whatever block you create.
124 2017-02-10 23:00:58 <RxMcDonald> Yeah, I got that, but how do I make it create a new genesis block?
125 2017-02-10 23:01:03 <achow101> to change the block, you can change this: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L117
126 2017-02-10 23:01:14 <achow101> anything in this function: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L51
127 2017-02-10 23:01:25 <achow101> and anything in this function: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L19
128 2017-02-10 23:01:39 <RxMcDonald> so, just changing anything in there will automatically generate a new genesis block?
129 2017-02-10 23:01:42 <achow101> you'll probably want to change pszTimestamp and the output script
130 2017-02-10 23:02:21 <achow101> it will create a block according to the parameters, which you have to change in order to get a different block
131 2017-02-10 23:03:29 <achow101> then you need to get the hash of the block. easiest way is to just log the genesis hash to the debug.log file and then replace the hash in the assert with the hash of the block. you will need to do the same with the merkle root
132 2017-02-10 23:04:35 <RxMcDonald> yes that's what I was trying to do earlier but my code didn't compile, can you show me how would you log it exactly?
133 2017-02-10 23:05:36 <RxMcDonald> LogPrintf("new mainnet genesis hash: %s\n", genesis.GetHash().ToString()); // like this?
134 2017-02-10 23:05:47 <RxMcDonald> just adding that?
135 2017-02-10 23:06:23 <achow101> that should work
136 2017-02-10 23:06:44 <achow101> you will need to do the same for genesis.hashMerkleRoot
137 2017-02-10 23:08:14 <RxMcDonald> do I need to change this? consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000005c13f99f6d0b1a908");
138 2017-02-10 23:09:31 <achow101> yes. with a new blockchain you will need to remove that, consensus.assumeDefaultValid, and all of the checkpoints (just leave the list empty but the variable still there
139 2017-02-10 23:14:59 <RxMcDonald> alright, just changing that it compiled
140 2017-02-10 23:17:02 <RxMcDonald> Error: Incorrect or no genesis block found. Wrong datadir for network?
141 2017-02-10 23:18:19 <achow101> you need a blank datadir otherwise it will fail
142 2017-02-10 23:20:14 <RxMcDonald> MBP:faratest mb$ ./src/faragecoind âââ2017-02-10 23:19:18 *** Failed to read block
143 2017-02-10 23:20:25 <RxMcDonald> Error: Error: A fatal internal error occurred, see debug.log for details
144 2017-02-10 23:20:56 <RxMcDonald> ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
145 2017-02-10 23:22:04 <RxMcDonald> achow101: http://pastebin.com/AB11Jtim care to take a look?
146 2017-02-10 23:22:22 <achow101> this is altcoin stuff now, it is off topic for this channel. If you are trying to be an altcoin dev, then you should be able to figure it out and debug it yourself. That includes knowing how to just grep for things in code and follow logic. I will not help you anymore
147 2017-02-10 23:22:54 <RxMcDonald> I called it like that it's my test dir for bitcoin
148 2017-02-10 23:23:17 <RxMcDonald> i have several folders with different copies, just trying to start a new blockchain
149 2017-02-10 23:25:05 <achow101> I'm not going to hand-hold you through making an altcoin. just use grep or Github's search function and find out what line the error is being thrown at and just look to see what is causing that. the names are all fairly self explanatory and there are comments
150 2017-02-10 23:26:24 <RxMcDonald> I'm not trying to make an altcoin, I'm trying to test and understand the whole bitcoin codebase and get into bitcoin development
151 2017-02-10 23:27:08 <achow101> in what way do you think that making a new genesis block is going to help you?
152 2017-02-10 23:27:11 <RxMcDonald> The process for learning it includes creating a local coin? yes It's not going to be uploaded or used or anything, it's for testing
153 2017-02-10 23:27:22 <achow101> if you want a local coin just for testing, use regtest
154 2017-02-10 23:27:35 <RxMcDonald> I want to have several different coins with different params and test stuff
155 2017-02-10 23:28:08 <RxMcDonald> I need the whole coin for testing
156 2017-02-10 23:28:27 <RxMcDonald> that is the only way to learn it imho, it's how I learn anything, just reproducing and playing with it
157 2017-02-10 23:28:29 <achow101> even so, if you are trying to get into any sort of software development, you should be able to read code, follow code paths, and search for errors that are being printed to logs or the console
158 2017-02-10 23:28:47 <achow101> (learn these things before actually doing)
159 2017-02-10 23:28:50 <RxMcDonald> Yeah, alright, didn't meant to bother you
160 2017-02-10 23:29:10 <RxMcDonald> just, pretty hard to get into this codebase
161 2017-02-10 23:29:50 <achow101> the issue here is that when you read this codebase, most things are named explicitly and are self explanatory. it should not take someone to explain to you that the function named CreateGenesisBlock is what makes the genesis block
162 2017-02-10 23:30:10 <RxMcDonald> No, I already know that
163 2017-02-10 23:32:51 <achow101> anyways, your problem is the PoW of your genesis block is bad. if you just search part of the error in github, you will find that the first code result is https://github.com/bitcoin/bitcoin/blob/668de70be039a4f1ffcf20aeae2a22ee71fc55a8/src/validation.cpp#L1151 and that you can infer the issue is because CheckProofOfWork returned false thus causing the error to be thrown
164 2017-02-10 23:36:51 <RxMcDonald> yeah
165 2017-02-10 23:40:48 <RxMcDonald> changed consensus.fPowAllowMinDifficultyBlocks = true; hope it fixes it
166 2017-02-10 23:57:29 <RxMcDonald> achow101: well, it didn't fix it