How layr-labs/eigenda works
Main Components
• Smart Contracts: Represented by the “contracts” directory. These are deployed on Ethereum and define the core on-chain operations and verifications.
• API Layer: Found under “api” (with its builder, clients, documentation, and GRPC support) which exposes public endpoints. This also communicates with client applications and partner integrations.
• Core Libraries & Services: The “core”, “common”, and “crypto” directories contain the business logic, cryptographic functions (FFT, KZG, RS encoding, etc.), state management, and protocol-specific utilities.
• Disperser Service: Under “disperser”, you have components related to blob dispersion, batching, encoding, and gRPC-based servers. This service is critical for the high-throughput and decentralized availability of data blobs.
• Node Components: The “node”, “lightnode”, and “operators” directories provide the code needed to run an operator node, which interacts with other services and participates in the network.
• Supporting Tools & Infrastructure: Directories like “inabox” (for local testing and deployment), “tools”, “encoding”, and “test” provide supplementary tooling, deployment scripts, and integration tests.
Relationships and Interactions
• API Layer – Clients interact with the public API endpoints to submit or retrieve data availability requests. The API communicates with underlying core services.
• Disperser Services – These interact with both the API and the node components; they batch, encode, and disseminate data blobs for availability.
• Node & Operator Components – Node software interacts with on-chain smart contracts (from the “contracts” module) to manage state, submit attestations, and monitor network events.
• Core and Encoding Libraries – They support the services by managing data transformations (e.g., FFTs, polynomial operations) and verifications before data is broadcast.
• External Dependencies – The architecture leverages Ethereum and EigenLayer, so include these external services as well as any cloud or container infrastructure (Dockerfiles, GitHub Actions workflows, etc.) that support deployment and CI/CD.
Architectural Patterns and Design Principles
• Modular & Microservices-like Architecture: Each major logical component (API, node, disperser, indexer) is organized as an individual module or service, allowing independent development and deployment.
• Clear Separation of Concerns: Frontend/API endpoints separate from underlying core logic and smart contracts.
• Blockchain Integration: Interaction with on-chain smart contracts, using GRPC and REST protocols, places this architecture within a hybrid on-chain/off-chain system.
• Use of Standard Protocols: The presence of protobufs (in “api/proto” and “docs/spec/src/protobufs”) and gRPC indicates a pattern built around well-defined data schemas for communication.
Relevant Technologies, Frameworks, and Libraries
• Go: Most of the code (services, nodes, encoding libraries) is written in Go.
• Docker and Dev Containers: Directories like “.devcontainer”, “Dockerfile”, “inabox/anvil/docker-compose.yaml” indicate containerized deployments.
• Ethereum and EigenLayer: The smart contracts are written for Ethereum, and integration with EigenLayer is core to the project.
• GRPC/Protobuf, REST APIs, and Test Infrastructure: Communication is organized around these industry-standard tools.
• Cryptographic & Encoding Libraries: From “encoding/fft”, “encoding/kzg”, “crypto/ecc”, etc., which are fundamental to the DA mechanism.