# Sign-In with Tezos (SIWT)

This documentation section will dive deep into implementing the Sign-in with Tezos(SIWT). For more details about the concept Sign in With X (SIWx), [CAIP-122](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-122.md).

Sign-In with Tezos describes how Tezos accounts authenticate with off-chain services by signing a message parameterized by scope, nonce, etc. It is an alternative to centralized identity providers. It is based on the self-custody of your identity. It leverages the on-chain authentication model to off-chain services.

The reason behind implementing the concept Sign-In with Tezos is that it is a critical step in the Login with NFTs concept. Before granting access to some services based on the ownership of some NFTs, we need to check two main aspects:&#x20;

* You own an account via Sign with Tezos.&#x20;
* Verify that the account has an NFT in a specified collection.

An account in Tezos is linked to the ownership of a private key which is then mapped to his public key. The hash of the public key outputs an address. Depending on the chosen Digital Signature Algorithm's elliptic curve (see ECDSA), the latter starts with "tz1" (Ed25519 curve), "tz2" (Secp256k1 curve), or "tz3" (P256 curve).

The IDP Kit implements SIWT based on seven main steps:&#x20;

1. Nonce generation.
2. Redirection to the IDK Kit wallet user interface.
3. Connect to your Temple wallet.
4. A popup appears for signing the message. It is based on multiple factors like the nonce generated by the IDP Kit, account address, etc.
5. Click the “Sign” button.
6. Redirection to the IDK Kit verification service.
7. The IDP Kit verifies the message signature based on the account address.

The message will be in the form of:

&#x20;{domain} wants you to sign in with your Tezos account: {address}. Public Key: {publicKey}.Date: {ISO8601formatedTimestamp}. {description} URI: {origin}. Version: {versionNumber}. Nonce: {nonce}

* domain: is the RFC 3986 authority that is requesting the signing.&#x20;
* Permissions.address: account address.
* Public Key : account public key.&#x20;
* Date: is the ISO 8601 datetime string of the current time.&#x20;
* Nonce:security parameter generated by the IDP Kit.

<figure><img src="https://4268711888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMYKjHs5DPl5LoaOeHtu%2Fuploads%2FMO3DuHL8SVTiCEqmjVMO%2FTezos%20sign%20a%20message.png?alt=media&#x26;token=cf45a3aa-b073-4cf7-a757-4be070b63095" alt=""><figcaption><p>SIgn-in with Tezos message</p></figcaption></figure>

\
