Generating Address Using Bitcoinjslib Or Bitcoincore Libraries

Discussion in 'Addresses' started by Agent725, Nov 5, 2018.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. Agent725

    Agent725 New Member

    Nov 5, 2018
    1
    0
    Netherlands
    Hi Decredders,

    At the moment I am working on adding support for Decred to the Internet of Coins project. However, I have used the BitcoinJSlib and Bitcore-lib forks from the Decred Github to do this.

    Both generate addresses, but these look like they are for Bitcoin. Example: 1L6k6njMwRMGvMmuTLYKwVx9sLXfFdgzp9

    When replacing the network.js settings somehow the libraries report Invalid Network. However, I cannot figure out what I should use to fix this. Can you give me a hint?


    Right now for Bitcore-lib I have:
    Code:
    addNetwork({
      name: 'livenet',
      alias: 'mainnet',
      pubkeyhash: 0x073f,
      privatekey: 0x22de,
      scripthash: 0x071a,
      xpubkey: 0x02fda926,
      xprivkey: 0x02fda4e8,
      networkMagic: 0xf900b4d9,
      port: 9108,
      dnsSeeds: [
        'mainnet-seed.decred.mindcry.org',
        'mainnet-seed.decred.netpurgatory.com',
        'mainnet.decredseed.org',
        'mainnet-seed.decred.org'
      ]
    });
    

    For BitcoinJSlib I have:
    Code:
    module.exports = {
      bitcoin: {
        messagePrefix: '\x18Bitcoin Signed Message:\n',
        bip32: {
          public: 0x0488b21e,
          private: 0x0488ade4
        },
        pubKeyHash: 0x00,
        scriptHash: 0x05,
        wif: 0x80
      },
      decred: {
        messagePrefix: '\x19Decred Signed Message:\n',
        bip32: {
          public: 0x02fda926,
          private: 0x02fda4e8
        },
        pubkeyHash: 0x073f,
        scriptHash: 0x071a,
        wif: 0x22de
      }
    }
    
     

Share This Page