<p>You can bech32 decode an address to check the address in raw form (for a given payment address, assume first 58 chars will be the same).</p>
<p>Thus:</p>
<pre><code>echo addr1q8hsff3uwtphx7dtya7unjwjwug52e5jvqp09je6pwqx8k4jvuxrw2x5rr7e258a33yzkrhhlrrc5ezvd2z7qtdq0gasme44c9 | bech32 | cut -b -58
# 01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da
</code></pre>
<p>Now, to &quot;query a chain&quot; , let's assume you're using <code>dbsync</code>. You would be able to query tx_out table for all values in <code>address_raw</code> field that start with <code>01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da</code> as below:</p>
<pre><code>select address_raw from tx_out where ENCODE(address_raw,'hex') LIKE '01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da%';

#                                                      address_raw
# ----------------------------------------------------------------------------------------------------------------------
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
# (14 rows)
# 
# Time: 10639.159 ms (00:10.639)
# 
</code></pre>
<p>PS: Note that this is a list of all <em><strong>used</strong></em> addresses on chain that use the mentioned payment key (as ofcourse - just creating an address can have unlimited possibilities off-chain).</p>

CC BY-SA 4.0
2022-03-09T23:00:26.610Z
2022-03-09T23:00:26.610Z
RdLrT
<p>It sounds like you want to do the opposite of what's done purposely.
Usually you can query multiple addresses associated with the same stake key.</p>
<p>In any case, what you described might be possible. So far I've tested creating different addresses using different stake keys and 1 single payment key.</p>
<p>Last part that is partially unknown to me is querying addresses by public key hash. You can generate the pubkeyhash of your payment address and I noticed that that information pops up in both addresses but Im currently unsure if there is a way to do a query by pubkeyhash.</p>
<p>These 2 addresses were created with the different stake keys. I didnt register the stake keys but you can see that the first half of the hash below the addresses are the same.</p>
<ul>
<li>addr1q9z5hhekqyyxlwqdgv2j3u58dk0678z0wkatvd02v6v2dr5s70tn8q48pzvv6dnxz5ha224x2ptkapxas7x0y08dxeesgudlpu</li>
</ul>
<p><a href="https://cardanoscan.io/address/01454bdf3601086fb80d431528f2876d9faf1c4f75bab635ea6698a68e90f3d73382a70898cd3666152fd52aa650576e84dd878cf23ced3673" rel="nofollow noreferrer">view on cardanoscan</a></p>
<ul>
<li>addr1q9z5hhekqyyxlwqdgv2j3u58dk0678z0wkatvd02v6v2drkysuuv8huyu7q3k7e7mxdgkvjm4ftg7n5dm358jw0ngyeq9jl7z8</li>
</ul>
<p><a href="https://cardanoscan.io/address/01454bdf3601086fb80d431528f2876d9faf1c4f75bab635ea6698a68ec48738c3df84e7811b7b3ed99a8b325baa568f4e8ddc687939f34132" rel="nofollow noreferrer">view on cardanoscan</a></p>

CC BY-SA 4.0
2022-03-08T15:41:56.663Z
In your example, you already suspect two addresses as sharing the same payment key (prior knowledge) because you created them. I am wondering more along the lines of querying the chain for any and all addresses constructed from a given payment key, without already having a list of potential addresses.
zhekson
CC BY-SA 4.0
2022-03-07T22:08:35.840Z
2022-03-07T22:08:35.840Z
christobear
<p>Say I generate 10 stake key pairs and 1 payment key pair. Then, I generate 10 unique shelley addresses accordingly (same payment key pair for all 10, but different staking keys).</p>
<p>Is it possible to correlate those addresses as having one owner (or, is it possible to link them all as being constructed from the same payment key pair?).</p>
<p>If so, how would one go about linking the addresses? (I assume there would be some kind of cardano-db-sync query that can do this).</p>

<wallet><private-key><public-key>
Is it possible to link multiple addresses built from different stake key pairs but one payment key pair?
# Is it possible to link multiple addresses built from different stake key pairs but one payment key pair?

(Asked by: username_0 on 2022-02-25)

Say I generate 10 stake key pairs and 1 payment key pair. Then, I generate 10 unique shelley addresses accordingly (same payment key pair for all 10, but different staking keys).

Is it possible to correlate those addresses as having one owner (or, is it possible to link them all as being constructed from the same payment key pair?).

If so, how would one go about linking the addresses? (I assume there would be some kind of cardano-db-sync query that can do this).

**Tags:** wallet, private-key, public-key

---

## 2 answers

### Answer by username_1 on 2022-03-09. Score: 1 | Accepted answer

You can bech32 decode an address to check the address in raw form (for a given payment address, assume first 58 chars will be the same).
Thus:
echo addr1q8hsff3uwtphx7dtya7unjwjwug52e5jvqp09je6pwqx8k4jvuxrw2x5rr7e258a33yzkrhhlrrc5ezvd2z7qtdq0gasme44c9 | bech32 | cut -b -58
# 01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da

Now, to "query a chain" , let's assume you're using dbsync. You would be able to query tx_out table for all values in address_raw field that start with 01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da as below:
select address_raw from tx_out where ENCODE(address_raw,'hex') LIKE '01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063da%';

#                                                      address_raw
# ----------------------------------------------------------------------------------------------------------------------
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
#  \x01ef04a63c72c37379ab277dc9c9d277114566926002f2cb3a0b8063dab2670c3728d418fd9550fd8c482b0ef7f8c78a644c6a85e02da07a3b
# (14 rows)
# 
# Time: 10639.159 ms (00:10.639)
# 

PS: Note that this is a list of all used addresses on chain that use the mentioned payment key (as ofcourse - just creating an address can have unlimited possibilities off-chain).


---

### Answer by username_2 on 2022-03-07. Score: 0

It sounds like you want to do the opposite of what's done purposely.
Usually you can query multiple addresses associated with the same stake key.

In any case, what you described might be possible. So far I've tested creating different addresses using different stake keys and 1 single payment key.

Last part that is partially unknown to me is querying addresses by public key hash. You can generate the pubkeyhash of your payment address and I noticed that that information pops up in both addresses but Im currently unsure if there is a way to do a query by pubkeyhash.

These 2 addresses were created with the different stake keys. I didnt register the stake keys but you can see that the first half of the hash below the addresses are the same.

* addr1q9z5hhekqyyxlwqdgv2j3u58dk0678z0wkatvd02v6v2dr5s70tn8q48pzvv6dnxz5ha224x2ptkapxas7x0y08dxeesgudlpu

[view on cardanoscan](https://cardanoscan.io/address/01454bdf3601086fb80d431528f2876d9faf1c4f75bab635ea6698a68e90f3d73382a70898cd3666152fd52aa650576e84dd878cf23ced3673)

* addr1q9z5hhekqyyxlwqdgv2j3u58dk0678z0wkatvd02v6v2drkysuuv8huyu7q3k7e7mxdgkvjm4ftg7n5dm358jw0ngyeq9jl7z8

[view on cardanoscan](https://cardanoscan.io/address/01454bdf3601086fb80d431528f2876d9faf1c4f75bab635ea6698a68ec48738c3df84e7811b7b3ed99a8b325baa568f4e8ddc687939f34132)

> **Comments:**
> **username_0**: In your example, you already suspect two addresses as sharing the same payment key (prior knowledge) because you created them. I am wondering more along the lines of querying the chain for any and all addresses constructed from a given payment key, without already having a list of potential addresses.  

---

