<p>The reason for the return type to be an array is <a href="https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0018/" rel="nofollow noreferrer">CIP-18</a> (while it is not implemented yet, it is already taken into account in the web wallet bridge specification <a href="https://cips.cardano.org/cips/cip30/#apigetrewardaddressespromiseaddress" rel="nofollow noreferrer">CIP-30</a>).</p>
<p>So currently there should not be more than one stake key returned by <code>api.getRewardAddresses()</code>.</p>
<p>However: Have a look at the <a href="https://cardano.stackexchange.com/questions/tagged/mangled-address">mangled-addresses</a> tag to find some more info about possible issues with looking at the stake key to identify ownership of NFTs. In short: Just because a wallet controls an address doesn't mean that it is the owner of the stake key part of the address.</p>

CC BY-SA 4.0
2023-07-12T15:56:57.453Z
Thanks for the help!
0x6f6b
CC BY-SA 4.0
2023-07-12T13:08:49.333Z
2023-07-12T13:14:19.513Z
2023-07-12T13:14:19.513Z
eddex
<p>The Cardano dApp-Wallet Web Bridge exposes an <code>api.getRewardAddresses()</code> function. This resolves to an array of stake keys, but I have only seen it contain one stake key in practice.</p>
<p>I'm developing a web app and want to store information about users' owned NFTs in a database. Can I use the first element in the stake keys/reward addresses array to identify the user, or should I show a dialogue window that allows the user to choose one? I am not aware of how most sites typically handle this.</p>

<wallet><mesh><cip30>
Why does api.getRewardAddresses() return an array and does it matter?
# Why does api.getRewardAddresses() return an array and does it matter?

(Asked by: username_0 on 2023-07-05)

The Cardano dApp-Wallet Web Bridge exposes an `api.getRewardAddresses()` function. This resolves to an array of stake keys, but I have only seen it contain one stake key in practice.

I'm developing a web app and want to store information about users' owned NFTs in a database. Can I use the first element in the stake keys/reward addresses array to identify the user, or should I show a dialogue window that allows the user to choose one? I am not aware of how most sites typically handle this.

**Tags:** wallet, mesh, cip30

---

## 1 answers

### Answer by username_1 on 2023-07-12. Score: 1 | Accepted answer

The reason for the return type to be an array is [CIP-18](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0018/) (while it is not implemented yet, it is already taken into account in the web wallet bridge specification [CIP-30](https://cips.cardano.org/cips/cip30/#apigetrewardaddressespromiseaddress)).

So currently there should not be more than one stake key returned by `api.getRewardAddresses()`.

However: Have a look at the [mangled-addresses](https://cardano.stackexchange.com/questions/tagged/mangled-address) tag to find some more info about possible issues with looking at the stake key to identify ownership of NFTs. In short: Just because a wallet controls an address doesn't mean that it is the owner of the stake key part of the address.

> **Comments:**
> **username_0**: Thanks for the help!  

---

