1 2016-07-13T00:04:41  *** Cory has joined #bitcoin-dev
  2 2016-07-13T00:07:28  *** GAit has quit IRC
  3 2016-07-13T00:10:13  *** [7] has quit IRC
  4 2016-07-13T00:10:34  *** TheSeven has joined #bitcoin-dev
  5 2016-07-13T00:15:31  *** Burrito has quit IRC
  6 2016-07-13T00:15:45  *** belcher has quit IRC
  7 2016-07-13T00:23:28  *** Chris_Stewart_5 has quit IRC
  8 2016-07-13T00:30:11  *** Chris_Stewart_5 has joined #bitcoin-dev
  9 2016-07-13T00:33:13  *** Belkaar has quit IRC
 10 2016-07-13T00:34:16  *** Belkaar has joined #bitcoin-dev
 11 2016-07-13T00:36:47  *** Cory has quit IRC
 12 2016-07-13T00:37:27  *** Rozal has joined #bitcoin-dev
 13 2016-07-13T00:40:54  *** luke-jr has quit IRC
 14 2016-07-13T00:44:33  *** Chris_Stewart_5 has quit IRC
 15 2016-07-13T00:58:23  *** justanotheruser has quit IRC
 16 2016-07-13T00:59:03  *** justanotheruser has joined #bitcoin-dev
 17 2016-07-13T01:03:13  *** spudowiar has quit IRC
 18 2016-07-13T01:09:44  *** Chris_Stewart_5 has joined #bitcoin-dev
 19 2016-07-13T01:12:17  *** taw00 has quit IRC
 20 2016-07-13T01:35:46  *** Ylbam has quit IRC
 21 2016-07-13T01:47:58  *** TomMc has quit IRC
 22 2016-07-13T01:55:24  *** Ahmed90 has quit IRC
 23 2016-07-13T02:02:52  *** hashtag has quit IRC
 24 2016-07-13T02:04:38  *** deadalnix has joined #bitcoin-dev
 25 2016-07-13T02:05:24  *** Chris_Stewart_5 has quit IRC
 26 2016-07-13T02:22:27  *** TomMc has joined #bitcoin-dev
 27 2016-07-13T02:23:39  *** go1111111 has quit IRC
 28 2016-07-13T02:25:21  *** DigiByteDev has joined #bitcoin-dev
 29 2016-07-13T02:26:22  *** DigiByteDev has quit IRC
 30 2016-07-13T02:29:15  *** mnk has quit IRC
 31 2016-07-13T02:33:18  *** DigiByteDev has joined #bitcoin-dev
 32 2016-07-13T02:33:19  *** DigiByteDev has quit IRC
 33 2016-07-13T02:34:30  *** DigiByteDev has joined #bitcoin-dev
 34 2016-07-13T02:35:02  *** Delta_ has joined #bitcoin-dev
 35 2016-07-13T02:37:34  *** Cory has joined #bitcoin-dev
 36 2016-07-13T02:39:13  *** Subo1977 has quit IRC
 37 2016-07-13T03:04:56  *** TomMc has quit IRC
 38 2016-07-13T03:09:41  *** hsmiths has quit IRC
 39 2016-07-13T03:18:20  *** hsmiths has joined #bitcoin-dev
 40 2016-07-13T03:21:24  *** deadalnix has quit IRC
 41 2016-07-13T03:31:06  *** MKCoin has quit IRC
 42 2016-07-13T03:42:22  *** GreenIsMyPepper has quit IRC
 43 2016-07-13T03:44:12  *** MKCoin has joined #bitcoin-dev
 44 2016-07-13T03:54:51  *** Rozal has quit IRC
 45 2016-07-13T03:55:45  *** GreenIsMyPepper has joined #bitcoin-dev
 46 2016-07-13T04:06:38  *** GreenIsMyPepper has quit IRC
 47 2016-07-13T04:11:47  *** GreenIsMyPepper has joined #bitcoin-dev
 48 2016-07-13T04:34:48  *** GreenIsMyPepper has quit IRC
 49 2016-07-13T04:40:18  *** GreenIsMyPepper has joined #bitcoin-dev
 50 2016-07-13T05:12:03  *** jtimon has joined #bitcoin-dev
 51 2016-07-13T05:27:06  *** ThomasV has joined #bitcoin-dev
 52 2016-07-13T05:30:16  *** GreenIsMyPepper has quit IRC
 53 2016-07-13T05:43:22  *** GreenIsMyPepper has joined #bitcoin-dev
 54 2016-07-13T05:56:09  *** herzmeister has quit IRC
 55 2016-07-13T05:56:16  *** GreenIsMyPepper has quit IRC
 56 2016-07-13T06:07:56  *** GreenIsMyPepper has joined #bitcoin-dev
 57 2016-07-13T06:08:15  *** morcos has quit IRC
 58 2016-07-13T06:10:10  *** DigiByteDev has quit IRC
 59 2016-07-13T06:11:05  *** go1111111 has joined #bitcoin-dev
 60 2016-07-13T06:11:45  *** CodesInChaos has quit IRC
 61 2016-07-13T06:12:18  *** GreenIsMyPepper has quit IRC
 62 2016-07-13T06:13:55  *** GreenIsMyPepper has joined #bitcoin-dev
 63 2016-07-13T06:19:06  *** treehug88 has quit IRC
 64 2016-07-13T06:22:42  *** huseby has quit IRC
 65 2016-07-13T06:39:23  *** Michail1 has quit IRC
 66 2016-07-13T06:43:47  *** CodesInChaos has joined #bitcoin-dev
 67 2016-07-13T06:44:31  *** huseby has joined #bitcoin-dev
 68 2016-07-13T06:48:45  *** one_zero has quit IRC
 69 2016-07-13T06:54:51  *** ThomasV has quit IRC
 70 2016-07-13T06:56:10  *** bustd_soket has quit IRC
 71 2016-07-13T07:09:02  *** gnubeard has joined #bitcoin-dev
 72 2016-07-13T07:12:02  *** chris2000 has joined #bitcoin-dev
 73 2016-07-13T07:13:40  *** herzmeister has joined #bitcoin-dev
 74 2016-07-13T07:15:08  *** Ylbam has joined #bitcoin-dev
 75 2016-07-13T07:19:50  *** chris2000 has quit IRC
 76 2016-07-13T07:20:39  *** bustd_soket has joined #bitcoin-dev
 77 2016-07-13T07:20:42  *** robink_ has quit IRC
 78 2016-07-13T07:21:42  *** robink_ has joined #bitcoin-dev
 79 2016-07-13T07:24:26  *** gnubeard has quit IRC
 80 2016-07-13T07:25:02  *** murch has joined #bitcoin-dev
 81 2016-07-13T07:32:54  *** paveljanik has quit IRC
 82 2016-07-13T07:57:06  *** ongolaBoy has joined #bitcoin-dev
 83 2016-07-13T08:00:24  *** ThomasV has joined #bitcoin-dev
 84 2016-07-13T08:14:31  *** CodesInChaos has quit IRC
 85 2016-07-13T08:16:20  *** DigiByteDev has joined #bitcoin-dev
 86 2016-07-13T08:20:59  *** DigiByteDev has quit IRC
 87 2016-07-13T08:23:42  *** chjj has quit IRC
 88 2016-07-13T08:26:54  *** CodesInChaos has joined #bitcoin-dev
 89 2016-07-13T08:36:12  *** giuseppegalano has joined #bitcoin-dev
 90 2016-07-13T08:37:39  *** giuseppegalano has quit IRC
 91 2016-07-13T08:59:19  *** giuseppegalano has joined #bitcoin-dev
 92 2016-07-13T09:04:04  *** giuseppegalano has quit IRC
 93 2016-07-13T09:14:16  *** ThomasV has quit IRC
 94 2016-07-13T09:14:16  *** chjj has joined #bitcoin-dev
 95 2016-07-13T09:43:18  *** sh_smith has quit IRC
 96 2016-07-13T09:44:36  *** sh_smith has joined #bitcoin-dev
 97 2016-07-13T09:47:23  *** GAit has joined #bitcoin-dev
 98 2016-07-13T09:49:03  *** GAit has quit IRC
 99 2016-07-13T09:53:33  *** GAit has joined #bitcoin-dev
