1 2017-10-01T00:02:24  *** marcoagner has quit IRC
  2 2017-10-01T00:16:48  *** Belxjander has quit IRC
  3 2017-10-01T00:17:54  *** one_zero has joined #bitcoin-dev
  4 2017-10-01T00:19:17  *** Belxjander has joined #bitcoin-dev
  5 2017-10-01T00:39:59  *** Belxjander has quit IRC
  6 2017-10-01T00:44:41  *** Belxjander has joined #bitcoin-dev
  7 2017-10-01T01:15:13  *** BashCo has quit IRC
  8 2017-10-01T01:15:14  *** dviola has quit IRC
  9 2017-10-01T01:23:39  *** luke-jr has quit IRC
 10 2017-10-01T01:33:49  *** luke-jr has joined #bitcoin-dev
 11 2017-10-01T01:42:28  *** digitalway has quit IRC
 12 2017-10-01T01:43:08  *** priidu has quit IRC
 13 2017-10-01T01:46:02  *** qrestlove has quit IRC
 14 2017-10-01T01:47:08  *** Belxjander has quit IRC
 15 2017-10-01T01:49:03  *** BashCo has joined #bitcoin-dev
 16 2017-10-01T01:50:07  *** qrestlove has joined #bitcoin-dev
 17 2017-10-01T01:52:27  *** Belxjander has joined #bitcoin-dev
 18 2017-10-01T01:55:33  *** dviola has joined #bitcoin-dev
 19 2017-10-01T01:56:01  *** Belxjander has quit IRC
 20 2017-10-01T01:58:50  *** Belxjander has joined #bitcoin-dev
 21 2017-10-01T02:05:08  *** lnovy has quit IRC
 22 2017-10-01T02:09:16  *** lnovy has joined #bitcoin-dev
 23 2017-10-01T02:12:37  *** qrestlove has quit IRC
 24 2017-10-01T02:16:58  *** qrestlove has joined #bitcoin-dev
 25 2017-10-01T02:21:57  *** Belxjander has quit IRC
 26 2017-10-01T02:23:24  *** Belxjander has joined #bitcoin-dev
 27 2017-10-01T02:34:59  *** Belxjander has quit IRC
 28 2017-10-01T02:36:24  *** Belxjander has joined #bitcoin-dev
 29 2017-10-01T02:37:12  *** BashCo_ has joined #bitcoin-dev
 30 2017-10-01T02:37:15  *** POJO has joined #bitcoin-dev
 31 2017-10-01T02:37:17  *** BashCo has quit IRC
 32 2017-10-01T02:37:51  *** wxxs has quit IRC
 33 2017-10-01T02:41:36  *** BashCo_ has quit IRC
 34 2017-10-01T02:52:37  *** Belxjander has quit IRC
 35 2017-10-01T02:53:00  *** qrestlove has quit IRC
 36 2017-10-01T02:53:25  *** Belxjander has joined #bitcoin-dev
 37 2017-10-01T02:56:24  *** subo has joined #bitcoin-dev
 38 2017-10-01T03:00:05  *** subo_ has quit IRC
 39 2017-10-01T03:06:58  *** qrestlove has joined #bitcoin-dev
 40 2017-10-01T03:08:24  *** qrestlove has quit IRC
 41 2017-10-01T03:09:37  *** qrestlove has joined #bitcoin-dev
 42 2017-10-01T03:10:38  *** Belxjander has quit IRC
 43 2017-10-01T03:16:54  *** Belxjander has joined #bitcoin-dev
 44 2017-10-01T03:17:55  *** sdfgsdfg_ has joined #bitcoin-dev
 45 2017-10-01T03:20:33  *** sdfgsdfg__ has quit IRC
 46 2017-10-01T03:31:12  <wallet42> esotericnonsense: that's what i though it would do but it felt highly inefficient. but i guess that's the whole point why it's deprecated
 47 2017-10-01T03:33:26  <esotericnonsense> wallet42: i'm not fully up to scratch on the chainstate format (past or present); one thing I remember seeing is that it should be possible to prune spent outputs from it while keeping other outputs within the same transaction
 48 2017-10-01T03:33:55  <wallet42> yes the new format is actually quite straigtforward
 49 2017-10-01T03:33:57  <esotericnonsense> not sure if that already happens; if it does then getrawtransaction could only work for transactions that have all outputs unspent
 50 2017-10-01T03:34:17  <wallet42> yes it needs at least 1 utxo
 51 2017-10-01T03:34:35  <wallet42> getting the block height
 52 2017-10-01T03:34:46  <wallet42> then looking up in blockindex
 53 2017-10-01T03:34:49  <esotericnonsense> ah that's it. right. so it requires 1 utxo _and_ unpruned
 54 2017-10-01T03:34:56  *** POJO has quit IRC
 55 2017-10-01T03:35:16  <wallet42> yep
 56 2017-10-01T03:35:40  <esotericnonsense> (thinking about it on a theoretical level rather than how it's actually implemented, i don't know if getrawtransaction works at all on a pruned node)
 57 2017-10-01T03:36:59  <wallet42> it does, but only best effort
 58 2017-10-01T03:38:18  <wallet42> pruning is also just deleting whole blk files
 59 2017-10-01T03:38:28  <wallet42> the blockindex has pointers to those files
 60 2017-10-01T03:38:34  <wallet42> the pointers dont get removed
 61 2017-10-01T03:38:52  <wallet42> but if the data at pointer doesnt exist anymore, it fails
 62 2017-10-01T03:44:46  <esotericnonsense> of course :P
 63 2017-10-01T03:44:49  <esotericnonsense> okay
 64 2017-10-01T04:04:05  *** Belxjander has quit IRC
 65 2017-10-01T04:04:29  *** sh_smith has quit IRC
 66 2017-10-01T04:06:04  *** qrestlove has quit IRC
 67 2017-10-01T04:08:08  *** [7] has quit IRC
 68 2017-10-01T04:08:12  *** sh_smith has joined #bitcoin-dev
 69 2017-10-01T04:09:05  *** TheSeven has joined #bitcoin-dev
 70 2017-10-01T04:09:43  *** qrestlove has joined #bitcoin-dev
 71 2017-10-01T04:10:04  *** Belxjander has joined #bitcoin-dev
 72 2017-10-01T04:23:28  *** Belxjander has quit IRC
 73 2017-10-01T04:26:02  *** Belxjander has joined #bitcoin-dev
 74 2017-10-01T04:30:33  *** qrestlove has quit IRC
 75 2017-10-01T04:34:05  *** sdfgsdfg_ has quit IRC
 76 2017-10-01T04:34:08  *** qrestlove has joined #bitcoin-dev
 77 2017-10-01T04:37:45  *** sdfgsdfg has joined #bitcoin-dev
 78 2017-10-01T04:38:20  *** TheSeven has quit IRC
 79 2017-10-01T04:38:49  *** TheSeven has joined #bitcoin-dev
 80 2017-10-01T04:48:01  *** Belxjander has quit IRC
 81 2017-10-01T04:51:23  *** dviola has quit IRC
 82 2017-10-01T04:53:19  *** Belxjander has joined #bitcoin-dev
 83 2017-10-01T05:11:39  *** Letze has quit IRC
 84 2017-10-01T05:11:56  *** Letze has joined #bitcoin-dev
 85 2017-10-01T05:12:09  *** iv3c has quit IRC
 86 2017-10-01T05:15:50  *** POJO has joined #bitcoin-dev
 87 2017-10-01T05:18:51  *** Beef has quit IRC
 88 2017-10-01T05:22:08  *** POJO has quit IRC
 89 2017-10-01T05:22:24  *** Beef has joined #bitcoin-dev
 90 2017-10-01T05:28:47  *** Belxjander has quit IRC
 91 2017-10-01T05:35:23  *** Belxjander has joined #bitcoin-dev
 92 2017-10-01T05:35:23  *** qrestlove has quit IRC
 93 2017-10-01T05:42:46  *** CheckDavid has joined #bitcoin-dev
 94 2017-10-01T05:47:17  *** qrestlove has joined #bitcoin-dev
 95 2017-10-01T05:52:08  *** meshcollider has quit IRC
 96 2017-10-01T06:03:41  *** harai has joined #bitcoin-dev
 97 2017-10-01T06:17:42  *** damons has quit IRC
 98 2017-10-01T06:18:26  *** sdfgsdfg_ has joined #bitcoin-dev
 99 2017-10-01T06:20:38  *** sdfgsdfg has quit IRC
