user85150: I want to create bitcoin address from extended public key, without exposing private key but did not get any success till now. Do someone know how to do it? I am using bitcore-lib package

user60443: According to BIP32 you're trying to generate a non-hardened child address, see BIP32 - Public parent key → public child key.
Using bitcore-lib, to derive a non-hardened child public key and a P2PKH address:
var bitcore = require('bitcore-lib');
var Address = bitcore.Address;
var PublicKey = bitcore.PublicKey;
var Networks = bitcore.Networks;

var hdPublickey = new bitcore.HDPublicKey('tpubD6NzVbkrYhZ4XLMmry7XriYJ6Xgx1vQqoUZHLUXQPDB32n7pQYaWSMpRttm2sHzYjsQqrsAZYyJCmoEJB51oSdqZxq7epGjP4vHriCYz7Tp');
var orderPublickey = hdPublickey.deriveChild("m/44/145/0/0");
var pubkey = new PublicKey(orderPublickey.publicKey);
var address = Address.fromPublicKey(pubkey, Networks.testnet);
console.log("address", address);

Returns:
address <Address: mkVBk6gZ7rBLYXvpdcKwTEq6SjHvSeLwZ8, type: pubkeyhash, network: testnet>

85150: <p>I want to create bitcoin address from extended public key, without exposing private key but did not get any success till now. Do someone know how to do it? I am using bitcore-lib package</p>
 60443: <p>According to BIP32 you're trying to generate a non-hardened child address, see <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#public-parent-key--public-child-key" rel="nofollow noreferrer">BIP32 - Public parent key → public child key</a>.</p>

<p>Using bitcore-lib, to derive a non-hardened child public key and a P2PKH address:</p>

<pre><code>var bitcore = require('bitcore-lib');
var Address = bitcore.Address;
var PublicKey = bitcore.PublicKey;
var Networks = bitcore.Networks;

var hdPublickey = new bitcore.HDPublicKey('tpubD6NzVbkrYhZ4XLMmry7XriYJ6Xgx1vQqoUZHLUXQPDB32n7pQYaWSMpRttm2sHzYjsQqrsAZYyJCmoEJB51oSdqZxq7epGjP4vHriCYz7Tp');
var orderPublickey = hdPublickey.deriveChild("m/44/145/0/0");
var pubkey = new PublicKey(orderPublickey.publicKey);
var address = Address.fromPublicKey(pubkey, Networks.testnet);
console.log("address", address);
</code></pre>

<p>Returns:<br>
<code>address &lt;Address: mkVBk6gZ7rBLYXvpdcKwTEq6SjHvSeLwZ8, type: pubkeyhash, network: testnet&gt;</code></p>
