1 2017-01-07 00:19:59 <cluelessperson> I don't get it
  2 2017-01-07 00:20:09 <cluelessperson> somehow I'm producing invalid 128 bit BIP39 seeds
  3 2017-01-07 00:20:17 <cluelessperson> but valid 256 bit BIP39 keys
  4 2017-01-07 00:20:52 <cluelessperson> https://gist.github.com/anonymous/1bbc514b20a38bac2340404920db1077
  5 2017-01-07 05:12:40 <achow101> does ckpool (the software) support segwit?
  6 2017-01-07 05:13:55 <luke-jr> I think so.
  7 2017-01-07 05:16:01 <achow101> ok, thanks
  8 2017-01-07 05:25:03 <Lightsword> achow101, yes
  9 2017-01-07 05:25:13 <Lightsword> I use it
 10 2017-01-07 14:40:11 <cluelessperson> Hey guys, am I crazy?
 11 2017-01-07 14:40:25 <cluelessperson> can someone please confirm for me if this tool produces incorrect results?
 12 2017-01-07 14:40:25 <cluelessperson> https://iancoleman.github.io/bip39/
 13 2017-01-07 14:40:42 <cluelessperson> I'm trying to generate my own mnemonics, and used this tool to test
 14 2017-01-07 14:40:48 <cluelessperson> but I don't think it's accurate
 15 2017-01-07 14:41:13 <cluelessperson> So I tried putting in "my own entropy" from trezor's test vectors
 16 2017-01-07 14:41:14 <cluelessperson> https://github.com/trezor/python-mnemonic/blob/master/vectors.json
 17 2017-01-07 14:41:22 <cluelessperson> and I think it IS returning incorrect data
 18 2017-01-07 15:11:49 <arubi> cluelessperson, I tried the first 3 test vectors and the tools got them right
 19 2017-01-07 15:12:22 <cluelessperson> arubi, seems to be my code then
 20 2017-01-07 15:12:58 <cluelessperson> arubi, I'm testing this one, and somehow the last word is off
 21 2017-01-07 15:12:59 <cluelessperson> [2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2042]
 22 2017-01-07 15:12:59 <cluelessperson> zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo young
 23 2017-01-07 15:13:12 <cluelessperson> should be wrong
 24 2017-01-07 15:13:15 <cluelessperson> not young
 25 2017-01-07 15:14:03 <arubi> I don't understand what you're testing though, I thought you meant that the seed doesn't come out correct from the mnemonic + passphrase?
 26 2017-01-07 15:15:42 <arubi> if the last line in your wordlist is 2047 and is 'zoo', then 'young' seems to be in the correct place at 2042
 27 2017-01-07 15:18:03 <cluelessperson> arubi, https://gist.github.com/anonymous/fe8eb1cabcbad1b20cd7cb3b3bc90b02
 28 2017-01-07 15:18:08 <cluelessperson> arubi, I'm getting there, slowly
 29 2017-01-07 15:19:30 <arubi> nice :)
 30 2017-01-07 15:20:19 <cluelessperson> arubi, okay, I think the problem is in my checksum somehow
 31 2017-01-07 15:20:32 <cluelessperson> arubi, how the F are they getting 2038
 32 2017-01-07 15:20:53 <cluelessperson> arubi, when the checksum is int(10) or binary(1010)
 33 2017-01-07 15:21:04 <cluelessperson> that gives,  111 1111 1010 => 2042
 34 2017-01-07 15:21:37 <arubi> are you sure that you're using the "password" correctly?  shouldn't it be 'mnemonicTREZOR' ?
 35 2017-01-07 15:22:17 <arubi> I mean, bip39 says that the password field is "mnemonic"+password, where the password for the vectors is 'TREZOR'
 36 2017-01-07 15:22:19 <cluelessperson> arubi, you're right, I changed that for testing, however that's calculated *after* the mnemonic is generated
 37 2017-01-07 15:22:29 <arubi> ah okay
 38 2017-01-07 15:22:48 <cluelessperson> arubi, My mnemonic's last word is off ,because my checksum is wrong somehow
 39 2017-01-07 15:22:59 <cluelessperson> arubi, being 2042, versus their 2038
 40 2017-01-07 15:23:42 <arubi> mhm, now I understand what you asked in the first place, looking
 41 2017-01-07 15:24:03 <cluelessperson> arubi, sha256(entropy_bytes).digest()[0] & (2**checksum_size-1)
 42 2017-01-07 15:24:07 <cluelessperson> arubi, I think I found it.
 43 2017-01-07 15:24:25 <cluelessperson> er
 44 2017-01-07 15:24:50 <cluelessperson> last_byte & (2**4-1)
 45 2017-01-07 15:25:29 <arubi> so, did you find it? :)
 46 2017-01-07 15:25:37 <cluelessperson> uh, not yet, but I think I'm staring at it
 47 2017-01-07 15:25:40 <cluelessperson> just hasn't clicked.
 48 2017-01-07 15:25:58 <cluelessperson> it's that bitoperation, maybe.
 49 2017-01-07 15:26:47 <cluelessperson> 15 => 00001111
 50 2017-01-07 15:26:49 <arubi> I really wanna implement pbkdf2 now
 51 2017-01-07 15:27:00 <cluelessperson> arubi, why's that? :P
 52 2017-01-07 15:27:20 <cluelessperson> hash_last_byte & 15 =>
 53 2017-01-07 15:27:23 <arubi> so I can implement bip39 :P
 54 2017-01-07 15:28:47 <cluelessperson> is my hash wrong?
 55 2017-01-07 15:30:34 <cluelessperson> oh, the FIRST bits of the hash
 56 2017-01-07 15:30:58 <arubi> hehe oh man
 57 2017-01-07 15:31:02 <cluelessperson> wait, those are the first bits.
 58 2017-01-07 15:31:10 <cluelessperson> hash[0]
 59 2017-01-07 15:32:00 <cluelessperson> maybe its 1111 0000     instead of      0000 1111
 60 2017-01-07 15:35:24 <arubi> so cluelessperson , sha256(ffffffffffffffffffffffffffffffff) = 5AC6A5945F16500911219129984BA8B387A06F24FE383CE4E81A73294065461B
 61 2017-01-07 15:35:52 <arubi> grab the first byte from the hash and append to the entropy:  ffffffffffffffffffffffffffffffff5A
 62 2017-01-07 15:36:02 <arubi> to bits: 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101011010
 63 2017-01-07 15:36:14 <arubi> last 11 bits block: 11111110101 == 2037
 64 2017-01-07 15:36:22 <cluelessperson> arubi, what's the first byte?
 65 2017-01-07 15:36:29 <cluelessperson> arubi,  hash[0] or hash[-1]
 66 2017-01-07 15:36:32 <arubi> 0x5A
 67 2017-01-07 15:36:52 <arubi> the leftmost byte, at least how a human would read it
 68 2017-01-07 15:38:15 <arubi> then I guess I'm supposed to be left with the last 4 bits that are '1010' ?  not sure what's that for
 69 2017-01-07 15:41:51 <arubi> cluelessperson, I don't know how python's sha256 will place the bytes for the hash.  best is to test if sha256(fffff...) is what I there ^, or 1B46654029731AE8E43C38FE246FA087B3A84B98299121110950165F94A5C65A
 70 2017-01-07 15:42:44 <arubi> if it's this second one, then I guess 'hash[-1]', if that one I said at first, then 'hash[0]'
 71 2017-01-07 15:43:07 <cluelessperson> arubi, thank you,  I found where I screw up
 72 2017-01-07 15:43:43 <arubi> cheers cluelessperson, you made me wanna implement bip39 too :)
 73 2017-01-07 15:44:03 <cluelessperson> arubi, I'm doing this to make an easy tool for everyone to use BIP39. ;)
 74 2017-01-07 15:44:10 <cluelessperson> and I plan on also doing other BIPs
 75 2017-01-07 15:44:57 <arubi> sweet!  I have my own bunch of tools as well, I like to see how it's done step by step so implementing it works best :)
 76 2017-01-07 15:47:26 <cluelessperson> arubi, I'm confused, how are you getting 0101 for the last bits?
 77 2017-01-07 15:48:18 <arubi> after the last 11 bits block there's '1010' left.  hopefully I didn't botch something in copy+paste
 78 2017-01-07 15:48:49 <cluelessperson> 11111110101 == 2037
 79 2017-01-07 15:49:10 <cluelessperson> arubi, the checksum is the entire key_bits_size //32
 80 2017-01-07 15:49:27 <cluelessperson> arubi, for a 128bit key, that's 4 bits,    132//11 => 12 words
 81 2017-01-07 15:49:45 <cluelessperson> 12x 11bit word_indexes
 82 2017-01-07 15:51:33 <arubi> not sure I follow. I just appended the first byte of the hash of the entropy to the entropy itself, then got the numbers from the 11 bits blocks.  that gives me 12 words + 4 bits that are '1010'
 83 2017-01-07 15:55:56 <arubi> is 1010 the checksum?  is the last word + 1010 the checksum?  bip39 isn't very clear :)
 84 2017-01-07 15:56:48 <arubi> oh there's a table.  good thing everything is abbreviated..
 85 2017-01-07 15:57:49 <cluelessperson> arubi, that's it!
 86 2017-01-07 15:57:51 <cluelessperson> checksum = (hash[0] ^ (2**checksum_size-1)) & 15
 87 2017-01-07 15:58:05 <cluelessperson> arubi, the last 4 bits are the checksum
 88 2017-01-07 15:58:10 <arubi> right
 89 2017-01-07 15:58:15 <cluelessperson> arubi, yeah, I screwed up my bitwise operation
 90 2017-01-07 15:59:28 <arubi> I still can't figure out what you're using this operation for
 91 2017-01-07 16:00:12 <arubi> I can't see where it's used in the bip, and I didn't need it myself just now
 92 2017-01-07 16:22:15 <cluelessperson> arubi, gahd, now I'm getting incorrect seed
 93 2017-01-07 16:23:43 <arubi> cluelessperson, so you have the right words but pbkdf2 returns the incorrect seed?
 94 2017-01-07 16:23:57 <cluelessperson> arubi, yes
 95 2017-01-07 16:24:11 <arubi> did you remember to change back to 'mnemonicTREZOR' for the password?
 96 2017-01-07 16:24:24 <arubi> using hmac sha512, 2048 iterations?
 97 2017-01-07 16:24:48 <cluelessperson> arubi,   I thought it was b'mnemonic' + mnemonic  :P
 98 2017-01-07 16:25:14 <arubi> not if I read it correctly :)
 99 2017-01-07 16:25:51 <cluelessperson> arubi,
