<p>will wait for message sign / verify gets added to cardano-wallet api itself ,
<a href="https://github.com/input-output-hk/cardano-wallet/issues/3537" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-wallet/issues/3537</a>
implementing it from scratch or doing other hacky ways will be inconvenient.</p>

CC BY-SA 4.0
2022-10-18T16:40:22.843Z
2022-10-18T16:40:22.843Z
Nabil
<p>If your game is not browser based, one way to do this is to create a small website on which you let the user sign a message with a browser based wallet. The website can then send the signed message to your server.</p>
<p>To do this you can use the <a href="https://cips.cardano.org/cips/cip30/#apisigndataaddraddresspayloadbytespromisedatasignature" rel="nofollow noreferrer">signData() method as specified in CIP-30</a>.</p>
<p>Or if you have the private key of the user's wallet in your game, you can sign a message in your game and send it to the server.</p>
<p>On your server, you have to verify that the message is signed correctly. You can do this using the <a href="https://developers.cardano.org/docs/get-started/cardano-serialization-lib/overview/" rel="nofollow noreferrer">cardano-serialization-lib</a>. More details on message signing can be found in <a href="https://cips.cardano.org/cips/cip8/" rel="nofollow noreferrer">CIP-8</a>.</p>
<p>If the message is signed correctly, you can return something like an access token (e.g. a <a href="https://jwt.io" rel="nofollow noreferrer">JWT</a>) to the user.</p>
<hr />
<p>This is a very simple example on how this could work and there are a lot of things you'd need to consider when you implement this like franken-address attacks or token lifetimes etc.</p>

CC BY-SA 4.0
2022-10-18T16:37:38.363Z
Thank you for your suggestion , i was looking for a way that wont force the user to leave the game or get interrupted from his virtual experience ( could be VR , PS5 , anywhere.. ) . https://github.com/input-output-hk/cardano-wallet/issues/3537 having the message sign-in / verify added to the cardano-wallet api itself , would do the trick. happpy to wait for that .
Nabil
CC BY-SA 4.0
2022-10-17T12:28:17.050Z
2022-10-17T12:28:17.050Z
eddex
<p>i have built an in game User interface around Cardano-wallet.
now im looking for a way to let the player sign in using his wallet .</p>
<p>how can i approach it using cardano-wallet?
is there a way to let the player sign some data using his private key , then on the server side i decode it using his public key ?</p>
<p>( one of the solutions i tried is to let the player send 1 ADA from his wallet to a server provided address , and i monitor the transaction to verify ... but bad approach obviously ..)</p>
<p>thank you for your attention.
<a href="https://i.sstatic.net/9QHVz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9QHVz.png" alt="enter image description here" /></a></p>

<wallet>
Using cardano-wallet for ingame sign in
# Using cardano-wallet for ingame sign in

(Asked by: username_0 on 2022-10-15)

i have built an in game User interface around Cardano-wallet.
now im looking for a way to let the player sign in using his wallet .

how can i approach it using cardano-wallet?
is there a way to let the player sign some data using his private key , then on the server side i decode it using his public key ?

( one of the solutions i tried is to let the player send 1 ADA from his wallet to a server provided address , and i monitor the transaction to verify ... but bad approach obviously ..)

thank you for your attention.
[![enter image description here](https://i.sstatic.net/9QHVz.png)](https://i.sstatic.net/9QHVz.png)

**Tags:** wallet

---

## 2 answers

### Answer by username_0 on 2022-10-18. Score: 1

will wait for message sign / verify gets added to cardano-wallet api itself ,
<https://github.com/input-output-hk/cardano-wallet/issues/3537>
implementing it from scratch or doing other hacky ways will be inconvenient.


---

### Answer by username_1 on 2022-10-17. Score: 0

If your game is not browser based, one way to do this is to create a small website on which you let the user sign a message with a browser based wallet. The website can then send the signed message to your server.

To do this you can use the [signData() method as specified in CIP-30](https://cips.cardano.org/cips/cip30/#apisigndataaddraddresspayloadbytespromisedatasignature).

Or if you have the private key of the user's wallet in your game, you can sign a message in your game and send it to the server.

On your server, you have to verify that the message is signed correctly. You can do this using the [cardano-serialization-lib](https://developers.cardano.org/docs/get-started/cardano-serialization-lib/overview/). More details on message signing can be found in [CIP-8](https://cips.cardano.org/cips/cip8/).

If the message is signed correctly, you can return something like an access token (e.g. a [JWT](https://jwt.io)) to the user.

---

This is a very simple example on how this could work and there are a lot of things you'd need to consider when you implement this like franken-address attacks or token lifetimes etc.

> **Comments:**
> **username_0**: Thank you for your suggestion , i was looking for a way that wont force the user to leave the game or get interrupted from his virtual experience ( could be VR , PS5 , anywhere.. ) . https://github.com/input-output-hk/cardano-wallet/issues/3537 having the message sign-in / verify added to the cardano-wallet api itself , would do the trick. happpy to wait for that .  

---

