Skip to content
Open
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
20 changes: 20 additions & 0 deletions src/interfaces/IAccountKeychain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ interface IAccountKeychain {
/// @notice Emitted when a new key is authorized
event KeyAuthorized(address indexed account, address indexed publicKey, uint8 signatureType, uint64 expiry);

/// @notice Emitted when a new admin key is authorized
event AdminKeyAuthorized(address indexed account, address indexed publicKey);

/// @notice Emitted when a key is revoked
event KeyRevoked(address indexed account, address indexed publicKey);

Expand Down Expand Up @@ -122,6 +125,7 @@ interface IAccountKeychain {
error SignatureTypeMismatch(uint8 expected, uint8 actual);
error CallNotAllowed();
error InvalidCallScope();
error InvalidKeyId();
error InvalidKeyAuthorizationWitness();
error KeyAuthorizationWitnessAlreadyBurned();
error LegacyAuthorizeKeySelectorChanged(bytes4 newSelector);
Expand Down Expand Up @@ -164,6 +168,14 @@ interface IAccountKeychain {
function authorizeKey(address keyId, SignatureType signatureType, KeyRestrictions calldata config, bytes32 witness)
external;

/**
* @notice Authorize a new admin key for the caller's account
* @param keyId The key identifier (address derived from public key)
* @param signatureType Signature type of the admin key
* @param witness TIP-1053 key-authorization witness for this authorization
*/
function authorizeAdminKey(address keyId, SignatureType signatureType, bytes32 witness) external;

/**
* @notice Burn a TIP-1053 key-authorization witness without authorizing a key
* @param witness The per-account key authorization witness to burn
Expand Down Expand Up @@ -252,6 +264,14 @@ interface IAccountKeychain {
*/
function isKeyAuthorizationWitnessBurned(address account, bytes32 witness) external view returns (bool burned);

/**
* @notice Returns whether a key is the root key or an active admin key for an account
* @param account The account address
* @param keyId The key ID
* @return Whether the key has admin privileges
*/
function isAdminKey(address account, address keyId) external view returns (bool);

/**
* @notice Get the transaction key used in the current transaction
* @return The key ID that signed the transaction
Expand Down
Loading