For the complete documentation index, see llms.txt. This page is also available as Markdown.

User decryption delegation

Delegation lets one account (the delegator) authorize another account (the delegate) to perform user decryption on its behalf, in the context of a specific contract. The ACL stores user decryption permissions as (user, contractAddress) pairs; delegation transfers the rights of (delegator, contractAddress) to (delegate, contractAddress).

Who is the delegator?

It depends on which API you call:

Caller

API

Delegator (msg.sender to ACL)

EOA (Externally Owned Account)

IACL.delegateForUserDecryption directly on the ACL contract

the EOA itself

Smart contract

FHE.delegateUserDecryption from inside a contract function

address(this)

FHE.delegateUserDecryption cannot be used by an EOA to delegate its own rights — the EOA must call the ACL directly.

Constraints

The ACL enforces three invariants when registering a delegation:

  • msg.sender != contractAddress

  • msg.sender != delegate

  • delegate != contractAddress

Plus a one-delegate-or-revoke-per-block rule per (delegator, delegate, contractAddress) tuple.

Pattern 1 — EOA delegates to a backend service

The user calls the ACL contract directly to delegate their own rights:

After this, the relayer can user-decrypt any handle that has the (EOA, vault) ACL pair.

Pattern 2 — Contract delegates its own rights

A contract delegates user-decryption rights it has been granted. contractAddress must be a different contract whose handles this contract has been allowed to access.

API summary

Last updated