# Possible to determine whether principal is internet identity using motoko?

**URL:** <https://forum.dfinity.org/t/possible-to-determine-whether-principal-is-internet-identity-using-motoko/34169>\
**Category:** Developers\
**Created:** [August 14, 2024, 8:04pm UTC](https://forum.dfinity.org/t/possible-to-determine-whether-principal-is-internet-identity-using-motoko/34169 "2024-08-14T20:04:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iceypee](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iceypee/32/5362_2.png) [@Iceypee](https://forum.dfinity.org/u/Iceypee)\
**Post date:** [August 14, 2024, 8:04pm UTC](https://forum.dfinity.org/t/possible-to-determine-whether-principal-is-internet-identity-using-motoko/34169/1 "2024-08-14T20:04:59Z")

</div>

Is it possible to determine whether principal is internet identity from a canister? Any example code as well (motoko specifically)?

---

<div class="post-metadata">

**Author:** ![frederikrothenberger](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/frederikrothenberger/32/3826_2.png) [@frederikrothenberger](https://forum.dfinity.org/u/frederikrothenberger)\
**Post date:** [August 15, 2024, 8:19am UTC](https://forum.dfinity.org/t/possible-to-determine-whether-principal-is-internet-identity-using-motoko/34169/2 "2024-08-15T08:19:32Z")

</div>

Hi @Iceypee

It is not possible to determine from a principal if it belongs to Internet Identity. However, you could send along the delegation public key which contains the II canister id as per [specification](https://internetcomputer.org/docs/current/references/ic-interface-spec/#canister-signatures).

Unfortunately, I don’t have a Motoko example at hand that shows how to do that. But here is some Rust code that shows how to extract the canister id from the public key: [ic-canister-sig-creation/src/lib.rs at bb1bf7c4114190b1b754a85847d1a7040358184d · dfinity/ic-canister-sig-creation · GitHub](https://github.com/dfinity/ic-canister-sig-creation/blob/bb1bf7c4114190b1b754a85847d1a7040358184d/src/lib.rs#L42)

I hope this helps.