100 2016-07-13T09:56:37  *** GAit has joined #bitcoin-dev
101 2016-07-13T10:07:57  *** GAit has quit IRC
102 2016-07-13T10:18:47  *** GAit has joined #bitcoin-dev
103 2016-07-13T10:20:45  *** MoALTz has joined #bitcoin-dev
104 2016-07-13T10:41:20  *** mnk has joined #bitcoin-dev
105 2016-07-13T11:22:50  *** fredrin has joined #bitcoin-dev
106 2016-07-13T11:29:36  *** Soligor has quit IRC
107 2016-07-13T11:31:01  *** clopez has quit IRC
108 2016-07-13T11:33:40  *** clopez has joined #bitcoin-dev
109 2016-07-13T11:39:00  *** arubi_ has joined #bitcoin-dev
110 2016-07-13T11:43:04  *** arubi has quit IRC
111 2016-07-13T11:43:17  *** afk11 has quit IRC
112 2016-07-13T11:45:02  *** GAit has quit IRC
113 2016-07-13T11:53:34  *** CheckDavid has joined #bitcoin-dev
114 2016-07-13T11:58:33  *** GAit has joined #bitcoin-dev
115 2016-07-13T12:06:37  *** arubi__ has joined #bitcoin-dev
116 2016-07-13T12:10:30  *** arubi_ has quit IRC
117 2016-07-13T12:20:08  *** Chris_Stewart_5 has joined #bitcoin-dev
118 2016-07-13T12:23:17  *** GAit has quit IRC
119 2016-07-13T12:26:51  *** Lysander1 has quit IRC
120 2016-07-13T12:41:30  *** hashtag has joined #bitcoin-dev
121 2016-07-13T12:42:09  *** magicien has joined #bitcoin-dev
122 2016-07-13T12:48:54  *** Chris_Stewart_5 has quit IRC
123 2016-07-13T13:07:35  *** PaulCapestany has quit IRC
124 2016-07-13T13:09:06  *** PaulCapestany has joined #bitcoin-dev
125 2016-07-13T13:09:09  *** Chris_Stewart_5 has joined #bitcoin-dev
126 2016-07-13T13:14:51  *** aegis has quit IRC
127 2016-07-13T13:15:34  *** go1111111 has quit IRC
128 2016-07-13T13:17:25  <waxwing> is the correct format of message signing: compactsize + bytes of: ("Bitcoin Signed Message:\n")  and then same for the message?
129 2016-07-13T13:17:41  <waxwing> i mean correct format of input to sha256x2 for sighash
130 2016-07-13T13:21:17  *** herzmeister has quit IRC
131 2016-07-13T13:21:53  <arubi__> waxwing, that sounds right
132 2016-07-13T13:21:56  *** arubi__ is now known as arubi
133 2016-07-13T13:22:42  *** blueness has quit IRC
134 2016-07-13T13:24:15  <waxwing> there's an nType and nVersion field, i'm not quite sure yet if that affects what's written
135 2016-07-13T13:24:28  *** aegis has joined #bitcoin-dev
136 2016-07-13T13:25:33  <arubi> didn't it used to be the old armory style signing?
137 2016-07-13T13:25:36  *** alferz has joined #bitcoin-dev
138 2016-07-13T13:27:03  <waxwing> i don't know, vaguely heard about that, but just trying to read the code in bitcoin
139 2016-07-13T13:28:13  *** blueness has joined #bitcoin-dev
140 2016-07-13T13:31:45  <arubi> I see.  well when I signmessage I do as you said.  hash256(compactsize of magic, magic, compactsize of message, message), then add the byte for the recovery operation
141 2016-07-13T13:32:23  <waxwing> is that sha256 or sha256d?
142 2016-07-13T13:32:35  <arubi> sha256d
143 2016-07-13T13:32:57  <waxwing> right, thanks. and for recovery, i see. what exactly do you do there?
144 2016-07-13T13:33:12  *** CodesInChaos has quit IRC
145 2016-07-13T13:33:30  <Chris_Stewart_5> arubi: Why are magic bytes needed when signing a message? Can't it simply be signed with a private key and sent to another user with the pubkey & signed message?
146 2016-07-13T13:33:51  <waxwing> this is probably going to be rather important, i'm going to need to figure out how to do recoverable signatures with secp256k1
147 2016-07-13T13:34:05  <waxwing> Chris_Stewart_5: not really needed, it's just the standard that bitcoin core uses.
148 2016-07-13T13:34:21  <waxwing> well "the standard", don't think it's formalized anywhere actually, although i might be wrong.
149 2016-07-13T13:35:17  <arubi> like sipa said a few days ago in #bitcoin when I asked him, recover both possible public keys while making sure to use R's even Y coordinate first
150 2016-07-13T13:35:49  <arubi> let me try and find the standard.
151 2016-07-13T13:35:55  <waxwing> arubi: i remember but i didn't get that logic, why does it matter which you try first if only one is correct?
152 2016-07-13T13:36:14  <waxwing> maybe it depends on the use case
153 2016-07-13T13:36:27  <arubi> it depends on which address is checked against the signature
154 2016-07-13T13:36:46  <arubi> because a public key can have a compressed or uncompressed addresses, and you can't know
155 2016-07-13T13:37:11  *** alferz has quit IRC
156 2016-07-13T13:37:22  <waxwing> yes i know, but if you're trying to recover against an address and you have it, then you can try them all, while if you don't have the address, then you'll need to be told which one to use somehow right?
157 2016-07-13T13:37:38  <waxwing> i remember some scheme like 27+ (0,1,2,3) appended to the signature (v, r, s)
158 2016-07-13T13:38:16  <arubi> really I don't understand the point of the header byte.  it's not even signed and can be changed while still leaving the signature valid
159 2016-07-13T13:38:17  <waxwing> but the state of the art has moved on :)
160 2016-07-13T13:38:25  <arubi> and ake it seem like a different address was used
161 2016-07-13T13:38:30  <arubi> s/ake/make
162 2016-07-13T13:38:52  <waxwing> yes good point, back then it was all based on friendship, not cryptography i guess :)
163 2016-07-13T13:39:39  <arubi> hehe :)
164 2016-07-13T13:39:49  <waxwing> but earlier i was trying to find out what you meant when you said " then add the byte for the recovery operation"
165 2016-07-13T13:40:21  <waxwing> atm i'm only trying to replicate bitcoin core's signature hash format
166 2016-07-13T13:40:42  <arubi> ah, not actually base64 encoding the signature like core does?
167 2016-07-13T13:41:24  <waxwing> well i don't much care about encoding
168 2016-07-13T13:41:45  <waxwing> my use case is something like: a hardware wallet wants to be able to spit out a valid message signature against an authorising pubkey
169 2016-07-13T13:42:04  *** Chris_Stewart_5 has quit IRC
170 2016-07-13T13:42:05  <waxwing> but we don't want our code to use some non-standard sig format
171 2016-07-13T13:42:20  <waxwing> so i guess it's just about standardisation really, although i fear there is no such thing
172 2016-07-13T13:43:04  *** dabura667 has joined #bitcoin-dev
173 2016-07-13T13:44:04  <waxwing> arubi: so, what did you mean by that?
174 2016-07-13T13:44:11  <arubi> yea I'm trying to rephrase
175 2016-07-13T13:44:21  *** Chris_Stewart_5 has joined #bitcoin-dev
176 2016-07-13T13:46:47  <arubi> well, you know how you'd get two public keys from a recovery operation, and both these pubkeys each have 2 possible addresses.  so after you sign, you do recovery on your own signature, making sure you use R's even Y value first, then its odd Y point
177 2016-07-13T13:46:48  <waxwing> so it seems indeed that message signing uses SignCompact which does use the secp256k1_ecdsa_recoverable_signature type
178 2016-07-13T13:46:55  <waxwing> ah recovery on your own signature, interesting
179 2016-07-13T13:47:23  <arubi> at least I don't know if there's a simpler way to tell
180 2016-07-13T13:47:31  <arubi> (except actually doing the recovery)
181 2016-07-13T13:48:07  <waxwing> such catchy function names like secp256k1_ecdsa_recoverable_signature_serialize_compact()
182 2016-07-13T13:48:27  <waxwing> could do with a bit of compacting itself :)
183 2016-07-13T13:48:33  <arubi> soon we'll need compactsize prepended to function names :)
184 2016-07-13T13:49:13  <waxwing> so it does some vchSig[0] = 27 + rec + 4 or 0. yeah that's what i remembered.
185 2016-07-13T13:49:21  *** Chris_Stewart_5 has quit IRC
186 2016-07-13T13:49:22  <waxwing> but this is just the "prepend v" part
187 2016-07-13T13:50:49  <arubi> this is how I see it.  once recovered the two public keys, first the uncompressed address version of the first key is handled.  that gets 0x1B, then the second is 0x1C
188 2016-07-13T13:51:07  <arubi> for the uncompressed versions, first is 0x1F, then 0x20
189 2016-07-13T13:51:50  <arubi> then there's the edge case of what if (r+n) is a valid X value, which then gives two new recovered pubkeys, and 4 other addresses
190 2016-07-13T13:52:46  <waxwing> sure, i've done similar before, just iterating
191 2016-07-13T13:53:05  <waxwing> the cases where i used it it was simply a matter of iterating until you find the one that corresponds to the address
192 2016-07-13T13:53:18  <waxwing> but here with "recoverable" we're talking about finding "the" one, right
193 2016-07-13T13:53:47  <arubi> sure, although you could still iterate.  you're not losing any security / validity by that I don't think
194 2016-07-13T13:54:12  *** TomMc has joined #bitcoin-dev
195 2016-07-13T13:55:08  <waxwing> iterating is fine if you're just checking a sig against an address, right, but is not an option if you're trying to recover a pubkey or an address from a (msg, sig). i haven't yet read up on this from the libsecp256k1 stuff, i should do that .. i presume it'll be written there, or anyway in the code.
196 2016-07-13T13:55:41  <waxwing> was hoping to avoid these details till later, but anyway. thanks for input on it.
197 2016-07-13T13:55:45  <arubi> I always thought it's way simpler to just have the address in the message too
198 2016-07-13T13:56:19  <waxwing> size constraints? i presume that's the main reason one would use recovery.
199 2016-07-13T13:57:26  <arubi> maybe.  there's also a small thing about being compliant with the standard, where you can take a valid signature, and add or subtract 0x08 from the header byte and still keep it valid for the same address.  just good to know if you come across it
200 2016-07-13T14:00:17  *** blueness has quit IRC
201 2016-07-13T14:00:47  *** CodesInChaos has joined #bitcoin-dev
202 2016-07-13T14:02:20  *** blueness has joined #bitcoin-dev
203 2016-07-13T14:04:32  *** Chris_Stewart_5 has joined #bitcoin-dev
204 2016-07-13T14:11:34  *** EPiSKiNG- has quit IRC
205 2016-07-13T14:14:58  *** fracting has quit IRC
206 2016-07-13T14:18:21  *** blueness has quit IRC
207 2016-07-13T14:20:57  *** arubi_ has joined #bitcoin-dev
208 2016-07-13T14:23:52  *** kinlo has quit IRC
209 2016-07-13T14:24:43  *** kinlo has joined #bitcoin-dev
210 2016-07-13T14:25:04  *** arubi has quit IRC
211 2016-07-13T14:27:06  *** bsm117532 is now known as bsm2319171311753
212 2016-07-13T14:27:27  *** bsm2319171311753 is now known as bsm117532
213 2016-07-13T14:27:41  *** fracting has joined #bitcoin-dev
214 2016-07-13T14:29:16  *** robink_ has quit IRC
215 2016-07-13T14:30:27  *** bsm117532 is now known as bsm2357
216 2016-07-13T14:31:23  *** blueness has joined #bitcoin-dev
217 2016-07-13T14:32:11  *** herzmeister has joined #bitcoin-dev
218 2016-07-13T14:32:54  *** DongSwanson has joined #bitcoin-dev
219 2016-07-13T14:34:13  <DongSwanson> are there any examples out there on how to use the new CSV softfork with bitcoin-qt? for example how to create transactions correctly. I googled but didn't find anything concrete
220 2016-07-13T14:34:18  *** mnk has quit IRC
221 2016-07-13T15:05:32  *** EPiSKiNG- has joined #bitcoin-dev
222 2016-07-13T15:06:25  *** morcos has joined #bitcoin-dev
223 2016-07-13T15:08:28  *** bugs_ has joined #bitcoin-dev
224 2016-07-13T15:09:07  *** arubi__ has joined #bitcoin-dev
225 2016-07-13T15:13:25  *** one_zero has joined #bitcoin-dev
226 2016-07-13T15:13:51  *** arubi_ has quit IRC
227 2016-07-13T15:19:23  *** Ahmed90 has joined #bitcoin-dev
228 2016-07-13T15:21:28  *** molz has joined #bitcoin-dev
229 2016-07-13T15:23:06  *** moli has quit IRC
230 2016-07-13T15:26:06  *** DongSwanson has quit IRC
231 2016-07-13T15:28:50  *** arubi__ is now known as arubi
232 2016-07-13T15:29:09  *** fracting has quit IRC
233 2016-07-13T15:36:22  *** CodesInChaos has quit IRC
234 2016-07-13T15:38:51  *** Chris_Stewart_5 has quit IRC
235 2016-07-13T15:49:58  *** Burrito has joined #bitcoin-dev
236 2016-07-13T15:50:33  *** CodesInChaos has joined #bitcoin-dev
237 2016-07-13T15:51:04  *** fracting has joined #bitcoin-dev
238 2016-07-13T16:24:56  *** rnvk has quit IRC
239 2016-07-13T16:25:25  *** TheSeven has quit IRC
240 2016-07-13T16:25:47  *** TheSeven has joined #bitcoin-dev
241 2016-07-13T16:26:59  *** rnvk has joined #bitcoin-dev
242 2016-07-13T16:31:53  *** gnubeard has joined #bitcoin-dev
243 2016-07-13T16:42:01  *** spudowiar has joined #bitcoin-dev
244 2016-07-13T16:46:19  *** gnubeard has quit IRC
245 2016-07-13T16:57:08  *** koad has quit IRC
246 2016-07-13T16:57:48  *** Soligor has joined #bitcoin-dev
247 2016-07-13T17:09:14  *** Luke has joined #bitcoin-dev
248 2016-07-13T17:12:33  *** spudowiar has quit IRC
249 2016-07-13T17:14:21  *** rnvk has quit IRC
250 2016-07-13T17:34:15  *** koad has joined #bitcoin-dev
251 2016-07-13T17:39:57  *** CodesInChaos has quit IRC
252 2016-07-13T17:42:20  *** deego has quit IRC
253 2016-07-13T17:43:00  *** Chris_Stewart_5 has joined #bitcoin-dev
254 2016-07-13T17:43:02  *** deego has joined #bitcoin-dev
255 2016-07-13T17:44:11  *** spudowiar has joined #bitcoin-dev
256 2016-07-13T17:51:26  *** deego has quit IRC
257 2016-07-13T17:52:05  *** deego has joined #bitcoin-dev
258 2016-07-13T17:53:25  *** CodesInChaos has joined #bitcoin-dev
259 2016-07-13T18:09:12  *** denisx has joined #bitcoin-dev
260 2016-07-13T18:14:39  *** deego has quit IRC
261 2016-07-13T18:15:19  *** deego has joined #bitcoin-dev
262 2016-07-13T18:15:31  *** jgarzik has quit IRC
263 2016-07-13T18:20:06  *** deego has quit IRC
264 2016-07-13T18:21:37  *** easye has joined #bitcoin-dev
265 2016-07-13T18:21:57  *** Raziel has quit IRC
266 2016-07-13T18:33:59  <bsm2357> I expect a common error for people using python-bitcoinlib will be to call SignatureHash with the scriptPubKey of the corresponding segwit input, rather than an actual script.  This is easy to detect, and insert the corresponding script for calculating the sighash, but causes the SignatureHash function to depart from the behavior of the one in core.
267 2016-07-13T18:34:09  <bsm2357> What are your opinions?  Is detecting this and inserting the correct script desirable or not?
268 2016-07-13T18:35:45  *** Chris_Stewart_5 has quit IRC
269 2016-07-13T18:40:20  *** ongolaBoy has quit IRC
270 2016-07-13T18:48:58  *** Chris_Stewart_5 has joined #bitcoin-dev
271 2016-07-13T18:59:19  *** deego has joined #bitcoin-dev
272 2016-07-13T19:02:09  *** mnk has joined #bitcoin-dev
273 2016-07-13T19:04:05  *** denisx has quit IRC
274 2016-07-13T19:08:31  *** okae has joined #bitcoin-dev
275 2016-07-13T19:08:56  *** JZA has joined #bitcoin-dev
276 2016-07-13T19:18:43  *** spudowiar has quit IRC
277 2016-07-13T19:36:31  <petertodd> bsm2357: python-bitcoinlib is meant to be very low level, and match bitcoin core's internals as much as possible, so NACK. However, it'd be good to add convenience functions like that in the bitcoin.wallet module (or similar), just with different names. For example, python-bitcoinlib is totally lacking an easy-to-use wallet functionality
278 2016-07-13T19:37:16  <bsm2357> nod
279 2016-07-13T19:37:42  <bsm2357> I added a couple convenience functions to retrieve addresses from scriptPubKeys.
280 2016-07-13T19:37:48  <petertodd> bsm2357: cool
281 2016-07-13T19:38:05  <petertodd> bsm2357: remember that evreything under bitcoin.core is meant to be consensus-critical
282 2016-07-13T19:38:20  <bsm2357> So you can do CBitcoinAddress.from_scriptPubKey(scriptpubkey).to_scriptPubKey() to get the correct script from signing.
283 2016-07-13T19:38:34  <petertodd> bsm2357: cool!
284 2016-07-13T19:39:55  *** gnubeard has joined #bitcoin-dev
285 2016-07-13T19:40:18  <bsm2357> I've currently got a printed warning if you try to sign a witness scriptPubKey.
286 2016-07-13T19:41:10  *** agricocb has quit IRC
287 2016-07-13T19:41:44  <bsm2357> petertodd: One of your tests expects the following script to be rejected as invalid, but it's now a valid P2WPKH nested in P2SH
288 2016-07-13T19:41:48  <bsm2357> CScript([OP_HASH160, x('0000000000000000000000000000000000000000'), OP_EQUAL])
289 2016-07-13T19:42:37  <petertodd> bsm2357: huh, what?!
290 2016-07-13T19:43:06  <petertodd> bsm2357: that shouldn't be spendable
291 2016-07-13T19:43:08  <bsm2357> https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh-nested-in-bip16-p2sh
292 2016-07-13T19:43:20  <petertodd> bsm2357: you realise, if that were true, we'd have a hard fork
293 2016-07-13T19:43:36  *** CodesInChaos has quit IRC
294 2016-07-13T19:43:49  <petertodd> bsm2357: I think you've misunderstood that bip
295 2016-07-13T19:44:12  <bsm2357> How so?
296 2016-07-13T19:44:42  <petertodd> bsm2357: are you saying CScript([OP_HASH160, x('0000000000000000000000000000000000000000'), OP_EQUAL]) is a valid P2SH scriptPubKey?
297 2016-07-13T19:45:26  <bsm2357> That's my understanding.
298 2016-07-13T19:45:42  <bsm2357> ping sipa
299 2016-07-13T19:45:45  <petertodd> bsm2357: see, it is valid, but it's impossible to make a valid redeemScript matching it
300 2016-07-13T19:46:01  <petertodd> bsm2357: segwit doesn't change that
301 2016-07-13T19:47:30  <bsm2357> You're just saying I don't have a preimage that hashes to zero, no?
302 2016-07-13T19:47:37  <petertodd> bsm2357: yup
303 2016-07-13T19:48:18  <bsm2357> But I do have preimages when making P2WPKH nested in P2SH.
304 2016-07-13T19:49:01  <petertodd> bsm2357: hmm?
305 2016-07-13T19:49:21  <bsm2357> Instead of zero, it's a script hash...
306 2016-07-13T19:49:32  <petertodd> bsm2357: P2WPKH nested in P2SH still requires you to have a message that hashes to x('0000000000000000000000000000000000000000') for the output to be spendable
307 2016-07-13T19:49:56  <bsm2357> correct
308 2016-07-13T19:50:34  <bsm2357> I'm saying that the format of this script is now valid under segwit.  I feel like we're missing each other here.
309 2016-07-13T19:51:15  <bsm2357> consensus rules can't possibly know what I do and don't have preimages for.
310 2016-07-13T19:51:45  <petertodd> bsm2357: but how is it _now_ valid under segwit? segwit doesn't change the situation
311 2016-07-13T19:52:24  <bsm2357> I'm literally reading the line from the link I pasted above, that's all.
312 2016-07-13T19:52:40  *** CodesInChaos has joined #bitcoin-dev
313 2016-07-13T19:52:43  <bsm2357>     scriptPubKey: HASH160 <20-byte-script-hash> EQUAL
314 2016-07-13T19:53:17  <petertodd> bsm2357: do you understandhow '<20-byte-script-hash>' hasn't changed from pre-segwit? it still means hash of the redeemScript - segwit just adds extra rules to how the redeemScript might be interpreted
315 2016-07-13T19:56:40  <bsm2357> Yes.
316 2016-07-13T19:57:25  <bsm2357> I see.  This test is labeled "non-canonical pushdata", so it doesn't actually match the BIP141 specification.  The test failure is a bug in my code I'll now fix.
317 2016-07-13T19:58:19  <petertodd> bsm2357: yeah, remember that in general, canonical p2sh, segwit, etc. is based on exact byte sequences - copy what's in bitcoin core
318 2016-07-13T19:58:55  <bsm2357> I am.  ;-)
319 2016-07-13T20:06:42  *** jps has joined #bitcoin-dev
320 2016-07-13T20:06:42  *** moli has joined #bitcoin-dev
321 2016-07-13T20:09:04  *** molz has quit IRC
322 2016-07-13T20:09:31  *** gnubeard has quit IRC
323 2016-07-13T20:10:15  *** gwillen has quit IRC
324 2016-07-13T20:13:30  *** Chris_Stewart_5 has quit IRC
325 2016-07-13T20:17:38  *** giuseppegalano has joined #bitcoin-dev
326 2016-07-13T20:18:37  *** b100d has joined #bitcoin-dev
327 2016-07-13T20:19:11  *** b100d has quit IRC
328 2016-07-13T20:19:59  *** afk11 has joined #bitcoin-dev
329 2016-07-13T20:21:04  *** b100d has joined #bitcoin-dev
330 2016-07-13T20:21:16  *** agricocb has joined #bitcoin-dev
331 2016-07-13T20:30:56  *** jtimon has quit IRC
332 2016-07-13T20:37:58  *** Chris_Stewart_5 has joined #bitcoin-dev
333 2016-07-13T20:38:55  *** frankenmint has joined #bitcoin-dev
334 2016-07-13T20:40:20  *** b100d has quit IRC
335 2016-07-13T20:44:56  *** frankenmint has quit IRC
336 2016-07-13T20:48:27  *** spudowiar has joined #bitcoin-dev
337 2016-07-13T20:49:51  *** ThomasV has joined #bitcoin-dev
338 2016-07-13T20:59:00  *** Chris_Stewart_5 has quit IRC
339 2016-07-13T21:00:51  *** Sosumi has quit IRC
340 2016-07-13T21:14:08  *** Chris_Stewart_5 has joined #bitcoin-dev
341 2016-07-13T21:15:43  *** ThomasV has quit IRC
342 2016-07-13T21:23:30  *** giuseppegalano has quit IRC
343 2016-07-13T21:23:35  *** hashtag_ has joined #bitcoin-dev
344 2016-07-13T21:23:42  *** markus-k has quit IRC
345 2016-07-13T21:24:58  *** Beef has quit IRC
346 2016-07-13T21:26:18  *** hashtag has quit IRC
347 2016-07-13T21:28:53  *** Raziel has joined #bitcoin-dev
348 2016-07-13T21:30:51  *** markus-k has joined #bitcoin-dev
349 2016-07-13T21:32:18  *** Beef has joined #bitcoin-dev
350 2016-07-13T21:37:33  *** okae has quit IRC
351 2016-07-13T21:37:34  *** droark has quit IRC
352 2016-07-13T21:37:51  *** fracting has quit IRC
353 2016-07-13T21:46:31  *** bugs_ has quit IRC
354 2016-07-13T21:47:11  *** renlord has joined #bitcoin-dev
355 2016-07-13T21:47:25  *** renlord is now known as mrpocoyo
356 2016-07-13T21:50:49  *** fracting has joined #bitcoin-dev
357 2016-07-13T21:57:14  *** wizkid057 has quit IRC
358 2016-07-13T21:57:48  *** jps has quit IRC
359 2016-07-13T22:02:33  *** wizkid057 has joined #bitcoin-dev
360 2016-07-13T22:07:58  *** belcher has joined #bitcoin-dev
361 2016-07-13T22:09:23  *** tabland has joined #bitcoin-dev
362 2016-07-13T22:09:34  *** belcher is now known as beIcher
363 2016-07-13T22:10:28  *** beIcher is now known as belcher
364 2016-07-13T22:19:11  *** TomMc has quit IRC
365 2016-07-13T22:35:52  *** markus-k has quit IRC
366 2016-07-13T22:37:00  *** markus-k has joined #bitcoin-dev
367 2016-07-13T22:43:05  *** herzmeister has quit IRC
368 2016-07-13T22:43:28  *** murch has quit IRC
369 2016-07-13T22:43:37  *** herzmeister has joined #bitcoin-dev
370 2016-07-13T22:50:22  *** gwillen has joined #bitcoin-dev
371 2016-07-13T22:52:35  *** Luke has quit IRC
372 2016-07-13T23:07:12  *** belcher has quit IRC
373 2016-07-13T23:12:51  *** belcher has joined #bitcoin-dev
374 2016-07-13T23:38:35  *** tabland has quit IRC
375 2016-07-13T23:42:28  *** MoALTz has quit IRC
376 2016-07-13T23:58:08  *** agricocb has quit IRC