Skip to main content
The Id Registry records which fid is associated with which Ethereum address, and manages fid transfers and recoveries. If you want to read information about an fid, transfer or recover an fid, or manage an fid’s recovery address, use the Id Registry. If you want to register a new fid, use the ID Gateway instead.

Read

idOf

Returns the fid (uint256) owned by an address, or returns zero if the address does not own an fid.

custodyOf

Returns the custody address (address) that owns a specific fid. Returns the zero address if the fid does not exist.

recoveryOf

Returns the recovery address (address) of an fid. Returns the zero address if the fid does not exist.

idCounter

Returns the highest registered fid (uint256) so far.

verifyFidSignature

Checks that a message was signed by the current custody address of an fid. Returns a bool.

nonces

Returns the next unused nonce (uint256) for an address. Used for generating EIP-712 signatures.

Write

register

Will revert if called directly. Must be called via the ID Gateway.

changeRecoveryAddress

Change the recovery address for the caller’s fid.

transfer

Transfer the caller’s fid to a new address. The to address must sign an EIP-712 Transfer message accepting the transfer. The to address must not already own an fid.
Transferring an fid does not reset its recovery address. To transfer an fid and update its recovery address, call transferAndChangeRecovery. If you are receiving an fid from an untrusted sender, ensure its recovery address is cleared or changed on transfer.

Transfer signature

To transfer an fid to another account, the caller must provide an EIP-712 typed signature from the receiving address in the following format: Transfer(uint256 fid,address to,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]

transferAndChangeRecovery

Transfer the fid of the caller to a new address and change the fid’s recovery address. This can be used to safely receive an fid transfer from an untrusted address. The receiving address must sign an EIP-712 TransferAndChangeRecovery message accepting the transfer. The to address must not already own an fid.

TransferAndChangeRecovery signature

To transfer an fid to another account and change recovery, you must provide an EIP-712 typed signature from the to address in the following format: TransferAndChangeRecovery(uint256 fid,address to,address recovery,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]

recover

Transfer an fid to a new address if caller is the recovery address. The to address must sign an EIP-712 Transfer message accepting the transfer. The to address must not already own an fid.

changeRecoveryAddressFor

Change the recovery address of an fid on behalf of the owner by providing a signature. The owner must sign an EIP-712 ChangeRecoveryAddress signature approving the change.

ChangeRecoveryAddress signature

To change a recovery address on behalf of an fid owner, the caller must provide an EIP-712 typed signature from the owner address in the following format: ChangeRecoveryAddress(uint256 fid,address from,address to,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]

transferFor

Transfer the fid owned by the from address to the to address. The caller must provide two EIP-712 Transfer signatures: one from the from address authorizing the transfer out and one from the to address accepting the transfer in. These messages have the same format. The to address must not already own an fid.

transferAndChangeRecoveryFor

Transfer the fid owned by the from address to the to address, and change the fid’s recovery address. This can be used to safely receive an fid transfer from an untrusted address. The caller must provide two EIP-712 TransferAndChangeRecovery signatures: one from the from address authorizing the transfer out and one from the to address accepting the transfer in. These messages have the same format. The to address must not already own an fid.

recoverFor

Transfer an fid to a new address with a signature from the fid’s recovery address. The caller must provide two EIP-712 Transfer signatures: one from the recovery address authorizing the transfer out and one from the to address accepting the transfer in. These messages have the same format. The to address must not already own an fid.

Errors

Source

IdRegistry.sol