diff --git a/src/verifier/UserOpECDSAVerifier.sol b/src/verifier/UserOpECDSAVerifier.sol index d97bc3d..94412b3 100644 --- a/src/verifier/UserOpECDSAVerifier.sol +++ b/src/verifier/UserOpECDSAVerifier.sol @@ -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 diff --git a/src/verifier/UserOpMultiSigVerifier.sol b/src/verifier/UserOpMultiSigVerifier.sol index 5bd4524..fe60e3a 100644 --- a/src/verifier/UserOpMultiSigVerifier.sol +++ b/src/verifier/UserOpMultiSigVerifier.sol @@ -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 diff --git a/src/verifier/UserOpWebAuthnCosignVerifier.sol b/src/verifier/UserOpWebAuthnCosignVerifier.sol index b27a84f..9f4c5bb 100644 --- a/src/verifier/UserOpWebAuthnCosignVerifier.sol +++ b/src/verifier/UserOpWebAuthnCosignVerifier.sol @@ -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 diff --git a/src/verifier/UserOpWebAuthnVerifier.sol b/src/verifier/UserOpWebAuthnVerifier.sol index 8dcd766..a39a1d6 100644 --- a/src/verifier/UserOpWebAuthnVerifier.sol +++ b/src/verifier/UserOpWebAuthnVerifier.sol @@ -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