How daevmithran/dacona works
Project Type and Purpose
• This is a Node.js-based CLI demo application.
• Its purpose is to demonstrate creating and interacting with gated attestations using two external protocols: the Ethereum Attestation Service (EAS) and the Lit Protocol.
• Additionally, it showcases a decentralized identity demo called “Anon Aadhaar” for creating and verifying zero-knowledge proofs through QR code generation and attestation resolution.
Analyzing the File Structure
• Top-level files like package.json, tsconfig.json, and .gitignore indicate a standard Node.js/TypeScript project.
• The entire logic resides in the src directory.
• You have dedicated clients:
• src/easClient.ts is responsible for interactions with the Ethereum Attestation Service.
• src/LitprotocolClient.ts handles interactions with the Lit Protocol.
• The main entry point (src/index.ts) likely serves as the CLI “orchestrator” that ties the functionality together.
• The src/types folder holds TypeScript definitions and constants, providing a clear boundary for internal data handling and configuration.
Key Components
a. CLI/Command Interface:
• The entry point (index.ts) that drives the application flow.
• This component manages user input and coordinates the attestation creation and resolution processes.
b. EAS Integration Module:
• EasClient.ts as a core component.
• How it communicates with the Ethereum Attestation Service, posting and retrieving attestation data.
c. Lit Protocol Integration Module:
• LitprotocolClient.ts as another key component.
• Role in encrypting attestation data and decrypting it when the attestation is resolved.
d. Types and Configuration:
• Types folder as a supporting element that standardizes environment configurations, constants, and type declarations.
e. External Services:
• Ethereum Attestation Service (depicted as an external system with which the project interacts).
• Lit Protocol (another external service that provides encryption/decryption capabilities).
f. Anon Aadhaar Demo Workflow:
• Generates a QR code from an external demo page.
• Uploads and processes the QR code image externally.
• Subsequently uses the result in the Dacona CLI to create and verify gated attestations.
Relationships and Data Flow
• The CLI component (index.ts) calls methods in both the EAS integration module and the Lit Protocol module.
• Data flowing from the CLI to the EAS client when creating or resolving attestations.
• Data flowing to/from the Lit Protocol client during encryption (attestation creation) and decryption (attestation resolution).
• Inputs such as the “minified proof JSON” coming from the Anon Aadhaar workflow should be indicated as external data sources.
• That the types/configuration layer supports both client modules.
Architectural Patterns and Design Principles
• The project follows a modular design by separating responsibilities:
• The communication with external services is encapsulated in dedicated client modules.
• The main CLI acts as the controller that orchestrates which module to use based on the user’s flow (create or resolve attestations).
• That the design intends to isolate service interfaces (EAS and Lit) from business logic to make the system maintainable and extensible.