Skip to content
Merged
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
23 changes: 23 additions & 0 deletions src/interfaces/ISignatureVerifier.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.13 <0.9.0;

/// @title ISignatureVerifier
/// @notice Interface for the TIP-1020 Signature Verification Precompile
/// @dev Deployed at 0x5165300000000000000000000000000000000000
interface ISignatureVerifier {
error InvalidFormat();
error InvalidSignature();

/// @notice Recovers the signer of a Tempo signature (secp256k1, P256, WebAuthn).
/// @param hash The message hash that was signed
/// @param signature The encoded signature (see Tempo Transaction spec for formats)
/// @return signer Address of the signer if valid, reverts otherwise
function recover(bytes32 hash, bytes calldata signature) external view returns (address signer);

/// @notice Verifies a signer against a Tempo signature (secp256k1, P256, WebAuthn).
/// @param signer The input address verified against the recovered signer
/// @param hash The message hash that was signed
/// @param signature The encoded signature (see Tempo Transaction spec for formats)
/// @return True if the input address signed, false otherwise. Reverts on invalid signatures.
function verify(address signer, bytes32 hash, bytes calldata signature) external view returns (bool);
}