<p>Following is my code:</p>
<pre><code>const bip39 = require(&quot;bip39&quot;);
var HDKey = require('hdkey');
var bip32 = require(&quot;bip32&quot;);
var bitcoin = require('bitcore-lib');
var EthereumBip44 = require('ethereum-bip44');
const secp256k1 = require('secp256k1')
var sha256 = require(&quot;sha256&quot;)

var mnemonic = bip39.generateMnemonic()
var seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex');
var hdkey = HDKey.fromMasterSeed(seed);
var HDkey = hdkey.privateExtendedKey
var node = bip32.fromBase58(HDkey)
var child = node.derivePath(&quot;m/44'/0'/0'/0/0&quot;);
bitcoinKey = child.toWIF();
var key = bitcoin.HDPrivateKey(HDkey);
var wallet = new EthereumBip44(key);
var ethereumKey = wallet.getPrivateKey(0).toString('hex')
console.log('PK: %s',ethereumKey)
var re = secp256k1.publicKeyCreate(Buffer.from(ethereumKey,&quot;hex&quot;), false).slice(1)
var cicAddress = &quot;cx&quot;+sha256(&quot;0x&quot;+re.toString(&quot;hex&quot;)).substr(24,64)
console.log('Public key: %s',re);
console.log('CIC Address: %s',cicAddress)
</code></pre>
<blockquote>
<p>This gives me following output:</p>
<p>Seed:
3eef6daf3a65b84448a699837a476033a792f413041d080da2a18a77f462cd9a2f76ca4e922dfb8de0d2817a3b092a098d7f335993a0554e3e997e1eab22daaa</p>
<p>PK: f4c06b254d5ac46b6db9baf0fbdfb4b58aa392002f0808d54dfd3ceed5697967
�*x��� key: c�b�!��^�Q �����͇R��9��2$7K�+��)m����g�K5�Ǽ=]��e�����m CIC
Address: cxb2d307b96327e2e535a52f93c23751417520398d</p>
</blockquote>
<p>Why the public key is getting generated symbollically? How can I solve this?</p>

CC BY-SA 4.0
2019-06-14T14:42:25.850Z
This seems like a basic programming question, rather than something Bitcoin related. You'll need a function to turn the public key object into something human readable. One way of doing so is already on the line above: `re.toString("hex")`.
Pieter Wuille
CC BY-SA 4.0
2019-06-15T05:33:38.667Z
Thanx @Pieter Wuille for the comment. It gives expected output.
Varsh
<public-key><address-generation><mnemonic-seed><node.js><secp256k1>
secp256k1.publicKeyCreate generating symbollic key
Varsh
# secp256k1.publicKeyCreate generating symbollic key

(Asked by: username_0 on 2019-06-14)

Following is my code:

```
const bip39 = require("bip39");
var HDKey = require('hdkey');
var bip32 = require("bip32");
var bitcoin = require('bitcore-lib');
var EthereumBip44 = require('ethereum-bip44');
const secp256k1 = require('secp256k1')
var sha256 = require("sha256")

var mnemonic = bip39.generateMnemonic()
var seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex');
var hdkey = HDKey.fromMasterSeed(seed);
var HDkey = hdkey.privateExtendedKey
var node = bip32.fromBase58(HDkey)
var child = node.derivePath("m/44'/0'/0'/0/0");
bitcoinKey = child.toWIF();
var key = bitcoin.HDPrivateKey(HDkey);
var wallet = new EthereumBip44(key);
var ethereumKey = wallet.getPrivateKey(0).toString('hex')
console.log('PK: %s',ethereumKey)
var re = secp256k1.publicKeyCreate(Buffer.from(ethereumKey,"hex"), false).slice(1)
var cicAddress = "cx"+sha256("0x"+re.toString("hex")).substr(24,64)
console.log('Public key: %s',re);
console.log('CIC Address: %s',cicAddress)

```

> This gives me following output:
>
> Seed:
> 3eef6daf3a65b84448a699837a476033a792f413041d080da2a18a77f462cd9a2f76ca4e922dfb8de0d2817a3b092a098d7f335993a0554e3e997e1eab22daaa
>
> PK: f4c06b254d5ac46b6db9baf0fbdfb4b58aa392002f0808d54dfd3ceed5697967
> �\*x��� key: c�b�!��^�Q �����͇R��9��2$7K�+��)m����g�K5�Ǽ=]��e�����m CIC
> Address: cxb2d307b96327e2e535a52f93c23751417520398d

Why the public key is getting generated symbollically? How can I solve this?

**Tags:** public-key, address-generation, mnemonic-seed, node.js, secp256k1

> **Comments:**
> **username_1**: This seems like a basic programming question, rather than something Bitcoin related. You'll need a function to turn the public key object into something human readable. One way of doing so is already on the line above: `re.toString("hex")`.  
> **username_0**: Thanx @username_1 for the comment. It gives expected output.  

---

## 0 answers

