Mod sign WebauthN
Register credential sequence
Signature validation sequence
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
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
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
ModSignWebauthn
WorksRegistration:
Users register their devices, generating a public-private key pair. The
register
method stores the public key and the credential ID on the blockchain, linking them to the user's account.
Signature Validation:
When a transaction is signed using WebAuthn, the
is_valid_signature
method 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.
Last updated