jzhao.xyz

Search IconIcon to open search

 .
  \_.
  /

Signed messages

Last updated June 30, 2022

Signatures are cryptographic functions that attest to the origin of a particular message.

It is infeasible for Alice to generate a signed message that appears to have been generated by Bob.

# Signatures Schemes

Require 3 algorithms

  1. Key generation algorithm: seed -> public_key, private_key
  2. Signing algorithm: msg, private_key -> msg, signature
  3. Verification algorithm: msg, signature, public_key -> boolean

# Computing Signatures

# Signed Blobs

From Farcaster Docs

Blobs are cryptographically signed so that it cannot be tampered with

The structure that holds this data is called a Signed Blob, and it contains three properties:

# Signing

  1. Construct the JSON object with the properties in the exact order as specified.
  2. Convert the object to a string to make it hashable.
  3. Hash the string using  keccak256 and store this value as the merkleRoot
  4. Sign the merkleRoot with the user’s Ethereum wallet, creating a recoverable ECDSA signature and store this in the signature property.

# Verifying

  1. Convert the body to a string to make it hashable.
  2. Hash the string using  keccak256 and check that it matches the merkle root
  3. Perform an ecRecover on the signature with the merkle root to retrieve the address.
  4. Check that the recovered address matches the expected address.

# Signed Message Digest


Interactive Graph