Custom Precompiles

Summary: ADI Chain uses custom precompiles to provide complex features without the need to code them in Solidity, enabling more efficient performance of critical tasks. This allows the network to maximize its performance while also maintaining the ability to scale and offer complex features.

To enhance functionality and performance, ADI Network supports custom precompiled contracts in its EVM execution environment. Precompiles are special routines, deployed at fixed addresses, that execute complex operations much more efficiently than writing the equivalent in Solidity. They are essentially native code extensions to the Ethereum protocol. ADI’s modular node software allows adding new precompiles, which is particularly useful for operations like advanced cryptography that are not natively efficient in the EVM. By including custom precompiles, ADI Network can directly support certain use cases at the protocol level rather than through slow smart contracts.

ED25519 Signature Verification – located at address 0x000...0101. This precompile provides a function (e.g., verifySignature(bytes32 hash, bytes signature, bytes32 pubkey)) that returns true/false whether the signature is valid for the given message and public key. By having a native verifier, ADI enables smart contracts to verify ED25519 signatures in a single call, which would be infeasible to achieve in pure EVM code.

With these precompiles smart contracts on the ADI Network critical verification tasks can be executed with high performance. For example, an identity contract can verify a user’s off-chain credential signed with ED25519 in a single call to the precompile, enabling use cases like integrating national ID systems or verifying documents.

The benefits of custom precompiles include:

  • Performance Optimization: Heavy computations (such as hashing, signature checks, and encryption) are executed in optimized native code instead of EVM bytecode, resulting in drastically reduced gas and execution time. This means dApps can perform more on-chain operations without encountering block gas limits.

  • Enhanced Functionality: New cryptographic primitives or domain-specific operations can be supported. ADI’s chosen precompiles indicate a focus on digital identity and security use cases (aligning with compliance and identity modules). In the future, additional precompiles could be added (e.g., zero-knowledge proof verifiers, multi-signature schemes, and complex mathematical functions) to support emerging needs.

  • Modularity: Precompiles allow adding these features without hard-forking Ethereum or requiring changes from developers – they simply appear as addresses that contracts can call. ADI’s node is configured with these, but from a contract’s perspective, it’s just calling an address with specific data.

  • Scalability: By offloading expensive operations, the network can handle more complex transactions in the same block gas limit. For instance, verifying a batch of ED25519 signatures in a contract might be unthinkable normally. Still, via precompile, it becomes feasible, enabling on-chain verification of many off-chain events (necessary for bridging, oracle data authenticity, etc.).

Last updated