FIP: Auth Addresses #225
Replies: 9 comments 15 replies
-
if auth address is added, does it mean people don't need to use Sign in with Farcaster, but simply go with Sign in with Ethereum? This would definitely make life easier on desktop. |
Beta Was this translation helpful? Give feedback.
-
This is a very elegant solution, V! What will a custody addr be able to do that auth addrs won't? (except add/remove auth addrs and I guess (?) set the recovery address) |
Beta Was this translation helpful? Give feedback.
-
Will there be a corresponding OnChainEvent for these addresses? |
Beta Was this translation helpful? Give feedback.
-
Looks ok, basically this will allow smart wallets to do SIWF, but won't be limited to smart wallets, anyone could use to enable SIWF for other EOA in theory, probably there should be some limits, like MAX 5-6 Auth addresses(add/delete), and since this AUTH address has high security, there should be an additional contract on OP, don't see why signers would need to be on OP and this would not. Either signers will also be moved on FC network, otherwise, if signers will not be moved from OP, then this should also sit on OP, the implementation of such a contract should be pretty simple, but will also require synk from hubs like is now with signers, preferably for lower cost OP is ditched and you have an explorer and signers and auth signers would be part of FC network, at that point also a public explorer should exist, to be able to view such actions like adding/removing signers at least for a certain timeframe 1 year or something. |
Beta Was this translation helpful? Give feedback.
-
Are both keys registered as a single atomic entry? i.e. approval seems to be atomic but will the revoke also be atomic? Not keeping the revoke atomic will result in the need to handle the edge case where one is revoked but the other is still approved. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For mini app devs, can the Auth Addresses also be used to sign the farcaster.json file? |
Beta Was this translation helpful? Give feedback.
-
any sense in auto-expiration? just handle that on the SIWE side? concerned that most users have don't know how to revoke existed signers and are accumulating long tail risk would like to give my warpcast auth address a 30-day approval to SIWF on my behalf |
Beta Was this translation helpful? Give feedback.
-
Sub-proposal: Reinstatable auth addressesProblemAn undesirable property of the design above is that auth address revocation is permanent according to the rules of the Key Registry contract. Each key added to the registry must be unique and can only transition from ADDED to REMOVED, and never back. This means revoking an auth address has permanent consequences. For example, if a user revokes their auth address corresponding to Warpcast Wallet, they would permanently lose the ability to sign in to mini apps on web. This is not great! ProposalUse the high bytes of the 32 byte padded auth address to encode a key "index" along with the 20 byte Ethereum address. Instead of 12 empty bytes of padding, we can instead define an auth address as a numeric index plus 20 byte address:
or in Solidity: bytes.concat(bytes12(uint96(index)), bytes20(address(authAddress))); For example, the auth key for index 1 and horsefacts’s Warpcast Wallet would be: 0x000000000000000000000001e36d2f95a9b69df60dbf029bf7c4fa7d1ff56b90
|-----12 byte index----||-----------20 byte address------------| SIWF messages could then provide this index in a
Relying parties can read the index from the resource and reconstruct the auth key to verify the message. To reinstate a revoked auth address, the user or requesting app may increment the last index to generate an unused unique key. We don't necessarily need to do this now: we can extend the existing proposal above with this design at any time. In a sense, the currently implemented verification uses an implicit “index zero.” |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
FIP: Auth Addresses
Title: Auth Addresses
Type: Implementation FIP
Authors: @v, @horsefacts , @sanjay
Abstract
Introduces auth addresses, a new key type in the Farcaster Key Registry that allows an Ethereum address to authenticate on behalf of a Farcaster user. This enables secure, multi-client access for users with smart wallets or multiple devices, without sharing custody credentials.
Problem
A user’s custody address holds their fid and is used to authenticate using Sign in With Farcaster into apps that rely on Farcaster identity. If a user wants to use multiple clients, they copy their EOA seed phrase into the the other app and can use it simultaneously. This breaks down when clients start using smart wallets where there is no easily transferrable seed phrase.
Specification
Introduce a new concept, auth addresses. Auth addresses are Ethereum addresses which are allowed to sign in on behalf of a Farcaster user. Until now, this could only be done by a custody address.
A custody address can add any Ethereum address as an auth address to the Key Registry. A new key type will need to be added to the registry to allow for this. Once this is performed, all apps performing Sign in With Farcaster should accept a signature from this address as valid for the associated fid.
A custody address can also revoke an auth address at any time. Apps must ensure that the key is currently present in the registry before authenticating. According to the rules of the Key Registry contract, revocation is permanent.
Assume that Alice uses Warpcast today and wants to add Coinbase Wallet as another client. Coinbase Wallet generates an ECDSA auth address and an Ed25519 signer key. It then requests a single transaction which adds the auth address and the signer to the Key Registry. Once this is complete, Coinbase Wallet can use the auth address to sign into apps and the signer to sign casts.
Farcaster Connect FIP should also be extended to support requesting these key pairs.
Rationale
Should we allow these ECDSA auth keys to sign casts and messages?
ECDSA signatures are ~10x slower to verify than the Ed25519 signatures we use today, which would create a bottleneck. A new client can ask the user to add an ECDSA auth key and an Ed25519 signer in a single transaction which minimizes any overhead for the user.
Should auth keys be Ed25519 keys like signers instead of Ethereum addresses?
FC users and developers have learned to treat ECDSA keys like they control money (keep client side and user controlled) and to treat Ed25519 keys like api keys (keep server side). This change requires users to treat some Ed keys like api keys and others like they control money, which causes confusion and doesn’t add any benefit over ECDSA keys.
Should Farcaster users have a single wallet where each client has a signer?
This has one major downside over the current approach which is that each wallet automatically has access to the user’s fid. The benefit of this approach is that auth keys can add signers and authorize other accounts.
Implementation
We can enable auth addresses with no changes or new deployments to the existing Farcaster contracts.
Key Registry
We will introduce a new
KeyRegistry
key type 2 that reuses the existingSignedKeyRequestValidator
:The existing validator checks that keys are exactly 32 bytes. Since Ethereum addresses are 20 bytes, auth keys must be left padded to 32 bytes. This is the same convention used by Solidity
abi.encode()
.For example, the address
0xe36d2f95a9b69df60dbf029bf7c4fa7d1ff56b90
pads to0x000000000000000000000000e36d2f95a9b69df60dbf029bf7c4fa7d1ff56b90
:Constructing signature metadata for auth keys remains the same as for key type 1: the requesting app or entity provides a typed signature over their fid, the key bytes, and a deadline timestamp.
Snapchain
Snapchain will automatically ingest Key Registry events for the new key type and store auth keys by fid. We'll need to expose new APIs to retrieve this data.
Sign in With Farcaster
Update Sign in With Farcaster to accept signatures from both FID owner or auth address.
Relying parties may choose to accept SIWF messages signed by auth addresses in addition to custody addresses.
To verify a SIWF message supporting auth addresses, the relying party must:
1a. Verify the SIWF message as a SIWE message. If valid, continue to 1b. If invalid, proceed to 2.
1b. Call
KeyRegistry.keyDataOf(signer FID, padded auth address)
1c. Ensure this call returns
KeyData(KeyState.ADDED, 2)
. If so, accept the signature. If not, proceed to 2.Relying parties that accept an auth address signature must also accept a custody address signature.
See the reference implementation in auth-client for an example.
Clients and third party apps
Warpcast will extend the existing "signer request flow" to enable auth key requests and batched auth key + app key requests. The existing
Bundler
contract can add multiple keys at registration time.Apps using third party auth tools like Privy will need to update to allow authentication from auth addresses.
Applications that read or depend on Snapchain events may need to ensure they correctly handle new events with keyType=2.
Apps that provide SIWF as a service should allow clients to opt in to auth key SIWF signatures.
Considerations for clients and developers
Release
See Auth Addresses Implementation.
Appendix: FAQ
This would be ideal, but not possible in the onchain Key Registry. We plan to move key management to snapchain this year so we could move it when that happens.
Yes, and in fact this may be desirable for some use cases, like shared accounts.
A verified address is an Ethereum or Solana address that is provably controlled by the user. The proof is established by counter-signing a message with a user’s signer and the address being verified. This allows any app to be able to verify addresses which poses a slight security risk but has a simpler UX since it allows signing from web browsers. It’s not clear that we should deprecate these yet at least until using wallets from browsers becomes easier.
In theory, this should be fine since apps can verify any arbitrary signature. In practice, it may mean a little more overhead for the app developers. We assume for now that all auth addresses are Ethereum addresses.
Beta Was this translation helpful? Give feedback.
All reactions