Giter Site home page Giter Site logo

ethfs's Introduction

EthFS: Ethereum File System

Browse and upload on-chain files at ethfs.xyz

What?

dhof's on-chain 3D rose NFT inspired tons of fun conversations and projects. It surfaced many examples and use cases for highly reusable on-chain assets (JS libraries, fonts, gifs).

EthFS is an effort to consolidate these assets into a public, durable on-chain repository with ergonomic, gas-optimized methods for reading and writing files.

How does it work?

EthFS leans on SSTORE2's strategy to efficiently read and write data in the form of contract bytecode. The frontend splits files into 24kb chunks (max contract size) and writes them to deterministic content addresses via Safe Singleton Factory. This means the content address can be computed ahead of time and is the same across EVM chains.

A File struct wraps a set of bytecode slices that, when concatenated, represent the full file contents. It also holds the logic for reading/unwrapping the file contents into a single string in a very gas-efficient way.

The FileStore contract acts as a minimum viable registry, a global namespace of human-readable filenames for more ergonomic use within consumer contracts and the frontend's file browser. A CDN of sorts.

Installation (Foundry)

  1. forge install holic/ethfs

  2. Go into your foundry.toml and add "@holic/ethfs/" to your remappings array

  3. Go into your .sol file and add import "@holic/ethfs/contracts/src/FileStore.sol";

  4. Have fun!

Reference

Contract addresses

Ethereum
Ethereum Mainnet 0xFe1411d6864592549AdE050215482e4385dFa0FB
Ethereum Sepolia 0xFe1411d6864592549AdE050215482e4385dFa0FB
Ethereum Holesky 0xFe1411d6864592549AdE050215482e4385dFa0FB
Base
Base Mainnet 0xFe1411d6864592549AdE050215482e4385dFa0FB
Base Sepolia 0xFe1411d6864592549AdE050215482e4385dFa0FB
Optimism
Optimism Mainnet 0xFe1411d6864592549AdE050215482e4385dFa0FB
Optimism Sepolia 0xFe1411d6864592549AdE050215482e4385dFa0FB
Zora
Zora Mainnet 0xFe1411d6864592549AdE050215482e4385dFa0FB
Zora Sepolia 0xFe1411d6864592549AdE050215482e4385dFa0FB

ethfs's People

Contributors

holic avatar backseats avatar xtremetom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.