Skip to content

stephancill/efd

Repository files navigation

🌈 Ethereum Friend Directory

Ethereum Friend Directory is a blockchain-based social graph which allows users to maintain a list of mutual connections. This list of connections can be accessed by any app on the decentralized web to allow for social use cases e.g. a portable following/follower list.

How it works

Requests are created and accepted off-chain. This is the most cost-effective way of facilitating this interaction. An implementation of these methods can be found in the tests directory.

  1. Alice creates a request by signing the hash of a message which contains her and Bob's address and sends it to Bob
  2. Bob signs the same message with Alice's signature added in
  3. Bob or Alice can confirm the request at any time by submitting it to the contract's confirmRequest method
  4. Bob's address is added to Alice's set in the adj mapping and Alice to Bob's
  • The adjacency list for each user in adj is read by the client to display who is friends with who.
  • ENS is used to resolve ENS domains and profile images

Progress

  • Design - Figma
    • Concept mapped out
  • Contract
    • Confirm request accept
    • Remove friends
    • Batch confirm
    • Batch remove
    • Add salt to hash arguments
  • Frontend
    • Basic components
    • Connect/switch account and view profile
    • Profile url
    • ENS reverse resolution - ENS Docs
    • Requests
      • Create signature that you can send to someone
      • Route to sign request to accept
      • Route to publish friend confirmation
      • Share request via URL
      • Share request via QR code
      • Store invites locally for batch confirm
    • Remove friends
    • View other accounts
    • UX improvements
      • Button hover states
      • Button loading states
      • Page loading states
      • Mobile layout
  • Testing
    • Create ENS task
    • Set profile image
  • Deploy
  • Growth/adoption
    • Properly document contract call
    • Sample code for Infura and Alchemy
    • SDKs
      • JavaScript
      • Python
      • Ruby
      • Go
    • React component

Reach out on Twitter @stephancill if you'd like to help out or make a PR.

Installation

yarn

Development

Contract

yarn run node

In a separate terminal, to generate random data for the built in accounts:

yarn dev

Client

cd client
yarn start

Tests

yarn test

Deployment

Contracts

  1. Update network in hardhat.config.js
  2. npx hardhat run deploy --network [network name]

Client

  1. cd client
  2. Add addresses for PublicResolver, ReverseRegistrar, ReverseRecords, ENS in client/deployments/map.json (and EFD if using an existing contract)
  3. Build using yarn build

Deploy client to IPFS using ipfs-deploy

  1. Install ipfs-deploy
npm install -g ipfs-deploy
  1. Deploy app
npx ipfs-deploy build
  1. Visit the HTTP gateway URL to check if it worked.