Skip to content

The EpicChain Service Layer is a high-performance, blockchain-native infrastructure designed to bridge EpicChain and Ethereum-based applications

Notifications You must be signed in to change notification settings

epicchainlabs/epicchain-service-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EpicChain Service Layer: A Comprehensive Blockchain Service Infrastructure

The EpicChain Service Layer is a robust infrastructure designed specifically for the enhanced development of EpicChain and Ethereum applications. It provides developers with a secure, scalable, and cost-effective environment for deploying and executing JavaScript functions, alongside built-in support for advanced blockchain services and cryptographic capabilities. This document explains in detail the architecture, application interaction flow, key features, service components, and guidelines to get started with the EpicChain Service Layer.

Architecture Overview

The architecture of the EpicChain Service Layer is meticulously structured to ensure optimal performance across various components. The architecture supports a multi-layered approach, integrating multiple services, advanced features, and seamless communication channels to improve user and developer experience.

+--------------------------------------------------------------------------------------+
|                            EpicChain Service Layer Architecture                       |
+--------------------------------------------------------------------------------------+
|                                                                                      |
|                                +----------------+                                    |
|                                | Applications   |                                    |
|                                +-------+--------+                                    |
|                                       |                                             |
|                                       v                                             |
|                                +----------------+                                    |
|                                | API Layer      |                                    |
|                                | (epicchain-api)|                                    |
|                                +-------+--------+                                    |
|                                       |                                             |
|                                       v                                             |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|    | Core Services  |   | EpicChain Services  |  | Oracle Service |  | TEE Service    |  |
|    | (epicchain-core)|   | (epicchain-services)|  | (epicchain-oracle)|  | (epicchain-tee) |  |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|            |                     |                    |                    |          |
|            |                     |                    |                    |          |
|            v                     v                    v                    v          |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|    | EpicPulse Bank |   | Meta Tx        |  | Event          |  | Worker         |  |
|    |                |   |                |  | Processing     |  | (epicchain-worker)|  |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|            |                     |                    |                    |          |
|            |                     |                    |                    |          |
|            v                     v                    v                    v          |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|    | Abstract       |   | FHE Service    |  | ZK Service     |  | Storage        |  |
|    | Account        |   | (epicchain-fhe)|  | (epicchain-zk) |  | (epicchain-store)|  |
|    +----------------+   +----------------+  +----------------+  +----------------+  |
|                                       |                                              |
|                                       v                                              |
|                              +----------------+                                     |
|                              | Integration    |                                     |
|                              | Layer          |                                     |
|                              +-------+--------+                                     |
|                                       |                                              |
|                                       v                                              |
|                              +----------------+                                     |
|                              | EpicChain        |                                     |
|                              | Blockchain    |                                     |
|                              +----------------+                                     |
|                                                                                      |
+--------------------------------------------------------------------------------------+

Key Components and Their Functions

  1. API Layer (epicchain-api):

    • Provides comprehensive REST, GraphQL, and WebSocket interfaces allowing applications seamless interaction with the service layer.
  2. Service Layer:

    • Constitutes the backbone of EpicChain Service Layer by facilitating several core operations.
    • Core Services (epicchain-core): Fundamental services essential for platform operations.
    • EpicChain Services (epicchain-services): Tailored services ensuring optimal functioning for EpicChain blockchain.
    • Oracle Service (epicchain-oracle): Links smart contracts with off-chain data sources.
    • TEE Service (epicchain-tee): Ensures computation security within trusted environments.
  3. Integration Layer:

    • Establishes connectivity between service layer operations and the underlying EpicChain blockchain.
    • Event Processing (epicchain-event): Manages information flow from blockchain events and associated triggers.
    • Worker (epicchain-worker): Executes functions responding to events, maintaining ecosystem fluidity.
    • Storage (epicchain-store): Provides persistent storage framework for enhanced data retention.
    • Cryptographic Services: Facilitates secure operations with FHE and ZK services tailored for privacy.
  4. EpicChain Blockchain:

    • Serves as the foundation upon which service layer protocols and functionalities are integrated.

Application Interaction Flow

Diagram of Interaction Flow

