Mod sign WebauthN
Register credential sequence
Section titled “Register credential sequence”Signature validation sequence
Section titled “Signature validation sequence”Overview
Section titled “Overview”ModSignWebauthn is a module within the Veive protocol that introduces the WebAuthn standard for signing transactions. WebAuthn, part of the FIDO2 project, enables strong authentication using public key cryptography. This module allows users to register their devices and authenticate using passkeys, enhancing security and usability.
Purpose
Section titled “Purpose”WebAuthn is a web standard for secure authentication, using devices like security keys, smartphones, or built-in platform authenticators (like Windows Hello or Touch ID). Passkeys are the credentials generated during the registration process, comprising a public-private key pair. The public key is stored on the server (or, in this case, on the blockchain), while the private key remains securely on the user’s device.
Key Components in WebAuthn
Section titled “Key Components in WebAuthn”- Credential ID: A unique identifier for each registered credential, used to retrieve the public key associated with a user.
- Public Key: The public portion of the key pair, used by the server to verify signatures created by the private key.
- Authenticator Data: Information provided by the authenticator, including the signature.
How ModSignWebauthn Works
Section titled “How ModSignWebauthn Works”- Registration:
- Users register their devices, generating a public-private key pair. The
registermethod stores the public key and the credential ID on the blockchain, linking them to the user’s account.
- Users register their devices, generating a public-private key pair. The
- Signature Validation:
- When a transaction is signed using WebAuthn, the
is_valid_signaturemethod is called to validate the signature. This method checks if the signature is valid by:- Decoding the transaction’s signature data to extract the
credential_id,authenticator_data, andclient_data. - Retrieving the stored public key using the
credential_id. - Verifying the signature against the extracted message using the public key.
- Decoding the transaction’s signature data to extract the
- When a transaction is signed using WebAuthn, the