Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: MasterQ on January 29, 2018, 05:01:18 PM



Title: Bitcore-node Insight setup for altcoin - xpubkey xprivkey networkMagic
Post by: MasterQ on January 29, 2018, 05:01:18 PM
I am trying to set up https://github.com/bitpay/insight for a forked version of Bitcoin.

To do this I need to modify the following

addNetwork({
  name: 'livenet',
  alias: 'mainnet',
  pubkeyhash: 0x00,
  privatekey: 0x80,
  scripthash: 0x05,
  xpubkey: 0x0488b21e,
  xprivkey: 0x0488ade4,
  networkMagic: 0xf9beb4d9,
  port: 8333,
  dnsSeeds: [
    'seed.bitcoin.sipa.be',
    'dnsseed.bluematt.me',
    'dnsseed.bitcoin.dashjr.org',
    'seed.bitcoinstats.com',
    'seed.bitnodes.io',
    'bitseed.xf2.org'

Everything there is pretty simple except for pubkeyhash, privatekey, scripthash, xpubkey, xprivkey and networkMagic.

I've used https://en.bitcoin.it/wiki/List_of_address_prefixes and http://lenschulwitz.com/base58 to figure out how to reproduce pubkeyhash privatekey scripthash but I still don't know how to get the xpubkey, xprivkey and networkMagic values listed above. How can I reproduce those values listed above from my Bitcoin client?


Title: Re: Bitcore-node Insight setup for altcoin - xpubkey xprivkey networkMagic
Post by: MasterQ on January 29, 2018, 07:34:47 PM
https://bitcoin.stackexchange.com/a/56639/61042 helped with xpubkey and xprivkey.

Now I just need help producing networkMagic. It's in the genesis block apparently but I have no idea how to read/decode it.


Title: Re: Bitcore-node Insight setup for altcoin - xpubkey xprivkey networkMagic
Post by: btctousd81 on January 30, 2018, 08:21:30 AM
https://bitcoin.stackexchange.com/a/56639/61042 helped with xpubkey and xprivkey.

Now I just need help producing networkMagic. It's in the genesis block apparently but I have no idea how to read/decode it.

do you mean magic number ?

which is of 8 char long and starts at the blockfile ?


Title: Re: Bitcore-node Insight setup for altcoin - xpubkey xprivkey networkMagic
Post by: MasterQ on January 30, 2018, 01:14:16 PM
https://bitcoin.stackexchange.com/a/56639/61042 helped with xpubkey and xprivkey.

Now I just need help producing networkMagic. It's in the genesis block apparently but I have no idea how to read/decode it.

do you mean magic number ?

which is of 8 char long and starts at the blockfile ?
Found it using Hex editor of genesis block, thanks.

https://i.gyazo.com/01a34bc423601036f8865baad867ace3.png

Whats this code I see
Code:
 dnsSeeds: [
    'seed.bitcoin.sipa.be',
    'dnsseed.bluematt.me',
    'dnsseed.bitcoin.dashjr.org',
    'seed.bitcoinstats.com',
    'seed.bitnodes.io',
    'bitseed.xf2.org'

Part of node discover that uses DNS when A new full node is stated not that I see anything wrong with it but I
do when I keep hearing the religious type of debate here about decentralization

Bitcoin never was 100% fully decentralized and now the Lighting Network with it's hub banks have made it
fully centralized for anyone with just one channel open.


Go back to reading your dumb shit on /r/btc. These are the dnsseeds insight suggests I can use any. These are the ones Bitcoin Core project uses https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp - I can change them and compile with any I wish, or use another client.