🔲The Block Layer:UniChain
This section describes how the blockchain layer of UniAgent enhances both incentivisation and security.
UniChain Layer forms the core of UniAgent, offering the essential foundation for consensus, execution, and interoperability. This robust framework enables the development of on-chain smart agents that can seamlessly utilize off-chain resources and functionalities across various blockchain networks.
Unparalleled Features
Efficiency: Leveraging the Tendermint algorithm, UniChain offers enhanced performance with rapid block confirmation, fast average block times, and near-instant finality. We further optimize this foundation for real-time data processing and high-speed transactions, delivering an even more efficient blockchain solution.
Scalability: UniChain’s modular architecture supports horizontal scaling and Layer 2 solutions, including rollups, which help offload transaction processing from the main chain. By aggregating multiple off-chain transactions and submitting them in batches to the blockchain, rollups improve throughput and reduce costs. U ensures scalability without sacrificing security or decentralization, positioning UniChain to accommodate growing demand.
Interoperability: UniChain’s Cross-chain Communication Protocol enables secure, permissionless data transfer between different blockchains, eliminating the need for third-party intermediaries. This protocol facilitates trustless interactions, where anyone can act as a relay to transfer data across chains, further supported by cross-chain bridges that allow seamless asset transfers between networks.
EVM Compatibility: Fully compatible with the Ethereum Virtual Machine (EVM), UniChain enables developers to leverage Ethereum’s robust ecosystem, tools, and community. This compatibility allows developers to write and deploy smart contracts with ease, ensuring cross-chain compatibility with minimal changes to code. UniChain provides a powerful environment for building decentralized applications (dApps) efficiently.
Low Gas Fees: UniChain implements an optimized fee structure, reducing transaction costs through batching and dynamic fee mechanisms. As demand on the network increases, our goal is to maintain low, predictable gas fees, ensuring economic viability and fostering broader participation from both developers and users.
Incentivisation
The blockchain layer plays a pivotal role in reward distribution. It ensures that participants can securely lock in their stakes, fostering an environment of trust and transparency. The process is designed to incentivise participation by allocating rewards based on contributions, thus encouraging a more engaged and active community. Through the use of smart contracts, the system automates the rewards process, making it both efficient and fair. This automation not only reduces the potential for human error but also ensures that rewards are distributed in a timely and fair manner.
Parallel Transaction Execution in UniChain
UniChain processes transactions in parallel, offering an approach that may seem different from Ethereum's execution model, but without changing the outcome. Both platforms handle blocks in a comparable manner, where each block represents a sequence of transactions. The final state after processing transactions is consistent across both chains.
Optimistic Execution
At the heart of UniChain is an optimistic execution strategy, where transactions begin processing before previous ones in the same block are fully completed. While this can occasionally cause execution errors, it allows for more efficient transaction handling.
For example, consider two transactions in a block:
Transaction 1 updates the balance of account A (e.g., receiving funds from account B).
Transaction 2 updates the balance of account A again (e.g., transferring funds to account C).
If Transaction 2 starts before Transaction 1 finishes, it may read an outdated balance, leading to incorrect results. To resolve this, UniChain tracks the inputs used by Transaction 2 and compares them with the outputs of Transaction 1. If discrepancies are found, UniChain re-executes Transaction 2 using the corrected data. This ensures that, despite parallel execution, state updates are merged sequentially for accuracy.
This mechanism draws from principles in computer science, such as optimistic concurrency control (OCC) and software transactional memory (STM).
Implications of Optimistic Execution
In an optimistic execution model, re-execution typically occurs after all previous transactions in the block are completed. This ensures that state updates are fully merged, minimizing errors. Certain operations, like signature recovery, which are independent of the state, don’t need to be repeated during re-execution, saving on computational resources. If a transaction fails during re-execution, the account and storage data involved remain cached, reducing the need for expensive recalculations.
Scheduling
A basic optimistic execution model might begin processing the next transaction as soon as resources are available, which can lead to failures due to interdependencies. To optimize this, UniChain identifies transaction dependencies in advance and schedules them only after prior transactions are completed. Using a static code analyzer, UniChain predicts these dependencies to streamline scheduling. In cases where dependencies cannot be precisely predicted, UniChain reverts to a simpler execution approach.
Last updated