Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/verifier/UserOpECDSAVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ import {OnlyKeystore} from "../lib/OnlyKeystore.sol";
contract UserOpECDSAVerifier is IVerifier, OnlyKeystore {
constructor(address aKeystore) OnlyKeystore(aKeystore) {}

/**
* @notice Called by the Keystore for nodes with ECDSA verification.
* @param message The hashed message that was signed.
* @param data The raw signature or a PackedUserOperation containing the signature.
* If the length is more than 65 bytes, it will be decoded as a PackedUserOperation
* with the userop.signature field containing the packed (r,s,v) signature values.
* @param config The node configuration, expected to contain the 20 bytes ECDSA
* signer address.
* @return validationData Returns SIG_VALIDATION_SUCCESS (0) if ok, otherwise
* SIG_VALIDATION_FAILED (1).
*/
function validateData(bytes32 message, bytes calldata data, bytes calldata config)
external
view
Expand Down
15 changes: 15 additions & 0 deletions src/verifier/UserOpMultiSigVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ contract UserOpMultiSigVerifier is IVerifier, OnlyKeystore {

constructor(address aKeystore) OnlyKeystore(aKeystore) {}

/**
* @notice Called by the Keystore for nodes with multisig ECDSA verification.
* @param message The hashed message that must be signed by the owners.
* @param data The calldata containing the signatures. If the first byte is
* SIGNATURES_ONLY_TAG (0xff), it is followed by an abi-encoded array of SignerData
* structs. Otherwise, it is a PackedUserOperation whose signature field contains
* the abi-encoded array of SignerData.
* @param config The node configuration, expected to be abi.encoded as
* (uint8 threshold, address[] owners).
* The threshold is the minimum number of owner signatures required to pass
* validation.
* The owners array is all the valid signers on the multisig.
* @return validationData Returns SIG_VALIDATION_SUCCESS (0) if ok, otherwise
* SIG_VALIDATION_FAILED (1).
*/
function validateData(bytes32 message, bytes calldata data, bytes calldata config)
external
view
Expand Down
18 changes: 18 additions & 0 deletions src/verifier/UserOpWebAuthnCosignVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ contract UserOpWebAuthnCosignVerifier is IVerifier, OnlyKeystore {

constructor(address aKeystore) OnlyKeystore(aKeystore) {}

/**
* @notice Called by the Keystore for nodes with dual WebAuthn and ECDSA
* verification.
* @param message The hashed message that must be signed by both the ECDSA
* cosigner and the WebAuthn authenticator.
* @param data The calldata containing the ECDSA signature and the WebAuthn
* data. If the first byte is SIGNATURES_ONLY_TAG (0xff), it is followed by
* an abi-encoded (bytes ecdsaSignature, bytes WebAuthnAuth). Otherwise, it
* is a PackedUserOperation whose signature field contains the abi-encoded
* (bytes ecdsaSignature, bytes WebAuthnAuth).
* See https://github.com/Vectorized/solady/blob/v0.1.19/src/utils/WebAuthn.sol
* for details on how WebAuthnAuth is encoded.
* @param config The node configuration, expected to be abi.encoded as
* (address cosigner, bytes32 x, bytes32 y), where cosigner is the ECDSA address
* and (x, y) are the WebAuthn public key coordinates.
* @return validationData Returns SIG_VALIDATION_SUCCESS (0) if ok, otherwise
* SIG_VALIDATION_FAILED (1).
*/
function validateData(bytes32 message, bytes calldata data, bytes calldata config)
external
view
Expand Down
14 changes: 14 additions & 0 deletions src/verifier/UserOpWebAuthnVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ import {OnlyKeystore} from "../lib/OnlyKeystore.sol";
contract UserOpWebAuthnVerifier is IVerifier, OnlyKeystore {
constructor(address aKeystore) OnlyKeystore(aKeystore) {}

/**
* @notice Called by the Keystore for nodes with WebAuthn verification.
* @param message The hashed message that must be signed by the WebAuthn
* authenticator.
* @param data The calldata containing the WebAuthn authentication data. If
* the data is not a valid WebAuthnAuth struct, it is assumed to be a PackedUserOperation
* whose signature field contains the WebAuthnAuth encoded bytes.
* See https://github.com/Vectorized/solady/blob/v0.1.19/src/utils/WebAuthn.sol
* for details on how WebAuthnAuth is encoded.
* @param config The node configuration, expected to be abi.encoded as
* (bytes32 x, bytes32 y), where x and y are the WebAuthn public key coordinates.
* @return validationData Returns SIG_VALIDATION_SUCCESS (0) if ok, otherwise
* SIG_VALIDATION_FAILED (1).
*/
function validateData(bytes32 message, bytes calldata data, bytes calldata config)
external
view
Expand Down