JarJar Protocol Execution Layer

Why verifiability matters?

The JarJar Protocol Execution Layer is an innovative off-chain solution designed to enhance smart contract capabilities while significantly reducing transaction costs. This layer combines a unique consensus mechanism with versatile execution options, allowing for complex computations and external data integration.

Consensus Mechanism

The execution layer employs a sophisticated off-chain consensus mechanism that ensures accuracy and cost-effectiveness.

Process Overview

  1. Computation: All nodes in the network compute the result independently.

  2. Result Sharing: Nodes share their results with each other.

  3. Voting: Nodes vote on the correctness of the results using a commitment consensus.

  4. Leader Election: A leader is deterministically elected based on multiple factors:

    • Quality of the answer

    • Deterministic randomness derived from the generation transaction digest

    • Amount of stake held by the node

  5. On-chain Submission: The elected leader is responsible for uploading the result on-chain.

  6. Contestation Period: A 10-second window is opened for other nodes to contest the uploaded result.

  7. Slashing: If the leader submits an incorrect result or if another node impersonates the leader, their stake is slashed on-chain.

Benefits

  • Drastically lowers settlement costs

  • Maintains deterministic outcomes

  • Ensures accuracy through multi-node verification

  • Provides a fair and stake-weighted leader election process

Execution Capabilities

The execution layer supports a wide range of computational tasks, making it a versatile tool for smart contract enhancement.

AI Model Integration

Smart contracts can request computations from various AI models supported by the network. This allows for on-chain decision making based on sophisticated AI algorithms.

Custom Code Execution

  1. Executable URL: Smart contracts can provide a URL pointing to a custom executable (e.g., Rust code).

  2. Argument Passing: The smart contract can send arguments to be used by the custom executable.

  3. Secure VM Environment: Custom code runs in a secure Virtual Machine environment.

  4. Internet Access: The VM has internet access, enabling various use cases such as web oracles.

Use Cases

  • Web Oracles: Fetch and process real-world data for on-chain use.

  • Complex Computations: Perform resource-intensive calculations off-chain.

  • AI-driven Decision Making: Integrate AI model outputs into smart contract logic.

  • Custom Logic Execution: Run specialized algorithms or business logic off-chain.

Integration with Smart Contracts

To utilize the execution layer, smart contracts submit requests specifying:

  1. The type of computation (AI model or custom executable)

  2. Necessary parameters or arguments

  3. URL of the custom executable (if applicable)

The execution layer processes these requests off-chain and returns the results for on-chain settlement, providing a seamless bridge between complex off-chain computations and on-chain logic.

Security Considerations

  • All nodes in the network are incentivized to provide accurate results to avoid slashing.

  • The contestation period adds an extra layer of security against malicious actions.

  • Custom code execution is isolated in secure VMs to prevent potential exploits.

Future Development

The JarJar Protocol team is committed to expanding the capabilities of the execution layer, including:

  • Supporting additional AI models

  • Enhancing the security and efficiency of custom code execution

  • Optimizing the consensus mechanism for even lower costs and higher throughput

By leveraging this advanced execution layer, JarJar Protocol aims to unlock new possibilities for decentralized applications, bridging the gap between traditional smart contracts and complex, data-driven computations.

Last updated