1 2018-04-19 07:17:45 <nightcat> hello.. I was going through recreating the process of address creation for learning and understanding sake.. I was looking at this https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses trying to follow steps in How to create bitcoin address.. I started by generating a private key with `openssl ecparam -genkey -name secp256r1..`
 2 2018-04-19 07:18:12 <nightcat> then created a corresponding public key in the form of an x509 cert
 3 2018-04-19 07:18:39 <nightcat> step 1 says Take the corresponding public key generated with it (65 bytes, 1 byte 0x04, 32 bytes corresponding to X coordinate, 32 bytes corresponding to Y coordinate)
 4 2018-04-19 07:19:02 <nightcat> but my public key coords don't seem to match these bitlenght constraint
 5 2018-04-19 07:19:09 <nightcat> am i on right tracks or not?
 6 2018-04-19 07:26:46 <luke-jr> nightcat: pretty sure secp256k1 is not secp256r1
 7 2018-04-19 07:28:20 <nightcat> oh it was secp256k1
 8 2018-04-19 07:28:25 <nightcat> thanks luke-jr
 9 2018-04-19 07:57:37 <nightcat> I generated another keypair with secp256k1.. luke-jr you know how to get x and y coords from this?
10 2018-04-19 07:57:38 <nightcat> //////////////////+///8LzAGBAEABAEHBEEEeb5mfvncu6xVoGKVzocLBwKb
11 2018-04-19 07:57:38 <nightcat> AP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABMLCg6ktbJd6
12 2018-04-19 07:57:38 <nightcat> -----BEGIN PUBLIC KEY-----
13 2018-04-19 07:57:38 <nightcat> MIH1MIGuBgcqhkjOPQIBMIGiAgEBMCwGByqGSM49AQECIQD/////////////////
14 2018-04-19 07:57:40 <nightcat> 4fBsnZNPV+opaKvah0apa8yjsi7WbOfqDGOGk+rxnOioKse3S2zG2ILktFfwMt25
15 2018-04-19 07:57:42 <nightcat> pWUDg9QLhpc=
16 2018-04-19 07:57:44 <nightcat> -----END PUBLIC KEY-----
17 2018-04-19 07:57:46 <luke-jr> nope
18 2018-04-19 07:58:13 <luke-jr> btw, the instructions on that page are semi-wrong
19 2018-04-19 07:58:40 <nightcat> I see.. you can suggest something better?
20 2018-04-19 07:58:51 <luke-jr> Bitcoin Core source code maybe?
21 2018-04-19 08:01:56 <bedotech> hi all! i want to build a online service that generate address from extended public key, is better to use backward compatibility P2SH-P2WPKH or i can use direct P2WPKH?
22 2018-04-19 08:04:55 <luke-jr> nightcat: semi-updated it
23 2018-04-19 08:05:41 <luke-jr> bedotech: don't ask users to put information like that into webpages..
24 2018-04-19 08:06:14 <nightcat> I see.. so it's just the X coord now
25 2018-04-19 08:06:26 <nightcat> anyway i think I got it
26 2018-04-19 08:06:28 <luke-jr> bedotech: if you mean your own.. order of preference should probably be p2pkh, p2wpkh, p2sh-p2wpkh
27 2018-04-19 08:06:42 <luke-jr> nightcat: the prefix byte is 03 instead of 04 also
28 2018-04-19 08:07:15 <luke-jr> bedotech: but inevitably, what you do needs to conform to what your wallet expects
29 2018-04-19 08:08:04 <nightcat> parsing the pubkey with openssl x509 -in device.pem -noout -pubkey openssl asn1parse i get this http://sprunge.us/EJab
30 2018-04-19 08:08:11 <bedotech> luke-jr: yep the key are stored in my backed server, i generate address to make payment to my service, so i think is better p2sh-p2wpkh so the fee are limited and the old wallet can send payments to me
31 2018-04-19 08:08:47 <luke-jr> bedotech: find out what your wallet supports; you can't just use whatever ;)
32 2018-04-19 08:09:30 <nightcat> if it was still 65 byte I guess it would be the 75 field
33 2018-04-19 08:09:38 <luke-jr> bedotech: old wallets can send payments to p2pkh too, btw. and they're better for the network.
34 2018-04-19 08:10:34 <luke-jr> nightcat: probably. so just change the 04 to 03, and cut off the last 32 bytes
35 2018-04-19 08:10:35 <luke-jr> nightcat: before using, test with testnet ;)
36 2018-04-19 08:11:27 <nightcat> yea sure
37 2018-04-19 08:11:33 <nightcat> thanks a lot
38 2018-04-19 08:12:17 <bedotech> luke-jr: you have some reference wallet for this use? because i think for generate address in secure manner is better to use library that load only extended pubkeys, i see pycoin and bitcoinjs-lib
39 2018-04-19 08:13:15 <bedotech> because i need to generate really a lot of address
40 2018-04-19 08:14:39 <luke-jr> bedotech: no, I don't
41 2018-04-19 08:14:57 <luke-jr> personally, I would just upload addresses into a database, not derive them
42 2018-04-19 08:15:59 <bedotech> luke-jr: yeah you are right, but if you do so you always need to ask a 'remote' wallet and backup the wallet and you database.
43 2018-04-19 08:16:19 <bedotech> for mantain user-address couple
44 2018-04-19 08:19:30 <luke-jr> bedotech: you always need to backup that anyway, or you don't have customer info
45 2018-04-19 08:19:43 <luke-jr> and don't ask the remote wallet; have the remote wallet push it
46 2018-04-19 09:36:36 <nightcat> luke-jr, concerning step 0.. that is the X coord of the privkey?
47 2018-04-19 12:56:05 <plorark> Hey guys
48 2018-04-19 12:56:15 <plorark> wasup
49 2018-04-19 12:57:18 <plorark> I'm looking for a js library to build a full wallet in nodejs (electron and stuff)  for a bitcoin fork, but I can't find something good
50 2018-04-19 12:57:33 <plorark> I've tried bitcore, but it so hard to change the network
51 2018-04-19 12:57:43 <plorark> it just keep conecting to thhe default one
52 2018-04-19 15:58:46 <fluffypony> unfortunately there's no shitcoin support here
53 2018-04-19 15:58:53 <fluffypony> oh they left already
54 2018-04-19 18:33:22 <robzon> I'm trying to figure out how bitcoin core handles chain reorgs with regards to the chain state database... if we're at height X (and the db reflects the state at that height) and I need to reorg at height X-Y, how does core roll back the db to the state at height X-Y? are there snapshots every now and then? is there a limit on how big Y can be?
55 2018-04-19 18:56:20 <jonasschnelli> robzon: bitcoin core keeps those "undo" files
56 2018-04-19 18:58:22 <jonasschnelli> robzon: check CChainState::DisconnectBlock() in Cores source code
57 2018-04-19 19:06:19 <robzon> jonasschnelli: exactly what I was looking for, thanks!