100 2017-10-01T06:23:05  *** Belxjander has quit IRC
101 2017-10-01T06:25:42  *** Belxjander has joined #bitcoin-dev
102 2017-10-01T06:32:14  *** sdfgsdfg_ has quit IRC
103 2017-10-01T06:51:45  *** Belxjander has quit IRC
104 2017-10-01T06:57:15  *** Belxjander has joined #bitcoin-dev
105 2017-10-01T07:06:35  *** Belxjander has quit IRC
106 2017-10-01T07:09:53  *** harai has quit IRC
107 2017-10-01T07:13:24  *** Belxjander has joined #bitcoin-dev
108 2017-10-01T07:25:25  *** sdfgsdfg has joined #bitcoin-dev
109 2017-10-01T07:35:06  *** Chris_Stewart_5 has joined #bitcoin-dev
110 2017-10-01T08:02:49  *** CheckDavid has quit IRC
111 2017-10-01T08:04:01  *** d9b4bef9 has quit IRC
112 2017-10-01T08:05:08  *** d9b4bef9 has joined #bitcoin-dev
113 2017-10-01T08:14:51  *** harai has joined #bitcoin-dev
114 2017-10-01T08:18:06  *** sdfgsdfg has quit IRC
115 2017-10-01T08:33:08  *** Belxjander has quit IRC
116 2017-10-01T08:33:42  *** Guyver2 has joined #bitcoin-dev
117 2017-10-01T08:35:21  *** Belxjander has joined #bitcoin-dev
118 2017-10-01T08:44:45  *** CheckDavid has joined #bitcoin-dev
119 2017-10-01T08:44:46  *** Chris_Stewart_5 has quit IRC
120 2017-10-01T08:45:22  *** DTZUZO has quit IRC
121 2017-10-01T08:54:29  *** luke-jr has quit IRC
122 2017-10-01T08:54:38  *** luke-jr has joined #bitcoin-dev
123 2017-10-01T08:56:07  *** mattcode has joined #bitcoin-dev
124 2017-10-01T08:56:24  *** Belxjander has quit IRC
125 2017-10-01T09:01:15  *** Belxjander has joined #bitcoin-dev
126 2017-10-01T09:01:35  *** Chris_Stewart_5 has joined #bitcoin-dev
127 2017-10-01T09:22:59  *** TheAdversary has quit IRC
128 2017-10-01T09:24:49  *** TheAdversary has joined #bitcoin-dev
129 2017-10-01T09:26:07  *** Belxjander has quit IRC
130 2017-10-01T09:28:25  *** Belxjander has joined #bitcoin-dev
131 2017-10-01T09:39:11  *** BashCo has joined #bitcoin-dev
132 2017-10-01T09:39:44  *** Belxjander has quit IRC
133 2017-10-01T09:46:14  *** Belxjander has joined #bitcoin-dev
134 2017-10-01T09:48:09  *** jtimon has quit IRC
135 2017-10-01T09:50:04  *** Chris_Stewart_5 has quit IRC
136 2017-10-01T09:50:42  *** jtimon has joined #bitcoin-dev
137 2017-10-01T09:51:35  *** Chris_Stewart_5 has joined #bitcoin-dev
138 2017-10-01T10:00:01  *** Chris_Stewart_5 has quit IRC
139 2017-10-01T10:04:38  *** jtimon has quit IRC
140 2017-10-01T10:08:11  *** BashCo_ has joined #bitcoin-dev
141 2017-10-01T10:11:37  *** BashCo has quit IRC
142 2017-10-01T10:18:07  *** Belxjander has quit IRC
143 2017-10-01T10:18:42  *** BashCo_ has quit IRC
144 2017-10-01T10:20:08  *** meshcollider has joined #bitcoin-dev
145 2017-10-01T10:24:11  *** Belxjander has joined #bitcoin-dev
146 2017-10-01T10:25:18  *** BashCo has joined #bitcoin-dev
147 2017-10-01T10:38:18  *** POJO has joined #bitcoin-dev
148 2017-10-01T10:41:37  *** eck has quit IRC
149 2017-10-01T10:43:29  *** eck has joined #bitcoin-dev
150 2017-10-01T10:44:47  *** POJO has quit IRC
151 2017-10-01T10:48:12  *** one_zero has quit IRC
152 2017-10-01T10:53:43  *** CheckDavid has quit IRC
153 2017-10-01T11:22:08  *** Belxjander has quit IRC
154 2017-10-01T11:24:33  *** Belxjander has joined #bitcoin-dev
155 2017-10-01T11:27:46  *** wxxs has joined #bitcoin-dev
156 2017-10-01T12:04:07  *** Belxjander has quit IRC
157 2017-10-01T12:05:06  *** BashCo_ has joined #bitcoin-dev
158 2017-10-01T12:05:58  *** BashCo has quit IRC
159 2017-10-01T12:11:01  *** Belxjander has joined #bitcoin-dev
160 2017-10-01T12:14:34  *** POJO has joined #bitcoin-dev
161 2017-10-01T12:22:24  *** Belxjander has quit IRC
162 2017-10-01T12:23:37  *** Belxjander has joined #bitcoin-dev
163 2017-10-01T12:36:26  *** Belxjander has quit IRC
164 2017-10-01T12:39:08  *** Belxjander has joined #bitcoin-dev
165 2017-10-01T12:56:33  *** Belxjander has quit IRC
166 2017-10-01T13:01:43  *** Belxjander has joined #bitcoin-dev
167 2017-10-01T13:05:40  *** SopaXorzTaker has joined #bitcoin-dev
168 2017-10-01T13:22:54  *** Belxjander has quit IRC
169 2017-10-01T13:29:35  *** Belxjander has joined #bitcoin-dev
170 2017-10-01T13:59:43  *** meshcollider has quit IRC
171 2017-10-01T14:22:35  *** iv3c has joined #bitcoin-dev
172 2017-10-01T14:29:29  *** Chris_Stewart_5 has joined #bitcoin-dev
173 2017-10-01T14:32:00  *** cybrNaut has joined #bitcoin-dev
174 2017-10-01T14:32:30  *** cybrNaut has joined #bitcoin-dev
175 2017-10-01T14:33:30  *** jtimon has joined #bitcoin-dev
176 2017-10-01T14:39:37  *** Chris_Stewart_5 has quit IRC
177 2017-10-01T14:51:58  *** Belxjander has quit IRC
178 2017-10-01T14:56:29  *** Belxjander has joined #bitcoin-dev
179 2017-10-01T15:00:39  *** wxxs_ has joined #bitcoin-dev
180 2017-10-01T15:02:37  *** wxxs has quit IRC
181 2017-10-01T15:02:50  *** wxxs_ is now known as wxxs
182 2017-10-01T15:07:00  *** Chris_Stewart_5 has joined #bitcoin-dev
183 2017-10-01T15:12:12  *** qrestlove has quit IRC
184 2017-10-01T15:16:43  *** qrestlove has joined #bitcoin-dev
185 2017-10-01T15:18:24  *** Belxjander has quit IRC
186 2017-10-01T15:20:19  *** dermoth has joined #bitcoin-dev
187 2017-10-01T15:20:50  *** Belxjander has joined #bitcoin-dev
188 2017-10-01T15:30:35  *** Belxjander has quit IRC
189 2017-10-01T15:37:11  *** Belxjander has joined #bitcoin-dev
190 2017-10-01T15:37:53  *** damons has joined #bitcoin-dev
191 2017-10-01T15:50:20  *** PaulCapestany has joined #bitcoin-dev
192 2017-10-01T16:05:36  *** priidu has joined #bitcoin-dev
193 2017-10-01T16:08:07  *** DTZUZO has joined #bitcoin-dev
194 2017-10-01T16:15:30  *** nirj34 has joined #bitcoin-dev
195 2017-10-01T16:16:00  *** nirj34 has joined #bitcoin-dev
196 2017-10-01T16:16:28  *** iv3c has quit IRC
197 2017-10-01T16:16:36  *** nirj34 has quit IRC
198 2017-10-01T16:17:07  *** Chris_Stewart_5 has quit IRC
199 2017-10-01T16:20:18  *** qrestlove has quit IRC
200 2017-10-01T16:29:35  *** sh_smith has quit IRC
201 2017-10-01T16:31:40  *** Chris_Stewart_5 has joined #bitcoin-dev
202 2017-10-01T16:32:13  *** sh_smith has joined #bitcoin-dev
203 2017-10-01T16:33:32  *** qrestlove has joined #bitcoin-dev
204 2017-10-01T16:33:33  *** sh_smith has quit IRC
205 2017-10-01T16:36:13  *** sh_smith has joined #bitcoin-dev
206 2017-10-01T16:53:34  *** ddustin has joined #bitcoin-dev
207 2017-10-01T17:13:12  *** Chris_Stewart_5 has quit IRC
208 2017-10-01T17:15:23  *** wxxs has quit IRC
209 2017-10-01T17:19:51  *** wxxs has joined #bitcoin-dev
210 2017-10-01T17:27:10  *** Chris_Stewart_5 has joined #bitcoin-dev
211 2017-10-01T17:39:28  *** adiabat has quit IRC
212 2017-10-01T17:47:17  *** Belxjander has quit IRC
213 2017-10-01T17:52:11  *** Belxjander has joined #bitcoin-dev
214 2017-10-01T18:17:27  *** hidden has joined #bitcoin-dev
215 2017-10-01T18:19:49  *** SopaXorzTaker has quit IRC
216 2017-10-01T18:20:32  *** ddustin_ has joined #bitcoin-dev
217 2017-10-01T18:20:37  <hidden> so quiet
218 2017-10-01T18:22:11  *** ddustin has quit IRC
219 2017-10-01T18:23:26  *** BashCo has joined #bitcoin-dev
220 2017-10-01T18:25:21  *** BashCo_ has quit IRC
221 2017-10-01T18:26:58  *** intcat has quit IRC
222 2017-10-01T18:28:40  *** intcat has joined #bitcoin-dev
223 2017-10-01T18:34:29  *** hidden has quit IRC
224 2017-10-01T19:01:51  *** djdjjj has joined #bitcoin-dev
225 2017-10-01T19:03:41  <djdjjj> question re. TXs: What's the reason for the actual redeemer's pubkey being included in the tx, given that it already can be found by the txin/index info? (I'm going through https://en.bitcoin.it/wiki/Transaction)
226 2017-10-01T19:04:00  *** BashCo has quit IRC
227 2017-10-01T19:04:02  *** BashCo_ has joined #bitcoin-dev
228 2017-10-01T19:07:23  *** Dizzle has joined #bitcoin-dev
229 2017-10-01T19:09:44  *** meshcollider has joined #bitcoin-dev
230 2017-10-01T19:13:53  *** wxxs_ has joined #bitcoin-dev
231 2017-10-01T19:15:00  <arubi> djdjjj, you mean at signing time?  you're right.  it doesn't have to be there at all.  the prevtx's txid explicitly passes that information to the signature anyway
232 2017-10-01T19:15:44  *** wxxs has quit IRC
233 2017-10-01T19:15:46  <djdjjj> arubi: signing time, yes. So is there any particular reason it's there?
234 2017-10-01T19:15:48  *** wxxs_ is now known as wxxs
235 2017-10-01T19:16:25  <arubi> djdjjj, maybe if you could include input scripts into sighash, but other than that it's really not needed.  security stays the same
236 2017-10-01T19:18:54  <djdjjj> thx arubi. Another one: when nodes verify if a tx is valid by validating the chain of ownership, how far back (in number of txs) do they go?
237 2017-10-01T19:19:05  <djdjjj> (I'm a newbie to bitcoin btw)
238 2017-10-01T19:20:00  <arubi> they just need to look at their known database of spendable outputs
239 2017-10-01T19:20:22  <arubi> if it isn't there, it's invalid.  full nodes have the most updated database at all times if they're connected to the network
240 2017-10-01T19:22:29  <djdjjj> So if I send 1BTC to Bob, full nodes have to validate that I'm the rightful owner of my referenced inputs, right?
241 2017-10-01T19:23:00  <arubi> that's done by verifying you signatures against the inputs' scripts, right
242 2017-10-01T19:23:04  <arubi> (brb)
243 2017-10-01T19:23:41  <djdjjj> right. But don't they have to also verify the inputs of my referenced inputs and so on?
244 2017-10-01T19:23:44  *** lnovy has quit IRC
245 2017-10-01T19:24:20  <djdjjj> eg. what if the referenced input of one of my inputs is invalid
246 2017-10-01T19:24:28  <arubi> no, because you only spend the previous tx's outputs, not the whole chain
247 2017-10-01T19:24:42  <arubi> then the input itself can't exist in the utxo set
248 2017-10-01T19:24:49  <arubi> which is the database of spendable outputs
249 2017-10-01T19:24:51  <djdjjj> come to think of it, this is probably not needed since this validation work of those previous inputs is already done since it's already included in a block
250 2017-10-01T19:24:58  <arubi> :)
251 2017-10-01T19:25:51  <djdjjj> oh so this utxo set is a global one? Every node knows all the UTXOs on the chain?
252 2017-10-01T19:26:47  <arubi> yes, it's what all full nodes agree on
253 2017-10-01T19:27:01  <djdjjj> makes sense now, thanks :)
254 2017-10-01T19:27:04  <arubi> yw
255 2017-10-01T19:27:51  <djdjjj> so there's that invariant: a UTXO's txinputs cannot be UTXO themselves
256 2017-10-01T19:29:09  <arubi> oh sure, because they haven't been created yet when you try to spend them
257 2017-10-01T19:29:48  *** intcat has quit IRC
258 2017-10-01T19:30:20  *** dermoth has quit IRC
259 2017-10-01T19:30:29  <djdjjj> otherwise that would be double-spending, wouldn't it?
260 2017-10-01T19:31:00  <arubi> not saying it can't happen, but you'd need to break sha256 to set it up
261 2017-10-01T19:31:37  <arubi> you're trying to set up a tx that when redeeming an input has the same txid as that input.  sounds possible, but not with current tech :)
262 2017-10-01T19:32:20  <djdjjj> ah right
263 2017-10-01T19:32:27  *** intcat has joined #bitcoin-dev
264 2017-10-01T19:34:00  <djdjjj> I didn't knew that UTXO database is part of the consensus protocol btw. I thought only the proof-of-work chain was part of it
265 2017-10-01T19:35:17  <arubi> right the utxo is the grand thing everyone agrees on because everybody follows the same consensus rules
266 2017-10-01T19:35:55  *** lnovy has joined #bitcoin-dev
267 2017-10-01T19:36:01  <djdjjj> I'm confused by these answers however that state that each node computes the UTXO set on its own https://bitcoin.stackexchange.com/questions/49393/is-the-utxo-set-computed-from-scratch-by-new-full-nodes
268 2017-10-01T19:37:01  <arubi> each node build their own view of what the utxo set is
269 2017-10-01T19:37:16  <arubi> but since everybody run the same rules, they will eventually agree
270 2017-10-01T19:37:30  <arubi> they might disagree sometimes, but it converges very quickly
271 2017-10-01T19:38:00  <djdjjj> ok I get it. So by looking at the UTXO set you can effectively compute how much BTC exists right now?
272 2017-10-01T19:38:15  <arubi> yep
273 2017-10-01T19:39:05  <arubi> there's a specific call in bitcoin core, 'gettxoutsetinfo' that does that
274 2017-10-01T19:43:05  *** Victorsueca has quit IRC
275 2017-10-01T19:44:03  *** Dizzle has quit IRC
276 2017-10-01T19:45:33  *** Victorsueca has joined #bitcoin-dev
277 2017-10-01T19:47:04  <djdjjj> re. my initial question, someone replied with a slightly different answer than yours I think: https://www.reddit.com/r/BitcoinBeginners/comments/73nmjr/technical_question_why_is_the_redeemers_pubkey_is/
278 2017-10-01T19:47:46  <arubi> which answer do you mean?
279 2017-10-01T19:48:29  <arubi> the address isn't playing a part in anything.  addresses are not part of the actual protocol.  the previous txid:index points to a scriptpubkey
280 2017-10-01T19:48:52  <arubi> in case it's p2pkh (send to address), it's obvious what should be the script spending it
281 2017-10-01T19:49:30  <arubi> at signing time, that scriptpubkey is signed, but it's redundant.  it was already hashed as part of the input's txid itself
282 2017-10-01T19:50:03  <arubi> it already exist in sighash, there's no need to explicitly put it in there again, but now I'm remembering op_codeseparator
283 2017-10-01T19:50:05  <djdjjj> my mistake then, I was talking about validation time, not signing time.
284 2017-10-01T19:50:44  <arubi> so actually djdjjj if we didn't have op_codeseparator, I'd be right, but we do and for some special cases, you do need the script signed too
285 2017-10-01T19:51:20  <arubi> validation is the same.  you know the utxo, you know the scriptpubkey required to spend it
286 2017-10-01T19:52:12  <djdjjj> I guess my confusion comes from the fact that I thought that addresses were just the public keys
287 2017-10-01T19:52:24  * djdjjj does some more reading...
288 2017-10-01T19:53:01  <arubi> addresses are just strings that when you tell a wallet to "send to them", it actually sends to a standard scriptpubkey that has the public key's hash instead of the public key itself
289 2017-10-01T19:53:55  <arubi> to redeem it, in the spending transaction, you provide the public key itself, and a valid signature.  so the previous tx's scriptpubkey is executed with these two as inputs
290 2017-10-01T19:54:03  <djdjjj> so address is a string representation of the hashed value of a public key?
291 2017-10-01T19:54:24  <arubi> right, and some other non interesting things.  mainly the pubkey's hash
292 2017-10-01T19:55:02  *** harai has quit IRC
293 2017-10-01T19:55:42  <djdjjj> so only the redeemer knows his/her own public key?
294 2017-10-01T19:55:50  <arubi> yes
295 2017-10-01T19:56:00  <djdjjj> the other peers only know his/her hashed keys (ie. addresses)
296 2017-10-01T19:56:07  *** fatalhalt has quit IRC
297 2017-10-01T19:56:24  <arubi> right, and to prove ownership of that key, the owner has to sign the hash of the key
298 2017-10-01T19:56:37  <arubi> which is just as hard as signing the key itself
299 2017-10-01T19:56:43  <arubi> (or easy if you have the private key)
300 2017-10-01T19:57:39  <arubi> that's why I initially said you could just use the previous txid, because it already contains the hash of the pubkey, but special singing conditions require the actual executed script too
301 2017-10-01T19:57:45  <djdjjj> so p2pkh is the simpler format AFAICT, and the most common one
302 2017-10-01T19:58:04  <arubi> it's most common yes, hopefully not for long as p2wpkh replaces it :)
303 2017-10-01T19:58:47  <arubi> (same idea, just a more efficient script)
304 2017-10-01T19:58:48  *** Victorsueca has quit IRC
305 2017-10-01T20:00:38  *** Victorsueca has joined #bitcoin-dev
306 2017-10-01T20:02:32  <djdjjj> it's clear a few paragraphs below in the wiki: "A Bitcoin address is only a hash, so the sender can't provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key."
307 2017-10-01T20:02:50  <djdjjj> it all makes sense now :)
308 2017-10-01T20:02:54  <djdjjj> thanks a lot
309 2017-10-01T20:02:59  <arubi> the paragraph is lacking really
310 2017-10-01T20:03:22  <djdjjj> x_x
311 2017-10-01T20:03:34  <djdjjj> in which way?
312 2017-10-01T20:03:38  <arubi> oh sorry, it does
313 2017-10-01T20:03:43  <arubi> "also checks the signature against the public key"
314 2017-10-01T20:03:48  <arubi> you're welcome :)
315 2017-10-01T20:04:24  *** adiabat has joined #bitcoin-dev
316 2017-10-01T20:04:25  <arubi> I missed the last "and then.." at first
317 2017-10-01T20:06:04  <djdjjj> so the actual public keys are not visible in wallets users (they only see addresses) but are visible in full nodes
318 2017-10-01T20:06:45  <arubi> address owners can run 'ismine <address>' and see the pubkey, but usually well done wallets try to avoid letting the user handle any keys at all
319 2017-10-01T20:07:01  *** Victor_sueca has joined #bitcoin-dev
320 2017-10-01T20:07:06  *** qrestlove has quit IRC
321 2017-10-01T20:07:33  <djdjjj> and the public keys in TXs appear only in the "scriptSig" part (talking about p2pkh addresses)
322 2017-10-01T20:07:40  <Sentineo> how did a p2pk addresslook like? was it the pubkey in base56? Or just plain?
323 2017-10-01T20:08:23  *** Victorsueca has quit IRC
324 2017-10-01T20:08:48  <Sentineo> djdjjj: yes, only in scriptSig (or as I like the more descriptive name unlocking script)
325 2017-10-01T20:08:49  <arubi> djdjjj, right, not a part of the recorded transaction at all
326 2017-10-01T20:09:06  <arubi> Sentineo, there isn't an address for that.  it's just a pubkey and checksig after
327 2017-10-01T20:09:36  <arubi> so sending to a pubkey would just be sending to a script "<pubkey> checksig"
328 2017-10-01T20:09:37  <Sentineo> ok, so historicaly base58 was cr3ated for p2pkh?
329 2017-10-01T20:09:47  <arubi> not base58 either, just hex pubkeys :)
330 2017-10-01T20:10:21  <Sentineo> are those still valid?
331 2017-10-01T20:10:28  <arubi> sure, and standard
332 2017-10-01T20:10:28  *** qrestlove has joined #bitcoin-dev
333 2017-10-01T20:10:30  <Sentineo> need to try on regt3st ;)
334 2017-10-01T20:10:33  <arubi> multisigs too
335 2017-10-01T20:10:44  <arubi> as bare scripts that is, not p2sh wrapped
336 2017-10-01T20:11:03  <Sentineo> yeah, remember those
337 2017-10-01T20:11:11  <Sentineo> been playing with them
338 2017-10-01T20:11:33  <arubi> miners used to pay themselves with a bare 1-of-1 multisig, weird, maybe to make the software count -20 sigops and have some safety margin for sigop count
339 2017-10-01T20:11:42  <djdjjj> so bare public keys are only used to verify the signature and to create addresses?
340 2017-10-01T20:11:45  <arubi> I don't know the reason.  not sure if minres still do :)
341 2017-10-01T20:11:59  <arubi> and multisig scripts
342 2017-10-01T20:12:14  *** Victorsueca has joined #bitcoin-dev
343 2017-10-01T20:12:24  <arubi> well these are wrapped in a hash themselves, so they're not bare, but you do interact with keys for that
344 2017-10-01T20:12:36  *** Chris_Stewart_5 has quit IRC
345 2017-10-01T20:13:19  <djdjjj> I see
346 2017-10-01T20:13:38  <djdjjj> so `scriptPubKey` is a little misleading name..
347 2017-10-01T20:13:42  *** dc0de has joined #bitcoin-dev
348 2017-10-01T20:13:45  *** Victor_sueca has quit IRC
349 2017-10-01T20:13:48  <arubi> scriptsig too
350 2017-10-01T20:14:01  <djdjjj> well that's kinda vague too yes
351 2017-10-01T20:14:23  <Sentineo> yep
352 2017-10-01T20:14:30  <Sentineo> well because it was mostly cod3
353 2017-10-01T20:14:31  <Sentineo> code
354 2017-10-01T20:14:32  <arubi> it's all because when these were made up, they had a bit different uses
355 2017-10-01T20:14:48  <Sentineo> yeah
356 2017-10-01T20:14:50  <djdjjj> as a sender, `scriptSig` contains my public key and my signature, and `scriptPubKey` contains the recipients hashed public key (ie. address)
357 2017-10-01T20:14:55  <arubi> scriptsig, you used to be able to execute scripts on there.  you still can to some extent, but not very useful
358 2017-10-01T20:15:11  <arubi> scriptsig is the script that runs before the input's scriptpubkey us run
359 2017-10-01T20:15:34  <Sentineo> djdjjj: scriptSig js the unlocking script and scriptPubkey, the locking
360 2017-10-01T20:15:35  <arubi> right now, scriptsig is only confined to pushes of data, so the script just pushes stuff like pubkeys and sigs to the stack
361 2017-10-01T20:15:48  <arubi> and when the scriptpubkey runs, these are its inputs
362 2017-10-01T20:16:10  <Sentineo> djdjjj: so when you send something you lock it (givr the crypto puzzle)
363 2017-10-01T20:16:11  <arubi> so for a p2pkh, the inputs on the stack, put there by scriptsig would be the pubkey and signature
364 2017-10-01T20:17:03  <arubi> for a p2pk, it's only the signature (pubkey not recorded, but in sighash as previous scriptpubkey), for p2pkh it's both (hash not recorded, but in sighash as previous scriptpbukey)
365 2017-10-01T20:18:04  <Sentineo> djdjjj: and to spend it, you have to unlock it by providing the scriptSig.
366 2017-10-01T20:19:16  <Sentineo> djdjjj: read this and it will make more sense ... https://github.com/bitcoinbook/bitcoinbook/blob/second_edition/ch06.asciidoc
367 2017-10-01T20:20:17  <arubi> no!  read http://enetium.com/resources/Bitcoin.pdf !
368 2017-10-01T20:20:56  <djdjjj> question: the `pubKey` in `scriptSig` is *my* public key, right?
369 2017-10-01T20:21:04  <djdjjj> (not the recipients)
370 2017-10-01T20:21:51  <arubi> yes, yours
371 2017-10-01T20:21:54  <arubi> the one redeeming
372 2017-10-01T20:22:08  <arubi> the recipient's is unknown yet :)
373 2017-10-01T20:22:15  <arubi> (sending to address, right)
374 2017-10-01T20:22:39  <djdjjj> I'm kinda confused by this: https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash
375 2017-10-01T20:23:07  <arubi> specifically?
376 2017-10-01T20:23:09  <djdjjj> when the OP_EQUALVERIFY comes into play, it says that it compares `pubHashA` with `pubKeyHash`
377 2017-10-01T20:23:25  <arubi> yes, and fails the script if it isn't equal
378 2017-10-01T20:23:26  <djdjjj> why would those be equal? Isn't `pubHashA` _my_ hashed public key?
379 2017-10-01T20:23:44  <djdjjj> and `pubKeyHash` the address of the recipient?
380 2017-10-01T20:23:49  <arubi> yes, it's compared to the hash in the input's scriptpubkey txid:index
381 2017-10-01T20:23:56  *** fatalhalt has joined #bitcoin-dev
382 2017-10-01T20:23:59  <arubi> no no, that pubkeyhash is in the outputs
383 2017-10-01T20:24:35  <arubi> things in scriptsig are input stuff, either scripts at redemption or previous scriptpubkey at signing time
384 2017-10-01T20:25:01  <arubi> look at page 29 in the pdf I linked
385 2017-10-01T20:25:23  <djdjjj> ah sorry I got it
386 2017-10-01T20:25:29  <arubi> oh alright
387 2017-10-01T20:25:31  <djdjjj> this is the whole process that checks that I'm the rightful owner
388 2017-10-01T20:25:32  <Sentineo> djdjjj: you have to concatenate scriptSig and scriptPubkey and lookmat it as one script
389 2017-10-01T20:25:39  <djdjjj> if the coins I'm trying to spend
390 2017-10-01T20:25:48  <Sentineo> djdjjj: if it returns true you transer bitckin ownership
391 2017-10-01T20:25:59  <arubi> ownership is checked by making you sign both the previous txid:index and the script being executed
392 2017-10-01T20:26:30  <djdjjj> I mean, that whole "checking process" described in that page refers only to "checking that I'm the owner of the UTXO's I'm trying to spend"
393 2017-10-01T20:26:52  <arubi> yes, that's what validation of transactions does basically
394 2017-10-01T20:26:53  <djdjjj> I thought that it was validating the whole transaction somehow (meaning involving the sender too)..
395 2017-10-01T20:26:58  <djdjjj> yes yes
396 2017-10-01T20:28:08  <djdjjj> so that `pubKeyHash` there actually refers to the `pubKeyHash` of a _UTXO_ that I'm redeeming, not the `pubKeyHash` that I'll send the coins to
397 2017-10-01T20:29:24  <arubi> yes that's right
398 2017-10-01T20:29:52  <djdjjj> that PDF is awesome btw
399 2017-10-01T20:29:54  <arubi> usually signers sign all the outputs in a transaction, but they always only sign their own input
400 2017-10-01T20:30:24  <arubi> they do sign other txid:index inputs though, just not scriptpubkeys
401 2017-10-01T20:30:41  <arubi> or sequences, you'll see :)
402 2017-10-01T20:54:57  <djdjjj> last one: which data are signed in the scriptSig signature part?
403 2017-10-01T20:55:29  <djdjjj> I guess it's a hash of the tx inputs themselves?
404 2017-10-01T20:56:36  <djdjjj> or the tx-to-be-created?
405 2017-10-01T20:58:47  <arubi> it's everything, prevtxs and current outputs
406 2017-10-01T20:59:28  <arubi> anything that isn't signed is free to change in flight by anyone, so it's pretty thorough if you don't use very exotic setups
407 2017-10-01T21:03:33  *** Guyver2 has quit IRC
408 2017-10-01T21:06:01  *** ddustin_ has quit IRC
409 2017-10-01T21:06:36  *** ddustin has joined #bitcoin-dev
410 2017-10-01T21:07:07  *** dc0de has quit IRC
411 2017-10-01T21:11:15  *** ddustin has quit IRC
412 2017-10-01T21:13:56  *** qrestlove has quit IRC
413 2017-10-01T21:16:51  *** mattcode has quit IRC
414 2017-10-01T21:17:40  *** djdjjj has quit IRC
415 2017-10-01T21:25:27  *** qrestlove has joined #bitcoin-dev
416 2017-10-01T21:25:51  *** priidu has quit IRC
417 2017-10-01T21:29:15  *** meshcollider has quit IRC
418 2017-10-01T21:34:56  *** POJO has quit IRC
419 2017-10-01T21:47:48  *** sdfgsdfg has joined #bitcoin-dev
420 2017-10-01T22:09:07  *** jtimon has quit IRC
421 2017-10-01T22:13:33  *** Dizzle has joined #bitcoin-dev
422 2017-10-01T22:37:28  *** iv3c has joined #bitcoin-dev
423 2017-10-01T23:00:26  *** meshcollider has joined #bitcoin-dev
424 2017-10-01T23:04:12  *** one_zero has joined #bitcoin-dev
425 2017-10-01T23:08:26  *** harai has joined #bitcoin-dev
426 2017-10-01T23:45:41  *** iv3c has quit IRC
427 2017-10-01T23:46:00  *** iv3c has joined #bitcoin-dev