100 2017-01-07 16:25:52 <arubi> afaict, it's the word mnemonic "+" the password, whatever "+" means in that context//
101 2017-01-07 16:25:52 <cluelessperson> seed = pbkdf2_hmac('sha512', b'mnemonicTREZOR', mnemonic, 2048)
102 2017-01-07 16:26:14 <cluelessperson> arubi, that contatenates the bytearrays
103 2017-01-07 16:27:23 <arubi> so the mnemonic variable is just a string, why not have the password\salt string behave the same?  why b'...' ?
104 2017-01-07 16:28:45 <cluelessperson> arubi, I got them switched around. :)
105 2017-01-07 16:28:53 <arubi> ohh hehe
106 2017-01-07 16:28:53 <cluelessperson> arubi,   the example python code has the arguments reversed.
107 2017-01-07 16:29:06 <cluelessperson> their pbkdf2 function
108 2017-01-07 16:29:18 <cluelessperson> well it works, lol
109 2017-01-07 16:29:21 <arubi> \o/
110 2017-01-07 16:29:59 <arubi> haha just put down "cluelessperson & co."
111 2017-01-07 16:31:20 <cluelessperson> :D
112 2017-01-07 16:31:34 <arubi> nice :)
113 2017-01-07 16:31:42 <cluelessperson> smooth move, mister
114 2017-01-07 16:32:24 <arubi> okay, I'm off to take care of some stuff, cya later cluelessperson
115 2017-01-07 16:32:30 <cluelessperson> later