+-------------------------------------------------------------------------------------+
|                EpicChain Service Layer Application Interaction                      |
+-------------------------------------------------------------------------------------+
|                                                                                     |
|     +----------------+                                                              |
|     | Applications   |                                                              |
|     | - dApps        |                                                              |
|     | - Wallets      |                                                              |
|     | - User         |                                                              |
|     |   Interfaces   |                                                              |
|     +-------+--------+                                                              |
|             |                                                                       |
|             | 1. API Requests (REST/GraphQL/WebSockets)                             |
|             v                                                                       |
|     +----------------+                                                              |
|     | API Layer      |                                                              |
|     | (epicchain-api)|                                                              |
|     +-------+--------+                                                              |
|             |                                                                       |
|             | 2. Service Requests                                                   |
|             v                                                                       |
|     +----------------+    +----------------+    +----------------+                 |
|     | EpicChain Services  |   | Oracle Service |   | TEE Service    |               |
|     | - EpicPulse Bank    |   | - Price Data   |   | - Secure       |               |
|     | - Meta Tx           |   | - Random      |   |   Computation  |               |
|     | - Abstract Account  |   | - Custom Data |   | - Attestation  |               |
|     +-------+--------+    +-------+--------+    +-------+--------+                 |
|             |                     |                     |                          |
|             | 3. Process          | 3. Process          | 3. Process               |
|             |    Requests         |    Requests         |    Requests              |
|             v                     v                     v                          |
|     +----------------+    +----------------+    +----------------+                 |
|     | Event          |    | Worker         |    | Cryptographic  |                 |
|     | Processing     |    | - Execute      |    | Services       |                 |
|     | - Triggers     |    |   Functions    |    | - FHE          |                 |
|     | - Notifications|    | - Process      |    | - ZK           |                 |
|     +-------+--------+    +-------+--------+    +-------+--------+                 |
|             |                     |                     |                          |
|             | 4. Blockchain       | 4. Blockchain       | 4. Blockchain            |
|             |    Integration      |    Integration      |    Integration           |
|             v                     v                     v                          |
|     +-------------------------------------------------------------------+          |
|     | Integration Layer                                                |          |
|     | - Blockchain Connectors                                          |          |
|     | - State Synchronization                                          |          |
|     | - Event Monitoring                                               |          |
|     +---------------------------+-----------------------------------+----+         |
|                                 |                                      |
|                                 | 5. Blockchain Transactions            |
|                                 v                                       |
|                        +----------------+                               |
|                        | EpicChain       |                              |
|                        | Blockchain    |                              |
|                        +----------------+                              |
|                                                                            |
+-------------------------------------------------------------------------------------+

Detailed Application Interaction Steps

  1. Entry Points for Applications:

    • dApps: Decentralized applications developed on the EpicChain blockchain platform.
    • Wallets: Wallet solutions compatible with EpicChain, facilitating secure and straightforward interactions.
    • User Interfaces: Custom-designed frontends crafted to augment user interaction with EpicChain services.
  2. API Communication Methods:

    • REST API: Offers a set of standard HTTP endpoints facilitating seamless transactions and operations.
    • GraphQL: Deploys a versatile query language for data retrieval, enabling complex requests and better handling.
    • WebSockets: Supports real-time event streaming, ensuring seamless communication and notification delivery.
  3. Interaction Flow Dynamics:

    • Applications initiate requests towards the API Layer by employing REST, GraphQL, or WebSocket protocols.
    • The API Layer authenticates these requests, validating and precisely routing them to the fitting service components.
    • Essential service components undertake processing of the requests, ensuring proper blockchain connectivity and execution.
    • Results are thereafter communicated back to the initial application requestors through the same unified channel.
    • Real-time updates and data streams are managed through WebSocket connections, optimizing user and application experiences.
  4. Common Scenarios for Application Use:

    • EpicPulse Management: Applications employ services from the EpicPulse Bank to oversee and regulate transaction fees effectively.
    • Meta Transactions: Implement gasless transactions, enhancing user experience (UX) across various interfaces.
    • Data Integration Feeds: Applications utilize oracle services to access extensive datasets, including price updates and external information.
    • Secure Computation Operations: Applications leverage TEE environments to perform computations confidentially.
    • Event Monitoring Solutions: Subscribe and monitor blockchain events alongside associated triggers for detailed insights.
    • Privacy-Oriented Operations: Applications leverage ZK and FHE services for privacy and confidentiality preservation.
  5. Enhanced Developer Experience:

    • Multi-language SDKs for JavaScript, Python, and Rust, optimizing cross-language development experience.
    • Comprehensive documentation paired with practical examples, streamlining development processes.
    • Local development environments outfitted with blockchain simulators, facilitating immediate deployment testing.
    • Integration with pre-production environments, allowing seamless transition and testing through testnet support.

Key Features

  • Holistic EpicChain Services: Specially curated services to meet the nuanced needs of EpicChain blockchain-based applications.
  • Seamless Blockchain Integration: Provides strong linkages, ensuring efficient interactions across both EpicChain and Ethereum blockchain architectures.
  • Secure Execution Environments: Facilitates isolated execution surroundings that promote blockchain operation security.
  • Event-Driven System Architecture: Enables services to trigger based on event occurrence, scheduled timings, or specified market conditions.
  • Integrated Service Suite: Features a comprehensive set of services designed for supporting common blockchain-driven operations.
  • Trusted Execution Environment (TEE): Embeds state-of-the-art secure computing technologies like Intel SGX and AWS Nitro.
  • Zero-Knowledge Computing: Leverages cutting-edge ZK-SNARK implementations for computations focused on data privacy.
  • Fully Homomorphic Encryption: Offers unmatched computational capabilities on encrypted data, preserving privacy without decryption requirements.
  • Meta Transactions: Ensures the execution of gasless transactions on both EpicChain and Ethereum, adhering to standardized procedures like EIP-712.
  • Secret Management Utilities: Safeguarding and effectively managing sensitive data configurations.
  • High-Performance Storage Facilities: Incorporates RocksDB-based persistent data storage framework for reliable data management.
  • Custom Rules and Triggers: Define intricate triggers sourcing from multiple event origins, fostering conditional activity.
  • Automated Contract Execution: Facilitates programmable smart contract execution aligned with specific triggers and conditions.

