Farcaster
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
1
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Handling Custody Transfers Safely Farcaster users keep their fid in an Ethereum address known as the custody address. The custody address (ECDSA keypair) issues a signed message which authorizes a signer (EdDSA keypair). The signer, in turn, can issue signed messages like casts or likes for the user. ```mermaid flowchart LR Root((ECDSA Keypair <br/> Custody Address <br/> 0x123)):::ecdsaSigner --> SignerAdd(Message <br/> authorize 0xabc <br/> signed_by: 0x123) SignerAdd:::message --> Signer((EdDSA Keypair <br/> Farcaster Signer <br/> 0xabc)):::eddsaSigner Signer --> Cast1(Message <br/> hello world <br> signed_by: 0xabc):::message Signer --> Cast2(Message <br/> it's me! <br> signed_by: 0xabc):::message classDef ecdsaSigner fill:#C9F0FF, stroke:#333; classDef eddsaSigner fill:#EFEFF0, stroke:#333; classDef message fill: #EAFFFD, stroke:#333; ``` Users may transfer fids to a new address to use change clients, rotate keys for security or to transfer control. When this happens, users can simply issue a new signed message signed by their new custody address authorizing the previously known EdDSA keypair as shown below. This allows the trust chain to be preserved without having to issue a new EdDSA keypair and re-sign casts. ```mermaid flowchart LR Root((ECDSA Keypair <br/> Custody Address <br/> 0x123)):::ecdsaSigner --> SignerAdd(Message <br/> authorize 0xabc <br/> signed_by: 0x123) SignerAdd:::message --> Signer((EdDSA Keypair <br/> Farcaster Signer <br/> 0xabc)):::eddsaSigner Signer --> Cast1(Message <br/> hello world <br> signed_by: 0xabc):::message Signer --> Cast2(Message <br/> it's me! <br> signed_by: 0xabc):::message Root2((ECDSA Keypair <br/> Custody Address <br/> 0x456)):::ecdsaSigner --> SignerAdd2(Message <br/> authorize 0xabc <br/> signed_by: 0x456) SignerAdd2:::message --> Signer classDef ecdsaSigner fill:#C9F0FF, stroke:#333; classDef eddsaSigner fill:#EFEFF0, stroke:#333; classDef message fill: #EAFFFD, stroke:#333; ``` The problem is that the transfer of the fid from 0x123 to 0x456 and the issuance of the new signer signed by 0x456 cannot be done concurrently since they happen on different systems. If a user transfers the fid first, then the moment the Hub sees that it can no longer trust all the messages and drops them. If the user tries to sign the message and upload it before the transfer, the Hub will reject it. Hubs cannot accept and store messages from arbitrary addresses that do not yet own an fid, otherwise its a vector for a storage ddos. ## Goals We need to find a solution that satisfies the following constraints: - Users can transfer an fid and without losing their history. - Hubs do not introduce vectors for DDOS attacks - Developers can implement Farcaster clients easily. - Hubs remain as simple as possible. ## Proposal Assume that Alice holds an fid in address `0x123` held in her client (sending client). She broadcasts SignerAdd A, signed by `0x123` which authorizes `0xabc` as a Signer. She broadcasts many messages using this signer. She now wants to transfer her fid to `0x456`, held in a separate Farcaster client. She must create and upload a new SignerAdd B signed by `0x456` which authorizes the signer `0xabc`, and by extension, all the messages signed by it. Since the two operations can be seen in any order by hubs, we need to design a system that ensures messages are not lost irrecoverably while the transactions settle. ### Revoked Signer Mempool Hubs will keep signers for 60 minutes after the custody address that signed them transfers the fid. Users can re-upload their new signers during this grace period without losing out older messages. The signers are maintained in both the storage db and the sync trie until the expiration occurs. The 60-minute persistence is also subject to the regular rules of pruning as well which may cause some messages to organically expire. - Alice transfers the fid from the 0x123 to 0x456 using the sending client - Alice waits for confirmation, then uploads SignerAdd B This design has a reasonably simple user experience and doesn't introduce any significant scaling problems or vectors for attack on the hubs. Hubs will need to introduce a TTL or similar system that expires messages, but we were planning to do that for pruning anyway so the net complexity increase is small. ## Rejected Ideas ### Custody Link Message Hubs accept a "custody-link" per fid that is signed by its custody address and points to another Ethereum address. The latter address is allowed to upload signer messages in a "dormant" state where cannot sign other messages until the address becomes valid. - Alice uploads a custody link message signed by 0x123 pointing to 0x56 - Alice uploads SignerAddB which is accepted by the Hub as a dormant signer - Alice transfers the fid from the 0x123 to 0x456 using the sending client - The Hub moves SignerAddB to an active signer, preserving her messages This design is the safest, eliminating any potential for message loss and avoiding the need for a backup. It was rejected because it compounds the state machine for the SignerStore and is much more complex to implement that the current approach. It can also be layered on at a later date, while removing it would be much harder. ### Do Nothing Hubs delete signers (and any associated messages) as soon as the fid is transferred out of the custody address that authorized the signer. Clients are responsible for implementing backup solutions for Farcaster users. - Alice users her receiving client to download all her messages to disk - Alice transfers the fid from the 0x123 to 0x456 using the sending client - Alice waits for confirmation, then uploads SignerAdd B followed by all her messages This design is simple to implement, but is more complicated for everyone. Users wait longer and may see their messages disappear momentarily from the network. Applications must implement backup and restore feature which adds complexity. Hubs may see network thrash as thousands of messages disappear are deleted, re-uploaded and broadcast again.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully