# How to know if I connect to ledger or seed phrase account?

**URL:** <https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618>\
**Category:** Cardano Integration\
**Tags:** wallet, ledger\
**Created:** [3 September 2023 13:36 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618 "2023-09-03T13:36:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [3 September 2023 13:36 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/1 "2023-09-03T13:36:13Z")

</div>

Hello, everybody.  
How are you?  
I am integrating wallet connect for my dApp.  
And I want to allow users to connect with their ledger wallet and seed phrase wallet.  
But the ones who use ledger wallet got error message when they meet signData() function.  
It seems like cardano ledger don’t support signData() api.

Is there any way to check if I was connected to ledger wallet or seed phrase account?

Thank you.

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [3 September 2023 13:59 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/2 "2023-09-03T13:59:49Z")

</div>

Not from the dApp side as far as I can see. You just get addresses and UTxOs and they don’t contain the information how they were derived at all.

You could just implement a login mechanism that works with Ledgers and use it for _all_ logins, seed phrase or hardware (Trezor _also_ does not allow `signData`).

One candidate for such a login that works with Ledgers is letting the users sign a transaction (but never submit it) and check the signature of that transaction. Hardware as well as seed phrase wallets perfectly allow that.

Can be made more elegant by using inputs and outputs on the zero address [addr1vyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkdl5mw](https://adastat.net/addresses/addr1vyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkdl5mw) so that users _see_ that what they are signing has zero effect on their wallet, just requiring a signature from the stake key, giving a [CIP 20](https://cips.cardano.org/cips/cip20/) message explaining what is going on, setting an `invalid-hereafter` in the past, …

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 02:48 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/3 "2023-09-07T02:48:40Z")

</div>

Oh, thanks for your reply.  
So you mean, we can’t detect whether users connect their wallet from seed phrase account or ledger account on dApps like Jpg.store?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [7 September 2023 02:56 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/4 "2023-09-07T02:56:08Z")

</div>

> [@Eagering\_Dev](#):
>
> So you mean, we can’t detect whether users connect their wallet from seed phrase account or ledger account on dApps like Jpg.store?

Yes, you can’t detect.

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 03:19 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/5 "2023-09-07T03:19:57Z")

</div>

So with ledger connected, then how can we verify them (their stakeaddress like signData do)?

By the way, can we discuss on Discord? Since that is much faster.

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [7 September 2023 03:24 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/6 "2023-09-07T03:24:43Z")

</div>

> [@Eagering\_Dev](#):
>
> So with ledger connected, then how can we verify them (their stakeaddress like signData do)?

??? I already answered that:

> [@HeptaSean](#):
>
> One candidate for such a login that works with Ledgers is letting the users sign a transaction (but never submit it) and check the signature of that transaction. Hardware as well as seed phrase wallets perfectly allow that.

> [@Eagering\_Dev](#):
>
> By the way, can we discuss on Discord? Since that is much faster.

I’d honestly prefer not to. Sorry! Here, others could jump in if they have better answers and/or more time to answer at the moment. And others can also find it if they have the same question in the future.

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 03:25 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/7 "2023-09-07T03:25:43Z")

</div>

> [@HeptaSean](#):
>
> I’d honestly prefer not to. Sorry! Here, others could jump in if they have better answers and/or more time to answer at the moment. And others can also find it if they have the same question in the future.

Yeah, this is good for community

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 03:28 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/8 "2023-09-07T03:28:00Z")

</div>

> [@HeptaSean](#):
>
> One candidate for such a login that works with Ledgers is letting the users sign a transaction (but never submit it) and check the signature of that transaction. Hardware as well as seed phrase wallets perfectly allow that.

So we will let them signTx() right?  
And can we show them some kinda text description (the explanation what is this for) when they signTx()?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [7 September 2023 03:38 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/9 "2023-09-07T03:38:01Z")

</div>

> [@Eagering\_Dev](#):
>
> So we will let them signTx() right?

Yes.

> [@Eagering\_Dev](#):
>
> And can we show them some kinda text description (the explanation what is this for) when they signTx()?

> [@HeptaSean](#):
>
> giving a [CIP 20](https://cips.cardano.org/cips/cip20/) message explaining what is going on,

One site that does it like that is: [https://www.equine.gg/](https://www.equine.gg/)

Let’s you sign such a transaction:

 ![screenshot-2023-09-07-05:32:13](https://us1.discourse-cdn.com/flex023/uploads/cardano/original/3X/c/6/c627db44a3ff088e3c4bc1c1450ed3de5fca48f8.png)  
So, the message what is going on _is_ there, but you first have to expand the metadata. And it’s one or more clicks deep in all wallet apps that I tested.

You probably want to _additionally_ just explain it on your “Connect Wallet” pop-up (where you have complete control of the content and presentation).

And: As also said in the first answer: I would try to let the output _also_ go to the zero address, so that the effect is zero, and the user is not irritated by signing a transaction, where they should get funds, but they then never arrive.

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 03:54 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/10 "2023-09-07T03:54:04Z")

</div>

And we do this using lucid-cardano module?  
Can you help me with some code snippets please?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [7 September 2023 04:14 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/11 "2023-09-07T04:14:31Z")

</div>

> [@Eagering\_Dev](#):
>
> And we do this using lucid-cardano module?

You should be able to do it with any transaction building library you choose.

> [@Eagering\_Dev](#):
>
> Can you help me with some code snippets please?

Sorry, don’t have one ready (and unfortunately no time to create you one now).

You’d have to create a transaction with inputs and outputs on the zero address (you can just use that same input that Equine uses above, it’s on the zero address, it can never vanish) and the stake key hash of the user as required signer.

Lucid unfortunately does not seem to have a comprehensive API description. If it does not have that functionality itself, it states on [https://lucid.spacebudz.io/docs/advanced/cml/](https://lucid.spacebudz.io/docs/advanced/cml/) that you can always resort to going through to CML (which in turn doesn’t really seem to have comprehensive documentation _sigh_).

But CML is a fork of CSL (which also does not have a really nice API description, but at least points to the “Flow file” listing all methods available). The transaction body should offer this:

> <https://github.com/Emurgo/cardano-serialization-lib/blob/master/rust/pkg/cardano_serialization_lib.js.flow#L8208-L8211>

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 04:30 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/12 "2023-09-07T04:30:04Z")

</div>

Thanks. Let me try this one

---

<div class="post-metadata">

**Author:** ![Eagering\_Dev](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/eagering_dev/32/70067_2.png) [@Eagering\_Dev](https://forum.cardano.org/u/Eagering_Dev)\
**Post date:** [7 September 2023 13:50 UTC](https://forum.cardano.org/t/how-to-know-if-i-connect-to-ledger-or-seed-phrase-account/121618/13 "2023-09-07T13:50:40Z")

</div>

I made that kind of transaction with zero address thanks for you help.  
But how to verify it?

I am trying to verify the signed transaction.I verify the signed message (cip08) using

> @emurgo/cardano-serialization-lib-nodejs @emurgo/cardano-message-signing-nodejs

But it didn’t work same with the signed Transaction hex. I got error like this

> Deserialization failed in TransactionWitnessSet because: Invalid cbor: not the right type, expected `Map' byte received ` Array’.
