0083 XLS-83d: Passkey Signature Support #236
Replies: 5 comments 10 replies
-
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I'm curious how this makes it more convenient for users if they still have to store a private key? I'm also curious as to the term unphishable and how it applies here. My keypair, while it could sign other things doesnt really work anywhere else. So is this really a selling point? I do see the idea that they are device specific but also see passkey "syncing" so I'm a bit confused. I'm also extremely concerned with the idea that some are suggesting sharing the keystore between devices. Wow. How is this different or more secure then just storing the private key in the hardware keystore on the mobile device and accessing through biometrics? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
We can only disable the master key if RegulayKey or Multisig (SignerList) is set, but will PasskeyList be added to these? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Proposes adding passkey (WebAuthn) support into the XRP Ledger protocol for enhanced security and user experience.
Abstract
This proposal introduces passkey support to the XRP Ledger by adding the ability to verify signatures created as part of a WebAuthn authentication flow. By allowing users to utilize passkeys for transaction authorization, the XRP Ledger can enhance security, improve user experience, and encourage wider adoption through the use of phishing-resistant authentication.
Motivation
As the XRP Ledger continues to grow, there is a need to improve security and user experience for account access and transaction authorization. Traditional key generation and management can be complex and insecure for end-users, leading to potential loss of funds due to mishandling of secret keys or falling victim to phishing attacks. By integrating passkey support using WebAuthn standards, users can leverage device-bound or syncable credentials (passkeys) for secure, convenient, and phishing-resistant authentication.
Specification
This specification focuses on the ability to handle the signature structure and data fields required by passkey authentication. A separate spec, XLS-84d: Support for ES256 on the P-256 curve in Passkey Signatures, covers cryptographic algorithm support.
Overview
This specification proposes the addition of passkey support to the XRP Ledger by:
Simplified Passkey Signature Implementation
Rationale
Unlike most WebAuthn use cases, the XRP Ledger is a public, permissionless blockchain where security relies on cryptographic signatures proving that a transaction is authorized. To securely integrate passkey (WebAuthn) support into the XRP Ledger, it's essential to align with the WebAuthn specification. This requires including necessary data structures—
AuthenticatorData,ClientDataJSON, andPasskeyID—in transactions. These components ensure that signatures produced by passkeys can be properly verified, maintaining the security and integrity of the ledger.Transaction Format Modifications
Transactions signed using a passkey MUST include the following fields:
SigningPubKey: The public key associated with the passkey credential.PasskeySignature: An object containing the signature and related data necessary for verification.TxnSignature: This field MUST be set to an empty string or omitted when usingPasskeySignature.New Field:
PasskeySignatureThe
PasskeySignaturefield is an object containing the following subfields:PasskeyIDstringBlobAuthenticatorDatastringBlobClientDataJSONstringBlobSignaturestringBlobAlgorithmnumberInt32PasskeyID: The identifier of the credential used for signing, as provided by the authenticator.AuthenticatorData: The raw bytes of the authenticator data returned during the signing process. It contains information from the authenticator about processing a credential creation or authentication request.ClientDataJSON: The JSON-serialized client data used during the signing process.Signature: The digital signature produced by the authenticator. The signature signsauthenticatorData + SHA256(clientDataJSON). The authenticatorData contains a "counter" that increases each time the credential key is used to authenticate.Algorithm: An integer indicating the cryptographic algorithm used by the credential, specified using COSE algorithm identifiers per the WebAuthn specification.Transaction Fields Summary
TransactionTypestringUInt16AccountstringAccountIDSigningPubKeystringBlobPasskeySignatureobjectObjectTxnSignaturePasskeySignatureis presentstringVariableLengthSequencenumberUInt32FeestringAmount...Passkey Registration and Management
New Ledger Entry:
PasskeyListThe
PasskeyListledger entry represents a list of registered passkey credentials associated with an account.Fields
LedgerEntryTypestringUInt16AccountstringAccountIDPasskeysarrayArrayPasskeys Array Elements
Each element in the
Passkeysarray represents a registered passkey credential:PasskeyIDstringBlobPublicKeystringBlobSignCountnumberUInt32AlgorithmnumberInt32Algorithm: An integer indicating the cryptographic algorithm used by the credential, specified using COSE algorithm identifiers per the WebAuthn specification.New Transaction Type:
SetPasskeyListThe
SetPasskeyListtransaction allows an account owner to add or remove passkey credentials from theirPasskeyList.Fields
TransactionTypestringUInt16AccountstringAccountIDPasskeyActionsarrayArrayFeestringAmountSequencenumberUInt32SigningPubKeystringBlobTxnSignaturestringBlobPasskeyActions Array Elements
Each element specifies an action to add or remove a passkey credential:
ActionstringUInt8PasskeyIDstringBlobPublicKeyActionis"add"stringBlobSignCountActionis"add"numberUInt32AlgorithmActionis"add"numberInt32Action: MUST be either"add"or"remove".Account Deletion
The
PasskeyListobject is a deletion blocker. An account cannot be deleted if it has aPasskeyListassociated with it. To delete the account, thePasskeyListmust first be removed by removing all passkey credentials using theSetPasskeyListtransaction.Processing Rules
Actionis"add", the transaction MUST add the provided passkey credential to the account'sPasskeyList.Actionis"remove", the transaction MUST remove the specified credential from thePasskeyList.SetPasskeyListtransaction MUST be signed using the account's master key or an existing authorized signer.Transaction Signing with Passkeys
Modifications to Transaction Validation
When a transaction containing a
PasskeySignatureis submitted, the server MUST perform the following steps:Credential Lookup: Verify that the
PasskeyIDinPasskeySignaturecorresponds to a registered credential in the account'sPasskeyList.Extract Algorithm: Retrieve the
Algorithmassociated with thePasskeyIDfrom thePasskeyList.Reconstruct Client Data Hash: Compute the SHA-256 hash of the
ClientDataJSON.Construct Signed Data: Concatenate
AuthenticatorDataand theClientDataHash.Verify Signature.
Signature Verification: Use the selected algorithm to verify the
Signatureover the concatenated signed data (AuthenticatorData || SHA-256(ClientDataJSON)) using thePublicKey.Failure Handling: If the algorithm is unsupported or the verification fails, the transaction MUST fail with a
temBAD_SIGNATUREerror.Validate Challenge: Ensure that the
challengein theClientDataJSONmatches the expected value (the SHA-256 hash of the serialized transaction blob, excluding theTxnSignatureandPasskeySignaturefields).Prevent Replay Attacks: Compare the
SignCountfromAuthenticatorDatawith the storedSignCountfor the credential. TheSignCountMUST be greater than the stored value. Update the storedSignCountwith the new value.Validate Origin (Optional): Servers MAY verify that the
origininClientDataJSONmatches an expected value to enhance security.Signature Verification Process
The verification MUST follow the WebAuthn Level 2 specification for verifying an authentication assertion. The transaction hash is used as the
challengein theClientDataJSON, binding the signature to the specific transaction.Transaction Signing Process
Transaction Preparation: The client prepares the transaction as usual, excluding the
TxnSignaturefield.Generate Challenge: Compute the SHA-256 hash of the serialized transaction blob (excluding the
TxnSignatureandPasskeySignaturefields) to be used as thechallengein the WebAuthn authentication flow.Invoke WebAuthn API: Use the WebAuthn API (
navigator.credentials.get) with appropriate parameters, including thechallenge, to obtain an assertion (AuthenticatorAssertionResponse).Construct
PasskeySignature: Extract theAuthenticatorData,ClientDataJSON,Signature, andPasskeyIDfrom the assertion and include them in thePasskeySignaturefield. Include theAlgorithmif necessary.Submit Transaction: Send the transaction with the
PasskeySignaturefield to the XRP Ledger.Supporting Passkey Signatures in Multi-Signature Transactions
Modifying the
Signers.SignerObjectTo support passkey signatures in multi-signature transactions, the
Signers.Signerobject is modified to include thePasskeySignaturefield, allowing signers to provide a passkey signature instead of a traditionalTxnSignature.Updated
Signers.SignerFields:AccountstringAccountIDSigningPubKeystringBlobTxnSignaturePasskeySignatureis omittedstringBlobPasskeySignatureTxnSignatureis omittedobjectObjectNote: Exactly one of
TxnSignatureorPasskeySignatureMUST be present in eachSignerobject.Multi-Signature Transaction Signing Process with Passkeys
Transaction Preparation:
Signersarray containing one or moreSignerobjects.Signerobject represents a signer that contributes a signature to the transaction.Signing with Passkeys:
PasskeySignaturefield within theSignerobject instead ofTxnSignature.Signing with Traditional Signatures:
TxnSignaturefield within theSignerobject.Combined Signature List:
Signersarray may contain a mix of signers usingTxnSignatureand signers usingPasskeySignature.Modifications to Transaction Validation for Multi-Signature Transactions
When validating a multi-signature transaction that includes passkey signatures, the server MUST perform the following steps for each
Signerin theSignersarray:Verify
SignerStructure:TxnSignatureorPasskeySignatureis present.Signature Verification:
TxnSignatureis present:PasskeySignatureis present:Check Signing Permissions:
SignerListassociated with the account.Passkey Signature Verification Steps in Multi-Signature Context
For each
Signerusing a passkey signature:Credential Lookup:
PasskeyIDcorresponds to a registered credential in the account'sPasskeyList.Extract Algorithm:
Algorithmassociated with thePasskeyIDfrom thePasskeyList.Compute Client Data Hash:
ClientDataJSON.Construct Signed Data:
AuthenticatorDataand theClientDataHash.Verify Signature:
Signatureover the concatenated signed data using thePublicKey.Validate Challenge:
challengeinClientDataJSONmatches the hash of the multi-signature transaction blob.Prevent Replay Attacks:
SignCountfromAuthenticatorDatais greater than the storedSignCountand update it.Check Signing Permissions:
SignerListand contributes towards the quorum.Example
SignersArray with Passkey SignaturesError Handling
Invalid
SignerStructure:TxnSignatureandPasskeySignatureare present, or if neither is present, the transaction MUST fail with atemMALFORMEDerror.Signature Verification Failure:
temBAD_SIGNATUREerror.Unauthorized Signer:
SignerList, the transaction MUST fail with atefBAD_AUTH_MASTERerror.Modifications to RPC Methods
Modifying the
account_objectsRPC RequestTo allow clients to retrieve passkey-related ledger objects, the
account_objectsRPC request is modified to include apasskeyoption in thetypefield.Updated
account_objectsRequest Fieldsaccountstringtypestringpasskey.Example Request
{ "method": "account_objects", "params": [ { "account": "rExampleAccountAddress", "type": "passkey", "ledger_index": "validated" } ] }Response Modification
When the
typefield is set topasskey, the response MUST include onlyPasskeyListledger objects associated with the specified account.Example Response
{ "result": { "account": "rExampleAccountAddress", "account_objects": [ { "LedgerEntryType": "PasskeyList", "Account": "rExampleAccountAddress", "Passkeys": [ { "PasskeyID": "credentialID1", "PublicKey": "publicKey1", "SignCount": 123, "Algorithm": -7 }, { "PasskeyID": "credentialID2", "PublicKey": "publicKey2", "SignCount": 456, "Algorithm": -8 } ], "index": "ledgerObjectIndex" } ], "ledger_hash": "ledgerHash", "ledger_index": 12345678, "validated": true } }Account Setup for Passkey Authentication
Credential Registration: Accounts MUST initialize their
PasskeyListusing theSetPasskeyListtransaction, adding desired passkey credentials along with their correspondingAlgorithm(COSE algorithm identifier).Authorization: The initial
SetPasskeyListtransaction MUST be authorized using existing account credentials (e.g., master key or regular key).Multiple Credentials: Accounts MAY register multiple passkey credentials, potentially using different algorithms, to allow for backup devices or multiple users.
Algorithm Consistency: It is important that the
Algorithmprovided during registration matches the algorithm used by the authenticator for that credential. This ensures correct verification during transaction signing.Error Handling
Unregistered Credential: If the
PasskeyIDis not found in thePasskeyList, the transaction MUST fail with atecNO_PERMISSIONerror.Invalid Signature: If the signature verification fails, the transaction MUST fail with a
temINVALID_SIGNATUREerror.Unsupported Algorithm: If the
Algorithmis not supported by the verifier, the transaction MUST fail with atemBAD_SIGNATUREerror.Algorithm Mismatch: If the algorithm used in the signature does not match the
Algorithmspecified in thePasskeyList, the transaction MUST fail with atemBAD_SIGNATUREerror.Invalid Challenge: If the
challengein theClientDataJSONdoes not match the expected value (transaction hash), the transaction MUST fail with atemBAD_SIGNATUREerror.Compliance with WebAuthn Specification
Algorithm Specification: By using COSE algorithm identifiers for the
Algorithmfield, the XRPL implementation aligns with the WebAuthn specification.Consistency in Verification: This ensures that the verification process can accurately select and apply the correct cryptographic algorithm, as the authenticator and the verifier agree on the algorithm used.
Reference: See the WebAuthn Level 2 Specification, Sections 5.10.3 (
PublicKeyCredentialParameters) and 6.2 (Generating an Authentication Assertion), for details on how algorithms are specified and used.Handling Different Cryptographic Algorithms
Please see: XLS-84d: Support for ES256 on the P-256 curve in Passkey Signatures
Beta Was this translation helpful? Give feedback.
All reactions