Service Components

Core Services

  • Balance Management: Offers precise tracking and management tools for user service balances.
  • Identity Verification: Ensures intrusive security measures for user authorization and authentication processes.
  • Pricing Service: Offers dynamic real-time pricing solutions for all service resources.
  • Indexing Service: Efficient data curation and indexing, supporting swift retrieval processes.
  • Bridge Operations: Facilitates cross-chain asset and data transfers, promoting interoperability.

EpicChain Blockchain Services

  • Oracle Service (epicchain-oracle): Bridges gap between off-chain data sources and smart contract functionality.
    • Delivers price feeds for currencies like XPR/USD, XPP/USD, BTC/USD, ETH/USD, etc.
    • Offers secure random number generation and integration of custom data sources.
  • EpicPulse Bank: Financial mechanisms to compensate user transactions on the EpicChain.
  • Meta Transaction Service: Encourages operation of gasless transactions across multi-chain ecosystems.
    • Facilitates EpicChain meta transactions methodology.
    • Supports Ethereum-based meta transactions, inclusive of EIP-712 standards.
  • Abstract Account Service: Advanced account management toolset incorporating social recovery features.
  • Auto Contract Service: Enacts automatic smart contract execution functionalities based on pre-set triggers.

Cryptographic Services

  • Trusted Execution Environment (TEE) (epicchain-tee): Enriches secure computing environments with:
    • Fully supported Intel SGX modules.
    • AWS Nitro compatibility for secure operation.
    • Attestation verification to ensure integrity.
    • Advanced key management mechanisms.
  • Zero-Knowledge Computing (epicchain-zk): Implements privacy-enhanced computations through:
    • ZoKrates, Bulletproofs, Circom/SnarkJS, Bellman, and Arkworks integrations.
  • Fully Homomorphic Encryption (epicchain-fhe): Facilitates encrypted data computation with:
    • TFHE and OpenFHE implementation, providing robust security across computations.

Event Processing

  • Event Sources (epicchain-event): Captures events stemming from various interconnected sources, such as:
    • Events within EchoChain and Ethereum blockchains.
    • TIme-based and market-oriented event notifications.
    • Custom user-defined event formulas.
  • Trigger Service: Configure and analyze complex triggers spanning multiple dimensions.
    • Embrace blockchain, time schedule, market condition, and custom architectural triggers.
  • Worker Service (epicchain-worker): Delegates and executes function operations efficiently in response to relevant events.

Getting Started

Prerequisites

To embark on effective installation, the prerequisites to install and operate EpicChain Service Layer seamlessly include:

  • Node.js (version 16 or higher)
  • Rust Compiler (version 1.60 or higher)
  • Docker (optional, supporting containerized deployment specifications)

Installation Process

Follow the detailed steps below to successfully install and configure the EpicChain Service Layer infrastructure:

# Clone the repository for EpicChain Service Layer
git clone https://github.com/epicchainlabs/epicchain-service-layer.git
cd epicchain-service-layer

# Install all necessary dependencies
cargo build

Development Environment Setup

The procedure for setting up an efficient development environment includes:

  • Utilizing DevContainer settings for optimal experience:
# Launch within VS Code using DevContainer support extensions
code .
# Proceed to "Reopen in Container" when notified
  • Alternatively, establish development environments using Docker Compose:
# Initialize the environment setups
docker-compose -f docker-compose.dev.yml up

Running Tests

Post installation, engage in verification by running a spectrum of tests across the different components:

# Execute complete test suite
cargo test

# Execute targeted package-specific tests
cargo test --package epicchain-services
cargo test --package epicchain-oracle

Deployment for Production

Guidelines for deploying within production environments:

  • Engage Docker Compose for seamless production deployment:
# Activate production environment protocols
docker-compose -f docker-compose.prod.yml up -d
  • Furthermore, support for Kubernetes deployment configurations exists within k8s and helm directories.

In-Depth Documentation

In addition to above guidance, extensive documentation is available, covering various dimensions of EpicChain Service Layer management and implementation:

Application Examples

Explore illustrative case examples contained within the examples directory to understand the diverse application scopes of EpicChain Service Layer:

Licensing Information

EpicChain Service Layer is available under the MIT License, facilitating open contribution and adaptability. More details can be found in the project’s LICENSE documentation.

Contributing to EpicChain Service Layer

The framework warmly welcomes contributions. To contribute, adhere to the below pointers:

  • Submit pull requests iteratively ensuring the inclusion of detailed change documentation.
  • Engage in well-structured dialogue through issue discussions and feature suggestions, fostering community engagement and enhancing user experiences.
  • Active contribution to refining and expanding documentation aligned with project advancements.

About

The EpicChain Service Layer is a high-performance, blockchain-native infrastructure designed to bridge EpicChain and Ethereum-based applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published