<p>I guess I've found the answer as explained in bip43</p>

<p>m / purpose' / *
Apostrophe indicates that BIP32 hardened derivation is used.</p>

<p>We encourage different schemes to apply for assigning a separate BIP number and use the same number for purpose field, so addresses won't be generated from overlapping BIP32 spaces.</p>

<p>Example: Scheme described in BIP44 should use 44' (or 0x8000002C) as purpose.</p>

<p>Note that m / 0' / * is already taken by BIP32 (default account), which preceded this BIP.</p>

<p>Not all wallets may want to support the full range of features and possibilities described in these BIPs. Instead of choosing arbitrary subset of defined features and calling themselves BIPxx compatible, we suggest that software which needs only a limited structure should describe such structure in another BIP and use different "purpose" value.</p>

CC BY-SA 3.0
2018-01-21T09:27:38.267Z
2018-01-21T09:27:38.267Z
Tailer
<p>I have generated a private key using my master seed private key.</p>

<p>PHP Code:</p>

<pre><code> $bip44 = HierarchicalKeyFactory::fromExtended($result['masterPrivKey']);

$publicKey = $bip44-&gt;derivePath("m/44'/0'/0'")-&gt;toExtendedPublicKey();
</code></pre>

<p>Now using the public key</p>

<pre><code>    $masterkey = HierarchicalKeyFactory::fromExtended($publicKey);

    $result['address'] = $masterkey-&gt;derivePath("m/0/1")-&gt;getPublicKey()-&gt;getAddress()-&gt;getAddress();
</code></pre>

<p>Should I just change 0 in the middle <code>m/0/1</code> to 1 to get change address?</p>

<address-generation><php><change><bip44>
how to get change address using derived BIP44 publicKey?
Tailer
# how to get change address using derived BIP44 publicKey?

(Asked by: username_0 on 2018-01-21)

I have generated a private key using my master seed private key.

PHP Code:

```
 $bip44 = HierarchicalKeyFactory::fromExtended($result['masterPrivKey']);

$publicKey = $bip44->derivePath("m/44'/0'/0'")->toExtendedPublicKey();

```

Now using the public key

```
    $masterkey = HierarchicalKeyFactory::fromExtended($publicKey);

    $result['address'] = $masterkey->derivePath("m/0/1")->getPublicKey()->getAddress()->getAddress();

```

Should I just change 0 in the middle `m/0/1` to 1 to get change address?

**Tags:** address-generation, php, change, bip44


---

## 1 answers

### Answer by username_0 on 2018-01-21. Score: 1

I guess I've found the answer as explained in bip43

m / purpose' / \*
Apostrophe indicates that BIP32 hardened derivation is used.

We encourage different schemes to apply for assigning a separate BIP number and use the same number for purpose field, so addresses won't be generated from overlapping BIP32 spaces.

Example: Scheme described in BIP44 should use 44' (or 0x8000002C) as purpose.

Note that m / 0' / \* is already taken by BIP32 (default account), which preceded this BIP.

Not all wallets may want to support the full range of features and possibilities described in these BIPs. Instead of choosing arbitrary subset of defined features and calling themselves BIPxx compatible, we suggest that software which needs only a limited structure should describe such structure in another BIP and use different "purpose" value.


---

