├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── README.md ├── lib ├── coininfo.js └── coins │ ├── bch.js │ ├── blk.js │ ├── btc.js │ ├── btg.js │ ├── cbn.js │ ├── city.js │ ├── dash.js │ ├── dcr.js │ ├── dgb.js │ ├── dnr.js │ ├── doge.js │ ├── grs.js │ ├── ltc.js │ ├── mona.js │ ├── nbt.js │ ├── nmc.js │ ├── ppc.js │ ├── qtum.js │ ├── rdd.js │ ├── rvn.js │ ├── via.js │ ├── vtc.js │ ├── x42.js │ └── zec.js ├── package.json └── test └── coininfo.test.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | .DS_Store 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | os: 3 | - linux 4 | language: node_js 5 | node_js: 6 | - "4" 7 | - "6" 8 | - "8" 9 | - "9" 10 | env: 11 | matrix: 12 | - TEST_SUITE=unit 13 | matrix: 14 | include: 15 | - node_js: "8" 16 | env: TEST_SUITE=lint 17 | script: npm run $TEST_SUITE 18 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 5.2.0 / 2020-11-18 2 | ------------------ 3 | 4 | - add c0ban 5 | - add Denarius 6 | - add Groestlcoin 7 | - add x42 8 | 9 | 5.1.0 / 2019-05-31 10 | ------------------ 11 | 12 | - add Ravencoin (#87) 13 | 14 | 5.0.0 / 2019-05-28 15 | ------------------ 16 | 17 | - Switch Digibyte scripthash version byte. The obsolete `0x03` byte is now `scripthash2`, and the newer `0x3f` (S-addresses) byte is the default. 18 | 19 | 4.5.0 / 2019-04-30 20 | ------------------ 21 | 22 | - add bech32 prefixes (#85) 23 | 24 | 4.4.1 / 2019-04-08 25 | ------------------ 26 | 27 | - update DNS seed for BTC (#84) 28 | 29 | 4.4.0 / 2019-02-15 30 | ------------------ 31 | 32 | - add bip32 for LTC (#64) 33 | - add field messagePrefix (#65) 34 | - fix undefined bip32 error (#66) 35 | - fix Peercoin values (#79) 36 | 37 | 4.3.0 / 2018-08-15 38 | ------------------ 39 | 40 | - add Viacoin 41 | 42 | 4.2.0 / 2018-08-10 43 | ------------------ 44 | 45 | - add testnet for Bitcoin Cash 46 | 47 | 4.1.0 / 2018-07-31 48 | ------------------ 49 | 50 | - add `scripthash2` for DGB S... addresses 51 | 52 | 4.0.1 / 2018-06-22 53 | ------------------ 54 | 55 | - add BIP32 data for Zcash 56 | 57 | 4.0.0 / 2018-03-05 58 | ------------------ 59 | - change BIP44 constant for QTUM 60 | 61 | 3.2.0 / 2018-01-16 62 | ------------------ 63 | 64 | - add DigiByte 65 | 66 | 3.1.0 / 2018-01-10 67 | ------------------ 68 | - add QTUM 69 | 70 | 3.0.0 / 2018-01-10 71 | ------------------ 72 | - fix monacoin WIF constant 73 | 74 | 2.2.0 / 2017-12-29 75 | ------------------ 76 | - add BTG support 77 | 78 | 2.1.0 / 2017-12-28 79 | ------------------ 80 | - add VTC support 81 | 82 | 1.0.0 / 2017-04-23 83 | ------------------- 84 | - change LTC P2SH 85 | 86 | 0.10.0 / 2017-04-09 87 | ------------------- 88 | - add DCR 89 | - move from Mocha to Tape 90 | 91 | 0.9.1 / 2017-03-23 92 | ------------------- 93 | - update Dash constants 94 | 95 | 0.9.0 / 2016-09-22 96 | ------------------ 97 | - added `hashGenesisBlock` 98 | 99 | 0.8.2 / 2016-03-17 100 | ------------------ 101 | - added Dash protocol magic 102 | 103 | 0.8.1 / 2016-02-04 104 | ------------------ 105 | - fix for use with Node v0.10. See: https://github.com/cryptocoinjs/coininfo/pull/17 106 | 107 | 0.8.0 / 2016-01-29 108 | ------------------ 109 | - added `nubits` 110 | - added bitcoin `regtest` 111 | - fixed bitcoin rpc ports 112 | 113 | 0.7.0 / 2016-01-27 114 | ------------------ 115 | - deleted `mue` 116 | - deleted 'uro' 117 | - deleted `gmc` 118 | - added `toBitcoinJS()` for [`bitcoinjs-lib`](https://github.com/bitcoinjs/bitcoinjs-lib) support 119 | - added `toBitcore()` for Bitpay's bitcore suppport 120 | - add DOGE / LTC seeds / port 121 | 122 | 0.6.0 / 2016-01-07 123 | ------------------ 124 | - fixed DASH info, See: https://github.com/cryptocoinjs/coininfo/pull/13 125 | 126 | 0.5.0 / 2015-05-11 127 | ------------------ 128 | - added bip44 constants from http://doc.satoshilabs.com/slips/slip-0044.html 129 | 130 | 0.4.0 / 2015-04-21 131 | ------------------ 132 | - added missing formal names for some coins 133 | - added support for full coin name passed into `coininfo()`, i.e. can do `coininfo('BTC')` or `coininfo('bitcoin')` 134 | - access coin info via property 135 | - added DASH 136 | 137 | 0.3.1 / 2015-01-05 138 | ------------------ 139 | - bugfix for browserify 140 | 141 | 0.3.0 / 2015-01-03 142 | ------------------ 143 | - added more information like network information 144 | 145 | 0.2.3 / 2014-12-28 146 | ------------------ 147 | - added BlackCoin 148 | 149 | 0.2.2 / 2014-10-26 150 | ------------------ 151 | - added Gamerscoin https://github.com/cryptocoinjs/coininfo/pull/10 152 | 153 | 0.2.1 / 2014-08-13 154 | ------------------ 155 | - added [RDD](https://github.com/cryptocoinjs/coininfo/pull/7) 156 | 157 | 0.2.0 / 2014-06-16 158 | ------------------- 159 | * removed backwards compatibility code, use npm versions instead [ralphtheninja](https://github.com/cryptocoinjs/coininfo/pull/3) 160 | * removed semicolons per http://cryptocoinjs.com/about/contributing/#semicolons 161 | * added `PPC` and `URO` support: [#4](https://github.com/cryptocoinjs/coininfo/issues/4), [#6](https://github.com/cryptocoinjs/coininfo/pull/6) 162 | * added bip32 support 163 | * removed `terst` dev dep for `assert` 164 | 165 | 0.1.0 / 2014-04-14 166 | ------------------ 167 | * added `scripthash` for each coin, #2 168 | 169 | 0.0.2 / 2014-04-09 170 | ------------------ 171 | * add Dogecoin Testnet 172 | 173 | 0.0.1 / 2014-03-10 174 | ------------------ 175 | * initial release 176 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | coininfo 2 | ======== 3 | 4 | [![build status](https://api.travis-ci.org/cryptocoinjs/coininfo.svg)](http://travis-ci.org/cryptocoinjs/coininfo) 5 | 6 | JavaScript component for crypto currency specific information such as version numbers, DNS seeds, etc. 7 | Works in Node.js and the browser. 8 | 9 | 10 | Installation 11 | ------------ 12 | 13 | npm i coininfo 14 | 15 | 16 | Usage 17 | ----- 18 | 19 | ```js 20 | var coininfo = require('coininfo') 21 | 22 | console.dir(coininfo('LTC')) //use LTC-TEST for testnet 23 | // => 24 | /* 25 | { versions: 26 | { public: 48, 27 | private: 176, 28 | scripthash: 5, 29 | bip32: { public: 27108450, private: 27106558 } } } 30 | */ 31 | ``` 32 | 33 | Could also: 34 | 35 | ```js 36 | var litecoin = coininfo.litecoin.main 37 | var litecoinTest = coininfo.litecoin.test 38 | ``` 39 | 40 | Useful to use in conjunction with [coinkey](https://github.com/cryptocoinjs/coinkey) and [coinstring](https://github.com/cryptocoinjs/coinstring). 41 | 42 | 43 | Want to Use With Bitcore or bitcoinjs-lib? 44 | ----------------------------------------- 45 | 46 | **bitcoinjs-lib example:** 47 | 48 | ```js 49 | var coininfo = require('coininfo') 50 | var bitcoin = coininfo.bitcoin.main 51 | var bitcoinBitcoinJSLib = bitcoin.toBitcoinJS() 52 | ``` 53 | 54 | **Bitcore example:** 55 | 56 | ```js 57 | var coininfo = require('coininfo') 58 | var bitcoin = coininfo.bitcoin.main 59 | var bitcoinBitcoreLib = bitcoin.toBitcore() 60 | ``` 61 | 62 | 63 | Pull requests? 64 | -------------- 65 | 66 | Follow the canonical example: 67 | 68 | https://github.com/cryptocoinjs/coininfo/blob/master/lib/coins/btc.js 69 | 70 | 71 | License 72 | ------- 73 | 74 | MIT 75 | -------------------------------------------------------------------------------- /lib/coininfo.js: -------------------------------------------------------------------------------- 1 | var Buffer = require('safe-buffer').Buffer 2 | 3 | // annoyingly, this is for browserify 4 | var coins = [ 5 | require('./coins/bch'), 6 | require('./coins/blk'), 7 | require('./coins/btc'), 8 | require('./coins/btg'), 9 | require('./coins/cbn'), 10 | require('./coins/city'), 11 | require('./coins/dash'), 12 | require('./coins/dnr'), 13 | require('./coins/dcr'), 14 | require('./coins/dgb'), 15 | require('./coins/doge'), 16 | require('./coins/grs'), 17 | require('./coins/ltc'), 18 | require('./coins/via'), 19 | require('./coins/mona'), 20 | require('./coins/nbt'), 21 | require('./coins/nmc'), 22 | require('./coins/ppc'), 23 | require('./coins/qtum'), 24 | require('./coins/rvn'), 25 | require('./coins/rdd'), 26 | require('./coins/vtc'), 27 | require('./coins/x42'), 28 | require('./coins/zec') 29 | ] 30 | 31 | var supportedCoins = {} 32 | 33 | coins.forEach(function (coin) { 34 | var unit = coin.main.unit.toLowerCase() 35 | var name = coin.main.name.toLowerCase() 36 | 37 | coin.main.testnet = false 38 | coin.main.toBitcoinJS = toBitcoinJS.bind(coin.main) 39 | coin.main.toBitcore = toBitcore.bind(coin.main) 40 | supportedCoins[unit] = coin.main 41 | supportedCoins[name] = coin.main 42 | 43 | if (coin.test) { 44 | coin.test.testnet = true 45 | coin.test.toBitcoinJS = toBitcoinJS.bind(coin.test) 46 | coin.test.toBitcore = toBitcore.bind(coin.test) 47 | supportedCoins[unit + '-test'] = coin.test 48 | supportedCoins[name + '-test'] = coin.test 49 | } 50 | 51 | if (coin.regtest) { 52 | coin.regtest.testnet = true 53 | coin.regtest.toBitcoinJS = toBitcoinJS.bind(coin.regtest) 54 | coin.regtest.toBitcore = toBitcore.bind(coin.regtest) 55 | supportedCoins[unit + '-regtest'] = coin.regtest 56 | supportedCoins[name + '-regtest'] = coin.regtest 57 | } 58 | 59 | if (coin.simnet) { 60 | coin.simnet.testnet = true 61 | coin.simnet.toBitcoinJS = toBitcoinJS.bind(coin.simnet) 62 | coin.simnet.toBitcore = toBitcore.bind(coin.simnet) 63 | supportedCoins[unit + '-simnet'] = coin.simnet 64 | supportedCoins[name + '-simnet'] = coin.simnet 65 | } 66 | }) 67 | 68 | function coininfo (input) { 69 | var coin = input.toLowerCase() 70 | 71 | if (!(coin in supportedCoins)) { 72 | return null 73 | } else { 74 | return supportedCoins[coin] 75 | } 76 | } 77 | 78 | coins.forEach(function (coin) { 79 | coininfo[coin.main.name.toLowerCase()] = coin 80 | }) 81 | 82 | function toBitcoinJS () { 83 | return Object.assign({}, this, { 84 | messagePrefix: this.messagePrefix || ('\x19' + this.name + ' Signed Message:\n'), 85 | bech32: this.bech32, 86 | bip32: { 87 | public: (this.versions.bip32 || {}).public, 88 | private: (this.versions.bip32 || {}).private 89 | }, 90 | pubKeyHash: this.versions.public, 91 | scriptHash: this.versions.scripthash, 92 | wif: this.versions.private, 93 | dustThreshold: null // TODO 94 | }) 95 | } 96 | 97 | function toBitcore () { 98 | // reverse magic 99 | var nm = Buffer.allocUnsafe(4) 100 | nm.writeUInt32BE(this.protocol ? this.protocol.magic : 0, 0) 101 | nm = nm.readUInt32LE(0) 102 | 103 | return Object.assign({}, this, { 104 | name: this.testnet ? 'testnet' : 'livenet', 105 | alias: this.testnet ? 'testnet' : 'mainnet', 106 | pubkeyhash: this.versions.public, 107 | privatekey: this.versions.private, 108 | scripthash: this.versions.scripthash, 109 | xpubkey: (this.versions.bip32 || {}).public, 110 | xprivkey: (this.versions.bip32 || {}).private, 111 | networkMagic: nm, 112 | port: this.port, 113 | dnsSeeds: this.seedsDns || [] 114 | }) 115 | } 116 | 117 | module.exports = coininfo 118 | -------------------------------------------------------------------------------- /lib/coins/bch.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'BitcoinCash', 8 | per1: 1e8, 9 | unit: 'BCH' 10 | } 11 | 12 | var main = Object.assign({}, { 13 | hashGenesisBlock: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', 14 | // nDefaultPort 15 | port: 8333, 16 | portRpc: 8332, 17 | protocol: { 18 | // pchMessageStart 19 | magic: 0xe8f3e1e3 // careful, sent over wire as little endian 20 | }, 21 | // vSeeds 22 | seedsDns: [ 23 | 'seed.bitcoinabc.org', 24 | 'seed-abc.bitcoinforks.org', 25 | 'btccash-seeder.bitcoinunlimited.info', 26 | 'seed.bitprim.org', 27 | 'seed.deadalnix.me', 28 | 'seeder.criptolayer.net' 29 | ], 30 | // base58Prefixes 31 | versions: { 32 | bip32: { 33 | private: 0x0488ade4, 34 | public: 0x0488b21e 35 | }, 36 | bip44: 145, 37 | private: 0x80, 38 | public: 0x00, 39 | scripthash: 0x05 40 | } 41 | }, common) 42 | 43 | var test = Object.assign({}, { 44 | hashGenesisBlock: '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943', 45 | port: 18333, 46 | portRpc: 18332, 47 | protocol: { 48 | magic: 0xf4f3e5f4 49 | }, 50 | seedsDns: [ 51 | 'testnet-seed.bitcoinabc.org', 52 | 'testnet-seed-abc.bitcoinforks.org', 53 | 'testnet-seed.bitprim.org', 54 | 'testnet-seed.deadalnix.me', 55 | 'testnet-seeder.criptolayer.net' 56 | ], 57 | versions: { 58 | bip32: { 59 | private: 0x04358394, 60 | public: 0x043587cf 61 | }, 62 | bip44: 1, 63 | private: 0xef, 64 | public: 0x6f, 65 | scripthash: 0xc4 66 | } 67 | }, common) 68 | 69 | var regtest = Object.assign({}, { 70 | hashGenesisBlock: '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', 71 | port: 18444, 72 | portRpc: 18332, 73 | protocol: { 74 | magic: 0xfabfb5da 75 | }, 76 | seedsDns: [], 77 | versions: { 78 | bip32: { 79 | private: 0x04358394, 80 | public: 0x043587cf 81 | }, 82 | bip44: 1, 83 | private: 0xef, 84 | public: 0x6f, 85 | scripthash: 0xc4 86 | } 87 | }, common) 88 | 89 | module.exports = { 90 | main, 91 | test, 92 | regtest 93 | } 94 | -------------------------------------------------------------------------------- /lib/coins/blk.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/rat4/blackcoin/blob/master/src/chainparams.cpp 4 | */ 5 | var common = { 6 | name: 'BlackCoin', 7 | per1: 1e8, 8 | unit: 'BLK' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '000001faef25dec4fbcf906e6242621df2c183bf232f263d0ba5b101911e4563', 13 | port: 15714, 14 | portRpc: 15715, 15 | protocol: { 16 | magic: 0x05223570 // careful, sent over wire as little endian 17 | }, 18 | seedsDns: [ 19 | 'rat4.blackcoin.co', 20 | 'seed.blackcoin.co', 21 | 'archon.darkfox.id.au', 22 | 'foxy.seeds.darkfox.id.au', 23 | '6.syllabear.us.to', 24 | 'bcseed.syllabear.us.to' 25 | ], 26 | versions: { 27 | bip32: { 28 | private: 0x0488ade4, 29 | public: 0x0488b21e 30 | }, 31 | bip44: 0xa, 32 | private: 0x99, 33 | public: 0x19, 34 | scripthash: 0x55 35 | } 36 | }, common) 37 | 38 | module.exports = { 39 | main, 40 | test: null 41 | } 42 | -------------------------------------------------------------------------------- /lib/coins/btc.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Bitcoin', 8 | per1: 1e8, 9 | unit: 'BTC', 10 | messagePrefix: '\x18Bitcoin Signed Message:\n' 11 | } 12 | 13 | var main = Object.assign({}, { 14 | hashGenesisBlock: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', 15 | // nDefaultPort 16 | port: 8333, 17 | portRpc: 8332, 18 | protocol: { 19 | // pchMessageStart 20 | magic: 0xd9b4bef9 // careful, sent over wire as little endian 21 | }, 22 | bech32: 'bc', 23 | // vSeeds 24 | seedsDns: [ 25 | 'seed.bitcoin.sipa.be', 26 | 'dnsseed.bluematt.me', 27 | 'seed.bitcoinstats.com', 28 | 'seed.bitcoin.jonasschnelli.ch', 29 | 'seed.btc.petertodd.org', 30 | 'seed.bitcoin.sprovoost.nl', 31 | 'dnsseed.emzy.de' 32 | ], 33 | // base58Prefixes 34 | versions: { 35 | bip32: { 36 | private: 0x0488ade4, 37 | public: 0x0488b21e 38 | }, 39 | bip44: 0, 40 | private: 0x80, 41 | public: 0x00, 42 | scripthash: 0x05 43 | } 44 | }, common) 45 | 46 | var test = Object.assign({}, { 47 | hashGenesisBlock: '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943', 48 | port: 18333, 49 | portRpc: 18332, 50 | protocol: { 51 | magic: 0x0709110b 52 | }, 53 | bech32: 'tb', 54 | seedsDns: [ 55 | 'testnet-seed.alexykot.me', 56 | 'testnet-seed.bitcoin.schildbach.de', 57 | 'testnet-seed.bitcoin.petertodd.org', 58 | 'testnet-seed.bluematt.me' 59 | ], 60 | versions: { 61 | bip32: { 62 | private: 0x04358394, 63 | public: 0x043587cf 64 | }, 65 | bip44: 1, 66 | private: 0xef, 67 | public: 0x6f, 68 | scripthash: 0xc4 69 | } 70 | }, common) 71 | 72 | var regtest = Object.assign({}, { 73 | hashGenesisBlock: '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', 74 | port: 18444, 75 | portRpc: 18332, 76 | protocol: { 77 | magic: 0xdab5bffa 78 | }, 79 | bech32: 'bcrt', 80 | seedsDns: [], 81 | versions: { 82 | bip32: { 83 | private: 0x04358394, 84 | public: 0x043587cf 85 | }, 86 | bip44: 1, 87 | private: 0xef, 88 | public: 0x6f, 89 | scripthash: 0xc4 90 | } 91 | }, common) 92 | 93 | // source: https://github.com/btcsuite/btcd/blob/6867ff32788a1beb9d148e414d7f84f50958f0d2/chaincfg/params.go#L508 94 | var simnet = Object.assign({}, { 95 | hashGenesisBlock: 'f67ad7695d9b662a72ff3d8edbbb2de0bfa67b13974bb9910d116d5cbd863e68', 96 | port: 18555, 97 | portRpc: 18556, 98 | protocol: { 99 | magic: 0x12141c16 100 | }, 101 | bech32: 'sb', 102 | seedsDns: [], 103 | versions: { 104 | bip32: { 105 | private: 0x0420b900, 106 | public: 0x0420bd3a 107 | }, 108 | bip44: 115, 109 | private: 0x64, 110 | public: 0x3f, 111 | scripthash: 0x7b 112 | } 113 | }, common) 114 | 115 | module.exports = { 116 | main, 117 | test, 118 | regtest, 119 | simnet 120 | } 121 | -------------------------------------------------------------------------------- /lib/coins/btg.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/BTCGPU/BTCGPU/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Bitcoin Gold', 8 | unit: 'BTG' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', 13 | // nDefaultPort 14 | port: 8338, 15 | protocol: { 16 | // pchMessageStart 17 | magic: 0x446d47e1 // careful, sent over wire as little endian 18 | }, 19 | bech32: 'btg', 20 | // vSeeds 21 | seedsDns: [ 22 | 'eu-dnsseed.bitcoingold-official.org', 23 | 'dnsseed.bitcoingold.org', 24 | 'dnsseed.btcgpu.org' 25 | ], 26 | // base58Prefixes 27 | versions: { 28 | bip32: { 29 | private: 0x0488ade4, 30 | public: 0x0488b21e 31 | }, 32 | bip44: 156, 33 | private: 0x80, 34 | public: 0x26, 35 | scripthash: 0x17 36 | } 37 | }, common) 38 | 39 | var test = Object.assign({}, { 40 | hashGenesisBlock: '0x00000000e0781ebe24b91eedc293adfea2f557b53ec379e78959de3853e6f9f6', 41 | port: 18338, 42 | portRpc: 18332, 43 | protocol: { 44 | magic: 0x456e48e2 45 | }, 46 | bech32: 'tbtg', 47 | seedsDns: [ 48 | 'test-dnsseed.bitcoingold.org', 49 | 'test-dnsseed.btcgpu.org', 50 | 'eu-test-dnsseed.bitcoingold-official.org' 51 | ], 52 | versions: { 53 | bip32: { 54 | private: 0x04358394, 55 | public: 0x043587cf 56 | }, 57 | bip44: 156, 58 | private: 0xef, 59 | public: 0x6f, 60 | scripthash: 0xc4 61 | } 62 | }, common) 63 | 64 | module.exports = { 65 | main, 66 | test 67 | } 68 | -------------------------------------------------------------------------------- /lib/coins/cbn.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/c0ban/c0ban/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'c0ban', 8 | unit: 'RYO' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '000000005184ffce04351e687a3965b300ee011d26b2089232cd039273be4a67', 13 | // nDefaultPort 14 | port: 3881, 15 | portRpc: 3882, 16 | protocol: { 17 | magic: 0x6e623063 // pchMessageStart 18 | }, 19 | // vSeeds 20 | seedsDns: [ 21 | 'jp01.dnsseed.c0ban.com', 22 | 'kr01.dnsseed.c0ban.com' 23 | ], 24 | // base58Prefixes 25 | versions: { 26 | bip32: { 27 | private: 0x0488ade4, // base58Prefixes[EXT_SECRET_KEY] 28 | public: 0x0488b21e // base58Prefixes[EXT_PUBLIC_KEY] 29 | }, 30 | // https://github.com/satoshilabs/slips/blob/master/slip-0044.md 31 | bip44: 88888, // TODO: decide cbn bip44 32 | private: 0x88, // base58Prefixes[SECRET_KEY] 33 | public: 0x12, // base58Prefixes[PUBKEY_ADDRESS] 34 | scripthash: 0x1c // base58Prefixes[SCRIPT_ADDRESS] 35 | } 36 | }, common) 37 | 38 | var test = Object.assign({}, { 39 | hashGenesisBlock: '000000005184ffce04351e687a3965b300ee011d26b2089232cd039273be4a67', 40 | port: 13881, 41 | portRpc: 13882, 42 | protocol: { 43 | magic: 0x8e828083 // pchMessageStart 44 | }, 45 | seedsDns: [ 46 | ], 47 | versions: { 48 | bip32: { 49 | private: 0x04388388, // base58Prefixes[EXT_SECRET_KEY] 50 | public: 0x04588788 // base58Prefixes[EXT_PUBLIC_KEY] 51 | }, 52 | // https://github.com/satoshilabs/slips/blob/master/slip-0044.md 53 | bip44: 1, 54 | private: 0xee, // base58Prefixes[SECRET_KEY] 55 | public: 0x76, // base58Prefixes[PUBKEY_ADDRESS] 56 | scripthash: 0xc6 // base58Prefixes[SCRIPT_ADDRESS] 57 | } 58 | }, common) 59 | 60 | var regtest = Object.assign({}, { 61 | hashGenesisBlock: '3249e44acac8fc67e6b94e882525cea6f5a9853e1ff7b4a1d5f470b23ff8ae11', 62 | port: 23881, 63 | portRpc: 23882, 64 | protocol: { 65 | magic: 0xdab5bffa // pchMessageStart 66 | }, 67 | seedsDns: [ 68 | ], 69 | versions: { 70 | bip32: { 71 | private: 0x043587cf, // base58Prefixes[EXT_SECRET_KEY] 72 | public: 0x04358394 // base58Prefixes[EXT_PUBLIC_KEY] 73 | }, 74 | // https://github.com/satoshilabs/slips/blob/master/slip-0044.md 75 | bip44: 1, 76 | private: 0xef, // base58Prefixes[SECRET_KEY] 77 | public: 0x6f, // base58Prefixes[PUBKEY_ADDRESS] 78 | scripthash: 0xc4 // base58Prefixes[SCRIPT_ADDRESS] 79 | } 80 | }, common) 81 | 82 | module.exports = { 83 | main, 84 | test, 85 | regtest 86 | } 87 | -------------------------------------------------------------------------------- /lib/coins/city.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'CityCoin', 3 | isProofOfStake: true 4 | } 5 | 6 | var main = Object.assign({}, { 7 | unit: 'CITY', 8 | hashGenesisBlock: '00000b0517068e602ed5279c20168cfa1e69884ee4e784909652da34c361bff2', 9 | port: 4333, 10 | portRpc: 4334, 11 | protocol: { 12 | magic: 0x43545901 13 | }, 14 | seedsDns: [ 15 | 'seed.city-chain.org', 16 | 'seed.city-coin.org', 17 | 'seed.citychain.foundation', 18 | 'seed.liberstad.com' 19 | ], 20 | versions: { 21 | bip32: { 22 | private: 0x0488ade4, 23 | public: 0x0488b21e 24 | }, 25 | bip44: 1926, 26 | private: 0xed, 27 | public: 0x1c, 28 | scripthash: 0x58 29 | } 30 | }, common) 31 | 32 | var test = Object.assign({}, { 33 | unit: 'TCITY', 34 | hashGenesisBlock: '00077765f625cc2cb6266544ff7d5a462f25be14ea1116dc2bd2fec17e40a5e3', 35 | port: 24333, 36 | portRpc: 24334, 37 | protocol: { 38 | magic: 0x43545401 39 | }, 40 | seedsDns: [ 41 | 'testseed.city-chain.org', 42 | 'testseed.city-coin.org', 43 | 'testseed.citychain.foundation' 44 | ], 45 | versions: { 46 | bip32: { 47 | private: 0x0488ade4, 48 | public: 0x0488b21e 49 | }, 50 | bip44: 1926, 51 | private: 0xc2, 52 | public: 0x42, 53 | scripthash: 0xc4 54 | } 55 | }, common) 56 | 57 | module.exports = { 58 | main, 59 | test 60 | } 61 | -------------------------------------------------------------------------------- /lib/coins/dash.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/dashpay/dash/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Dash', 8 | unit: 'DASH' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6', 13 | // nDefaultPort 14 | port: 9999, 15 | portRpc: 9998, 16 | protocol: { 17 | magic: 0xbd6b0cbf // careful, sent over wire as little endian 18 | }, 19 | // vSeeds 20 | seedsDns: [ 21 | 'dash.org', 22 | 'dnsseed.dash.org', 23 | 'dashdot.io', 24 | 'dnsseed.dashdot.io', 25 | 'masternode.io', 26 | 'dnsseed.masternode.io', 27 | 'dashpay.io', 28 | 'dnsseed.dashpay.io' 29 | ], 30 | // base58Prefixes 31 | versions: { 32 | bip32: { 33 | private: 0x0488ade4, 34 | public: 0x0488b21e 35 | }, 36 | bip44: 5, 37 | private: 0xcc, 38 | public: 0x4c, 39 | scripthash: 0x10 40 | } 41 | }, common) 42 | 43 | var test = Object.assign({}, { 44 | hashGenesisBlock: '00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c', 45 | port: 19999, 46 | portRpc: 19998, 47 | seedsDns: [ 48 | 'dashdot.io', 49 | 'testnet-seed.dashdot.io', 50 | 'masternode.io', 51 | 'test.dnsseed.masternode.io' 52 | ], 53 | versions: { 54 | bip32: { 55 | private: 0x04358394, 56 | public: 0x043587cf 57 | }, 58 | bip44: 1, 59 | private: 0xef, 60 | public: 0x8c, 61 | scripthash: 0x13 62 | } 63 | }, common) 64 | 65 | module.exports = { 66 | main, 67 | test 68 | } 69 | -------------------------------------------------------------------------------- /lib/coins/dcr.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'Decred', 3 | unit: 'DCR' 4 | } 5 | 6 | // https://github.com/decred/dcrd/blob/ef71103c95cbf77e5a0418e3d413b5906e710b25/chaincfg/params.go 7 | // https://github.com/decred/bitcore/blob/a92381b2b0023b28a1b7eb03e6cb0bfb7800200d/lib/networks.js 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980', 10 | port: 9108, 11 | portRpc: 9109, 12 | protocol: { 13 | magic: 0xf900b4d9 14 | }, 15 | seedsDns: [ 16 | 'mainnet-seed.decred.mindcry.org', 17 | 'mainnet-seed.decred.netpurgatory.com', 18 | 'mainnet.decredseed.org', 19 | 'mainnet-seed.decred.org' 20 | ], 21 | versions: { 22 | bip32: { 23 | private: 0x02fda4e8, 24 | public: 0x02fda926 25 | }, 26 | bip44: 42, 27 | private: 0x22de, 28 | public: 0x073f, 29 | scripthash: 0x071a 30 | } 31 | }, common) 32 | 33 | var test = Object.assign({}, { 34 | hashGenesisBlock: '5b7466edf6739adc9b32aaedc54e24bdc59a05f0ced855088835fe3cbe58375f', 35 | port: 19108, 36 | portRpc: 19109, 37 | protocol: { 38 | magic: 0x48e7a065 39 | }, 40 | seedsDns: [ 41 | 'testnet-seed.decred.mindcry.org', 42 | 'testnet-seed.decred.netpurgatory.org', 43 | 'testnet.decredseed.org', 44 | 'testnet-seed.decred.org' 45 | ], 46 | versions: { 47 | bip32: { 48 | private: 0x04358397, 49 | public: 0x043587d1 50 | }, 51 | bip44: 42, 52 | private: 0x230e, 53 | public: 0x0f21, 54 | scripthash: 0x0efc 55 | } 56 | }, common) 57 | 58 | module.exports = { 59 | main, 60 | test 61 | } 62 | -------------------------------------------------------------------------------- /lib/coins/dgb.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/digibyte/digibyte/blob/9e4c0b3ddfd10a7ab852240ff716a7b93af89a07/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'DigiByte', 8 | per1: 1e8, 9 | unit: 'DGB' 10 | } 11 | 12 | var main = Object.assign({}, { 13 | hashGenesisBlock: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', 14 | // nDefaultPort 15 | port: 12024, 16 | portRpc: 14022, 17 | protocol: { 18 | // pchMessageStart 19 | magic: 0xfac3b6da // careful, sent over wire as little endian 20 | }, 21 | bech32: 'dgb', 22 | // vSeeds 23 | seedsDns: [ 24 | 'seed.digibyte.io', 25 | 'digiexplorer.info', 26 | 'digihash.co' 27 | ], 28 | // base58Prefixes 29 | versions: { 30 | bip44: 0x80000014, 31 | private: 0x80, 32 | public: 0x1e, 33 | scripthash: 0x3f, // new 'S' prefix 34 | scripthash2: 0x05 // old '3' prefix 35 | } 36 | }, common) 37 | 38 | module.exports = { main } 39 | -------------------------------------------------------------------------------- /lib/coins/dnr.js: -------------------------------------------------------------------------------- 1 | // https://github.com/carsenk/denarius/blob/master/src/main.cpp 2 | 3 | var common = { 4 | name: 'Denarius', 5 | unit: 'DNR' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '00000d5dbbda01621cfc16bbc1f9bf3264d641a5dbf0de89fd0182c2c4828fcd', 10 | port: 33339, 11 | portRpc: 32339, 12 | protocol: { 13 | magic: 0xb4eff2fa 14 | }, 15 | seedsDns: [ 16 | 'denariusexplorer.org', 17 | 'denarius.host', 18 | 'denarius.tech', 19 | 'denarius.network' 20 | ], 21 | versions: { 22 | bip32: { 23 | private: 0x0488ade4, 24 | public: 0x0488b21e 25 | }, 26 | bip44: 116, 27 | private: 0x9e, 28 | public: 0x1e, 29 | scripthash: 0x5a 30 | } 31 | }, common) 32 | 33 | var test = Object.assign({}, { 34 | hashGenesisBlock: '000086bfe8264d241f7f8e5393f747784b8ca2aa98bdd066278d590462a4fdb4', 35 | versions: { 36 | bip44: 1, 37 | private: 0x8c, 38 | public: 0x12, 39 | scripthash: 0x74 40 | } 41 | }, common) 42 | 43 | module.exports = { 44 | main, 45 | test 46 | } 47 | -------------------------------------------------------------------------------- /lib/coins/doge.js: -------------------------------------------------------------------------------- 1 | // https://github.com/dogecoin/dogecoin/blob/master/src/chainparams.cpp 2 | 3 | var common = { 4 | name: 'Dogecoin', 5 | unit: 'DOGE' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691', 10 | port: 22556, 11 | protocol: { 12 | magic: 0xc0c0c0c0 13 | }, 14 | seedsDns: [ 15 | 'seed.multidoge.org', 16 | 'seed2.multidoge.org' 17 | ], 18 | versions: { 19 | bip32: { 20 | private: 0x02fac398, 21 | public: 0x02facafd 22 | }, 23 | bip44: 3, 24 | private: 0x9e, 25 | public: 0x1e, 26 | scripthash: 0x16 27 | } 28 | }, common) 29 | 30 | var test = Object.assign({}, { 31 | hashGenesisBlock: 'bb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e', 32 | port: 44556, 33 | protocol: { 34 | magic: 0xfcc1b7dc 35 | }, 36 | seedsDns: [ 37 | 'testseed.jrn.me.uk' 38 | ], 39 | versions: { 40 | bip32: { 41 | private: 0x04358394, 42 | public: 0x043587cf 43 | }, 44 | bip44: 1, 45 | private: 0xf1, 46 | public: 0x71, 47 | scripthash: 0xc4 48 | } 49 | }, common) 50 | 51 | module.exports = { 52 | main, 53 | test 54 | } 55 | -------------------------------------------------------------------------------- /lib/coins/grs.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Groestlcoin', 8 | per1: 1e8, 9 | unit: 'GRS', 10 | messagePrefix: '\x1CGroestlCoin Signed Message:\n' 11 | } 12 | 13 | var main = Object.assign({}, { 14 | hashGenesisBlock: '00000ac5927c594d49cc0bdb81759d0da8297eb614683d3acb62f0703b639023', 15 | // nDefaultPort 16 | port: 1331, 17 | portRpc: 1441, 18 | protocol: { 19 | // pchMessageStart 20 | magic: 0xd4b4bef9 // careful, sent over wire as little endian 21 | }, 22 | bech32: 'grs', 23 | // vSeeds 24 | seedsDns: [ 25 | 'dnsseed1.groestlcoin.org', 26 | 'dnsseed2.groestlcoin.org', 27 | 'dnsseed3.groestlcoin.org', 28 | 'dnsseed4.groestlcoin.org' 29 | ], 30 | // base58Prefixes 31 | versions: { 32 | bip32: { 33 | private: 0x0488ade4, 34 | public: 0x0488b21e 35 | }, 36 | bip44: 17, 37 | private: 0x80, 38 | public: 0x24, 39 | scripthash: 0x05 40 | } 41 | }, common) 42 | 43 | var test = Object.assign({}, { 44 | hashGenesisBlock: '0x000000ffbb50fc9898cdd36ec163e6ba23230164c0052a28876255b7dcf2cd36', 45 | port: 17777, 46 | portRpc: 17766, 47 | protocol: { 48 | magic: 0x0709110b 49 | }, 50 | bech32: 'tgrs', 51 | seedsDns: [ 52 | 'testnet-seed1.groestlcoin.org', 53 | 'testnet-seed2.groestlcoin.org' 54 | ], 55 | versions: { 56 | bip32: { 57 | private: 0x04358394, 58 | public: 0x043587cf 59 | }, 60 | bip44: 1, 61 | private: 0xef, 62 | public: 0x6f, 63 | scripthash: 0xc4 64 | } 65 | }, common) 66 | 67 | var regtest = Object.assign({}, { 68 | hashGenesisBlock: '0x000000ffbb50fc9898cdd36ec163e6ba23230164c0052a28876255b7dcf2cd36', 69 | port: 18888, 70 | portRpc: 18443, 71 | protocol: { 72 | magic: 0xdab5bffa 73 | }, 74 | bech32: 'grsrt', 75 | seedsDns: [], 76 | versions: { 77 | bip32: { 78 | private: 0x04358394, 79 | public: 0x043587cf 80 | }, 81 | bip44: 1, 82 | private: 0xef, 83 | public: 0x6f, 84 | scripthash: 0xc4 85 | } 86 | }, common) 87 | 88 | module.exports = { 89 | main, 90 | test, 91 | regtest 92 | } 93 | -------------------------------------------------------------------------------- /lib/coins/ltc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/litecoin-project/litecoin/blob/master-0.10/src/chainparams.cpp 2 | 3 | var common = { 4 | name: 'Litecoin', 5 | unit: 'LTC' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2', 10 | port: 9333, 11 | protocol: { 12 | magic: 0xdbb6c0fb 13 | }, 14 | bech32: 'ltc', 15 | seedsDns: [ 16 | 'dnsseed.litecointools.com', 17 | 'dnsseed.litecoinpool.org', 18 | 'dnsseed.ltc.xurious.com', 19 | 'dnsseed.koin-project.com', 20 | 'dnsseed.weminemnc.com' 21 | ], 22 | versions: { 23 | bip32: { 24 | private: 0x019d9cfe, 25 | public: 0x019da462 26 | }, 27 | bip44: 2, 28 | private: 0xb0, 29 | public: 0x30, 30 | scripthash: 0x32, 31 | scripthash2: 0x05 // old '3' prefix. available for backward compatibility. 32 | } 33 | }, common) 34 | 35 | var test = Object.assign({}, { 36 | hashGenesisBlock: 'f5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f', 37 | bech32: 'tltc', 38 | versions: { 39 | bip32: { 40 | private: 0x0436ef7d, 41 | public: 0x0436f6e1 42 | }, 43 | bip44: 1, 44 | private: 0xef, 45 | public: 0x6f, 46 | scripthash: 0x3a, 47 | scripthash2: 0xc4 48 | } 49 | }, common) 50 | 51 | module.exports = { 52 | main, 53 | test 54 | } 55 | -------------------------------------------------------------------------------- /lib/coins/mona.js: -------------------------------------------------------------------------------- 1 | // https://github.com/monacoinproject/monacoin/blob/master-0.13/src/chainparams.cpp 2 | 3 | var common = { 4 | name: 'Monacoin', 5 | unit: 'MONA' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: 'ff9f1c0116d19de7c9963845e129f9ed1bfc0b376eb54fd7afa42e0d418c8bb6', 10 | port: 9401, 11 | portRpc: 9402, 12 | protocol: { 13 | magic: 0xdbb6c0fb 14 | }, 15 | bech32: 'mona', 16 | seedsDns: [ 17 | 'dnsseed.monacoin.org' 18 | ], 19 | versions: { 20 | bip32: { 21 | private: 0x0488ade4, 22 | public: 0x0488b21e 23 | }, 24 | bip44: 22, 25 | private: 0xb0, 26 | private2: 0xb2, // old wif 27 | public: 0x32, 28 | scripthash: 0x37, 29 | scripthash2: 0x05 // old '3' prefix. available for backward compatibility. 30 | } 31 | }, common) 32 | 33 | var test = Object.assign({}, { 34 | hashGenesisBlock: 'a2b106ceba3be0c6d097b2a6a6aacf9d638ba8258ae478158f449c321061e0b2', 35 | port: 19403, 36 | portRpc: 19402, 37 | protocol: { 38 | magic: 0xf1c8d2fd 39 | }, 40 | bech32: 'tmona', 41 | seedsDns: [ 42 | 'testnet-dnsseed.monacoin.org' 43 | ], 44 | versions: { 45 | bip32: { 46 | private: 0x04358394, 47 | public: 0x043587cf 48 | }, 49 | bip44: 1, 50 | private: 0xef, 51 | public: 0x6f, 52 | scripthash: 0x75, 53 | scripthash2: 0xc4 54 | } 55 | }, common) 56 | 57 | module.exports = { 58 | main, 59 | test 60 | } 61 | -------------------------------------------------------------------------------- /lib/coins/nbt.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'NuBits', 3 | per1: 1e6, 4 | unit: 'NBT' 5 | } 6 | 7 | var main = Object.assign({}, { 8 | hashGenesisBlock: '000003cc2da5a0a289ad0a590c20a8b975219ddc1204efd169e947dd4cbad73f', 9 | // nDefaultPort 10 | port: 7890, 11 | portRpc: 14002, 12 | protocol: { 13 | // pchMessageStart 14 | magic: 0xd9b4bef9 // careful, sent over wire as little endian 15 | }, 16 | // vSeeds 17 | seedsDns: [ 18 | ], 19 | // base58Prefixes 20 | versions: { 21 | bip32: { 22 | private: 0x0488ade4, 23 | public: 0x0488b21e 24 | }, 25 | bip44: 12, 26 | private: 0x96, 27 | public: 0x19, 28 | scripthash: 0x1a 29 | } 30 | }, common) 31 | 32 | module.exports = { 33 | main 34 | } 35 | -------------------------------------------------------------------------------- /lib/coins/nmc.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'Namecoin', 3 | unit: 'NMC' 4 | } 5 | 6 | var main = Object.assign({}, { 7 | hashGenesisBlock: '000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770', 8 | versions: { 9 | bip44: 7, 10 | private: 0xb4, 11 | public: 0x34, 12 | scripthash: 0x05 13 | } 14 | }, common) 15 | 16 | module.exports = { 17 | main, 18 | test: null 19 | } 20 | -------------------------------------------------------------------------------- /lib/coins/ppc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/peercoin/peercoin/tree/v0.7.0ppc/src 2 | // https://github.com/peercoin/peercoin/blob/v0.7.0ppc/src/${filename} 3 | 4 | var common = { 5 | name: 'Peercoin', 6 | per1: 1e6, // util.h:40 7 | unit: 'PPC', 8 | messagePrefix: '\x18Peercoin Signed Message:\n' // main.cpp:77 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '0000000032fe677166d54963b62a4677d8957e87c508eaa4fd7eb1c880cd27e3', // main.h:84 13 | // nDefaultPort 14 | port: 9901, // protocol.h:18 15 | portRpc: 9902, // protocol.h:19 16 | protocol: { 17 | // pchMessageStart 18 | magic: 0xe5e9e8e6 // careful, sent over wire as little endian protocol.cpp:31 19 | }, 20 | // vSeeds 21 | seedsDns: [ 22 | // net.cpp:1209 23 | 'seed.peercoin.net', 24 | 'seed2.peercoin.net', 25 | 'seed.peercoin-library.org', 26 | 'ppcseed.ns.7server.net' 27 | ], 28 | versions: { 29 | // not implemented in Peercoin <= v0.7.x nodes, only 3rd party wallets 30 | // https://github.com/jmacwhyte/recovery-phrase-recovery/blob/52073aba08e9d01032c0b5aff8c682911fe2e5fc/js/bitcoinjs-extensions.js#L58 31 | bip32: { 32 | private: 0x0488ade4, 33 | public: 0x0488b21e 34 | }, 35 | bip44: 6, // https://github.com/satoshilabs/slips/blob/master/slip-0044.md 36 | private: 0xb7, // base58.h:402 ; 128 + PUBKEY_ADDRESS 37 | public: 0x37, // base58.h:276 38 | scripthash: 0x75 // base58.h:277 39 | } 40 | }, common) 41 | 42 | var test = Object.assign({}, { 43 | hashGenesisBlock: '00000001f757bb737f6596503e17cd17b0658ce630cc727c0cca81aec47c9f06', 44 | port: 9903, 45 | portRpc: 9904, 46 | protocol: { 47 | magic: 0xefc0f2cb 48 | }, 49 | seedsDns: [ 50 | 'tseed.peercoin.net', 51 | 'tseed2.peercoin.net', 52 | 'tseed.peercoin-library.org' 53 | ], 54 | versions: { 55 | bip32: { 56 | private: 0x04358394, 57 | public: 0x043587cf 58 | }, 59 | bip44: 1, 60 | private: 0xef, 61 | public: 0x6f, 62 | scripthash: 0xc4 63 | } 64 | }, common) 65 | 66 | module.exports = { 67 | main, 68 | test 69 | } 70 | -------------------------------------------------------------------------------- /lib/coins/qtum.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/qtumproject/qtum/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Qtum', 8 | unit: 'QTUM' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '000075aef83cf2853580f8ae8ce6f8c3096cfa21d98334d6e3f95e5582ed986c', 13 | // nDefaultPort 14 | port: 3888, 15 | protocol: { 16 | // pchMessageStart 17 | magic: 0xd3a6cff1 // careful, sent over wire as little endian 18 | }, 19 | bech32: 'qc', 20 | // vSeeds 21 | seedsDns: [ 22 | 'qtum3.dynu.net' 23 | ], 24 | // base58Prefixes 25 | versions: { 26 | bip32: { 27 | private: 0x0488ade4, 28 | public: 0x0488b21e 29 | }, 30 | bip44: 2301, 31 | private: 0x80, 32 | public: 0x3A, 33 | scripthash: 0x32 34 | } 35 | }, common) 36 | 37 | module.exports = { 38 | main 39 | } 40 | -------------------------------------------------------------------------------- /lib/coins/rdd.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'ReddCoin', 3 | unit: 'RDD' 4 | } 5 | 6 | var main = Object.assign({}, { 7 | hashGenesisBlock: 'b868e0d95a3c3c0e0dadc67ee587aaf9dc8acbf99e3b4b3110fad4eb74c1decc', 8 | versions: { 9 | bip44: 4, 10 | private: 0xbd, 11 | public: 0x3d, 12 | scripthash: 0x05 13 | } 14 | }, common) 15 | 16 | var test = Object.assign({}, { 17 | hashGenesisBlock: 'a12ac9bd4cd26262c53a6277aafc61fe9dfe1e2b05eaa1ca148a5be8b394e35a', 18 | versions: { 19 | bip44: 1, 20 | private: 0xef, 21 | public: 0x6f, 22 | scripthash: 0xc4 23 | } 24 | }, common) 25 | 26 | module.exports = { 27 | main, 28 | test 29 | } 30 | -------------------------------------------------------------------------------- /lib/coins/rvn.js: -------------------------------------------------------------------------------- 1 | // https://github.com/RavenProject/Ravencoin/blob/master/src/chainparams.cpp 2 | 3 | var common = { 4 | name: 'Ravencoin', 5 | unit: 'RVN' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '0000006b444bc2f2ffe627be9d9e7e7a0730000870ef6eb6da46c8eae389df90', 10 | port: 8767, 11 | protocol: { 12 | magic: 0x4e564152 13 | }, 14 | bech32: 'rc', 15 | seedsDns: [ 16 | 'seed-raven.bitactivate.com', 17 | 'seed-raven.ravencoin.com', 18 | 'seed-raven.ravencoin.org' 19 | ], 20 | versions: { 21 | bip32: { 22 | private: 0x0488ade4, 23 | public: 0x0488b21e 24 | }, 25 | bip44: 175, 26 | private: 0x80, 27 | public: 0x3c, 28 | scripthash: 0x7a 29 | } 30 | }, common) 31 | 32 | var test = Object.assign({}, { 33 | hashGenesisBlock: '000000ecfc5e6324a079542221d00e10362bdc894d56500c414060eea8a3ad5a', 34 | port: 18770, 35 | protocol: { 36 | magic: 0x544e5652 37 | }, 38 | bech32: 'tr', 39 | seedsDns: [ 40 | 'seed-testnet-raven.bitactivate.com', 41 | 'seed-testnet-raven.ravencoin.com', 42 | 'seed-testnet-raven.ravencoin.org' 43 | ], 44 | versions: { 45 | bip32: { 46 | private: 0x04358394, 47 | public: 0x043587cf 48 | }, 49 | bip44: 1, 50 | private: 0xef, 51 | public: 0x6f, 52 | scripthash: 0xc4 53 | } 54 | }, common) 55 | 56 | module.exports = { 57 | main, 58 | test 59 | } 60 | -------------------------------------------------------------------------------- /lib/coins/via.js: -------------------------------------------------------------------------------- 1 | // https://github.com/viacoin/viacoin/blob/master/src/chainparams.cpp 2 | 3 | var common = { 4 | name: 'Viacoin', 5 | unit: 'VIA' 6 | } 7 | 8 | var main = Object.assign({}, { 9 | hashGenesisBlock: '4e9b54001f9976049830128ec0331515eaabe35a70970d79971da1539a400ba1', 10 | port: 5223, 11 | protocol: { 12 | magic: 0xcbc6680f 13 | }, 14 | seedsDns: [ 15 | 'seed.viacoin.net', 16 | 'viaseeder.barbatos.fr', 17 | 'mainnet.viacoin.net' 18 | ], 19 | versions: { 20 | bip32: { 21 | private: 0x0488ade4, 22 | public: 0x0488b21e 23 | }, 24 | bip44: 14, 25 | private: 0xc7, 26 | public: 0x47, 27 | scripthash: 0x21 28 | } 29 | }, common) 30 | 31 | var test = Object.assign({}, { 32 | hashGenesisBlock: '770aa712aa08fdcbdecc1c8df1b3e2d4e17a7cf6e63a28b785b32e74c96cb27d', 33 | port: 25223, 34 | protocol: { 35 | magic: 0x92efc5a9 36 | }, 37 | seedsDns: [ 38 | 'testnet.viacoin.net', 39 | 'seed-testnet.viacoin.net' 40 | ], 41 | versions: { 42 | bip32: { 43 | private: 0x04358394, 44 | public: 0x043587cf 45 | }, 46 | bip44: 1, 47 | private: 0xff, 48 | public: 0x7f, 49 | scripthash: 0xc4 50 | } 51 | }, common) 52 | 53 | module.exports = { 54 | main, 55 | test 56 | } 57 | -------------------------------------------------------------------------------- /lib/coins/vtc.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/vertcoin/vertcoin/blob/master/src/chainparams.cpp 4 | */ 5 | 6 | var common = { 7 | name: 'Vertcoin', 8 | unit: 'VTC' 9 | } 10 | 11 | var main = Object.assign({}, { 12 | hashGenesisBlock: '4d96a915f49d40b1e5c2844d1ee2dccb90013a990ccea12c492d22110489f0c4', 13 | // nDefaultPort 14 | port: 5889, 15 | protocol: { 16 | // pchMessageStart 17 | magic: 0xdab5bffa // careful, sent over wire as little endian 18 | }, 19 | bech32: 'vtc', 20 | // vSeeds 21 | seedsDns: [ 22 | 'useast1.vtconline.org', 23 | 'vtc.gertjaap.org', 24 | 'seed.vtc.bryangoodson.org', 25 | 'dnsseed.pknight.ca', 26 | 'seed.orderofthetaco.org', 27 | 'seed.alexturek.org', 28 | 'vertcoin.mbl.cash' 29 | ], 30 | // base58Prefixes 31 | versions: { 32 | bip32: { 33 | private: 0x0488ade4, 34 | public: 0x0488b21e 35 | }, 36 | bip44: 28, 37 | private: 0x80, 38 | public: 0x47, 39 | scripthash: 0x05 40 | } 41 | }, common) 42 | 43 | var test = Object.assign({}, { 44 | hashGenesisBlock: 'cee8f24feb7a64c8f07916976aa4855decac79b6741a8ec2e32e2747497ad2c9', 45 | port: 15889, 46 | // portRpc: 18332, 47 | protocol: { 48 | magic: 0x74726576 49 | }, 50 | bech32: 'tvtc', 51 | seedsDns: [ 52 | 'jlovejoy.mit.edu', 53 | 'gertjaap.ddns.net', 54 | 'fr1.vtconline.org', 55 | 'tvtc.vertcoin.org' 56 | ], 57 | versions: { 58 | bip32: { 59 | private: 0x04358394, 60 | public: 0x043587cf 61 | }, 62 | private: 0xef, 63 | public: 0x4a, 64 | scripthash: 0xc4 65 | } 66 | }, common) 67 | 68 | var regtest = Object.assign({}, { 69 | hashGenesisBlock: '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', 70 | port: 18444, 71 | // portRpc: 18332, 72 | protocol: { 73 | magic: 0xdab5bffa 74 | }, 75 | seedsDns: [], 76 | versions: { 77 | bip32: { 78 | private: 0x04358394, 79 | public: 0x043587cf 80 | }, 81 | private: 0xef, 82 | public: 0x6f, 83 | scripthash: 0xc4 84 | } 85 | }, common) 86 | 87 | module.exports = { 88 | main, 89 | test, 90 | regtest 91 | } 92 | -------------------------------------------------------------------------------- /lib/coins/x42.js: -------------------------------------------------------------------------------- 1 | var common = { 2 | name: 'x42', 3 | isProofOfStake: true 4 | } 5 | 6 | var main = Object.assign({}, { 7 | unit: 'x42', 8 | hashGenesisBlock: '04ffe583707a96c1c2eb54af33a4b1dc6d9d8e09fea8c9a7b097ba88f0cb64c4', 9 | port: 52342, 10 | portRpc: 52343, 11 | protocol: { 12 | magic: 0x3526642 13 | }, 14 | seedsDns: [ 15 | 'mainnet1.x42seed.host', 16 | 'mainnetnode1.x42seed.host', 17 | 'tech.x42.cloud', 18 | 'x42.seed.blockcore.net' 19 | ], 20 | versions: { 21 | bip32: { 22 | private: 0x0488ade4, 23 | public: 0x0488b21e 24 | }, 25 | bip44: 424242, 26 | private: 0xcb, 27 | public: 0x4b, 28 | scripthash: 0x7d 29 | } 30 | }, common) 31 | 32 | var test = Object.assign({}, { 33 | unit: 'Tx42', 34 | hashGenesisBlock: 'a92bf124a1e6f237015440d5f1e1999bdef8e321f2d3fdc367eb2f7733b17854', 35 | port: 62342, 36 | portRpc: 62343, 37 | protocol: { 38 | magic: 0x4526642 39 | }, 40 | seedsDns: [ 41 | 'testnet1.x42seed.host' 42 | ], 43 | versions: { 44 | bip32: { 45 | private: 0x0488ade4, 46 | public: 0x0488b21e 47 | }, 48 | bip44: 424242, 49 | private: 0xc1, 50 | public: 0x41, 51 | scripthash: 0xc4 52 | } 53 | }, common) 54 | 55 | module.exports = { 56 | main, 57 | test 58 | } 59 | -------------------------------------------------------------------------------- /lib/coins/zec.js: -------------------------------------------------------------------------------- 1 | /* 2 | info from: 3 | https://github.com/zcash/zcash/blob/v1.0.12/src/chainparamsbase.cpp 4 | https://github.com/zcash/zcash/blob/v1.0.12/src/chainparams.cpp 5 | */ 6 | 7 | var common = { 8 | name: 'Zcash', 9 | unit: 'ZEC' 10 | } 11 | 12 | var main = Object.assign({}, { 13 | hashGenesisBlock: '00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08', 14 | // nDefaultPort 15 | port: 8233, 16 | portRpc: 8232, 17 | protocol: { 18 | // pchMessageStart 19 | magic: 0x6427e924 // careful, sent over wire as little endian 20 | }, 21 | // vSeeds 22 | seedsDns: [ 23 | 'dnsseed.z.cash', 24 | 'dnsseed.str4d.xyz', 25 | 'dnsseed.znodes.org' 26 | ], 27 | // base58Prefixes 28 | versions: { 29 | bip32: { 30 | private: 0x0488ade4, 31 | public: 0x0488b21e 32 | }, 33 | bip44: 133, 34 | private: 0x80, 35 | public: 0x1cb8, 36 | scripthash: 0x1cbd 37 | } 38 | }, common) 39 | 40 | var test = Object.assign({}, { 41 | hashGenesisBlock: '0x05a60a92d99d85997cce3b87616c089f6124d7342af37106edc76126334a2c38', 42 | port: 18233, 43 | portRpc: 18232, 44 | protocol: { 45 | magic: 0xbff91afa 46 | }, 47 | seedsDns: [ 48 | 'dnsseed.testnet.z.cash' 49 | ], 50 | versions: { 51 | bip32: { 52 | private: 0x04358394, 53 | public: 0x043587cf 54 | }, 55 | bip44: 133, 56 | private: 0xef, 57 | public: 0x1d25, 58 | scripthash: 0x1cba 59 | } 60 | }, common) 61 | 62 | module.exports = { 63 | main, 64 | test 65 | } 66 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coininfo", 3 | "version": "5.2.1", 4 | "description": "JavaScript component for crypto currency specific information.", 5 | "license": "MIT", 6 | "keywords": [ 7 | "cryptography", 8 | "crypto", 9 | "coin", 10 | "bitcoin", 11 | "bitcoin gold", 12 | "litecoin", 13 | "viacoin", 14 | "groestlcoin", 15 | "elliptic", 16 | "curve", 17 | "dogecoin", 18 | "blackcoin", 19 | "namecoin", 20 | "denarius", 21 | "dash", 22 | "monacoin", 23 | "zcash", 24 | "vertcoin", 25 | "qtum" 26 | ], 27 | "devDependencies": { 28 | "standard": "*", 29 | "tape": "^4.8.0" 30 | }, 31 | "repository": { 32 | "url": "https://github.com/cryptocoinjs/coininfo", 33 | "type": "git" 34 | }, 35 | "main": "./lib/coininfo.js", 36 | "files": [ 37 | "lib" 38 | ], 39 | "scripts": { 40 | "lint": "standard", 41 | "test": "npm run lint && npm run unit", 42 | "unit": "tape test/**/*.js" 43 | }, 44 | "dependencies": { 45 | "safe-buffer": "^5.1.1" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /test/coininfo.test.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | var ci = require('../') 3 | 4 | test('+ coininfo()', function (t) { 5 | t.test('iterate all coins', function (t) { 6 | var coins = [ 7 | 'bch', 8 | 'blk', 9 | 'btc', 'btc-test', 10 | 'city', 'city-test', 11 | 'doge', 'doge-test', 12 | 'ltc', 'ltc-test', 13 | 'via', 'via-test', 14 | 'grs', 'grs-test', 15 | 'nbt', 16 | 'nmc', 17 | 'ppc', 18 | 'dnr', 19 | 'rdd', 'rdd-test', 20 | 'mona', 'mona-test', 21 | 'rvn', 'rvn-test', 22 | 'x42', 'x42-test' 23 | ] 24 | 25 | coins.forEach(function (c) { 26 | t.ok(ci(c).versions.scripthash, 'should return valid data for ' + c) 27 | }) 28 | 29 | t.end() 30 | }) 31 | 32 | t.test('versions', function (t) { 33 | t.test('should return the version', function (t) { 34 | var v = ci('LTC').versions 35 | t.equal(v.public, 0x30) 36 | t.equal(v.private, 0xB0) 37 | t.end() 38 | }) 39 | 40 | t.test('should return bip32', function (t) { 41 | var v = ci('BTC-TEST').versions.bip32 42 | t.equal(v.public, 0x043587cf) 43 | t.equal(v.private, 0x04358394) 44 | t.end() 45 | }) 46 | 47 | t.test('> when does not have bip32', function (t) { 48 | var v = ci('PPC').versions.bip32 49 | t.equal(v.public, 0x0488b21e) 50 | t.equal(v.private, 0x0488ade4) 51 | t.end() 52 | }) 53 | 54 | t.test('> when full formal coin name is passed', function (t) { 55 | t.ok(ci('bitcoin'), 'should return coin info') 56 | t.end() 57 | }) 58 | 59 | t.end() 60 | }) 61 | 62 | t.test('> when coin not found', function (t) { 63 | var info = ci('XXX') 64 | t.equal(info, null, 'should return null') 65 | t.end() 66 | }) 67 | 68 | t.test('> when accessing through property', function (t) { 69 | var bitcoin = ci.bitcoin 70 | t.equal(bitcoin.main.versions.public, 0) 71 | t.equal(bitcoin.test.versions.public, 0x6f) 72 | t.end() 73 | }) 74 | 75 | t.test('toBitcoinJS()', function (t) { 76 | var bitcoin = ci.bitcoin.main 77 | var bjsBitcoin = bitcoin.toBitcoinJS() 78 | t.equal(bjsBitcoin.wif, 0x80, 'should return a compatible bitcoinjs-lib') 79 | t.equal(bjsBitcoin.bech32, 'bc', 'object has bech32 prefix') 80 | t.end() 81 | }) 82 | 83 | t.test('toBitcore()', function (t) { 84 | // should return a compatible Bitpay bitcore 85 | var bitcoin = ci.bitcoin.main 86 | var bjsBitcore = bitcoin.toBitcore() 87 | t.equal(bjsBitcore.privatekey, 0x80) 88 | t.equal(bjsBitcore.networkMagic, 0xf9beb4d9) 89 | t.true(bjsBitcore.dnsSeeds.length > 0) 90 | t.end() 91 | }) 92 | 93 | t.end() 94 | }) 95 | --------------------------------------------------------------------------------