Title | Author(s) | Type | Status | Creation Date | Contact Information |
---|---|---|---|---|---|
To Support *blake2b* Hashing in Solidity VM |
Rakesh Gohel |
ASC (Aion Standards and Conventions) |
DRAFT |
October 2, 2018 |
Need for a method to calculate blake2b hash in Aion solidity.
Aion kernel's internal hash function is blake2b and being so popular fast hash function should be accessible in the smart contract.
The primary motivation for the proposol is to support blake2b hash in bridge operator contract proposed in AIP-005. The signatories or validators and the bridge operator currently use blake2b hash when they sign bundles. Thus, when given list of transfer transactions and source block hash, the smart contract needs to have access to generate the blake2b hash and perform signature verfication.
The scope of this document is for supporting black2b hash function only for Aion kernel; the other hashing functions are not included.
The key indicator of success for this function can be measured by number of contracts using them. The bidirectional bridge has bridge operator contract which consumes this functionality.
The signatories or validators can use the Aion's ecosystem provided methods to sign and verify the bundles produced by bridge operator. The AION supports ED25519 curve with blake2b hash function.
The singatory
already has access to blake2b hash function from Aion Ecosystem. When a bundle is signed and sent to bridge operator contract, the bridge operator contract validates publicly on blockchain that whoever claims to be signatory is genuine entity. To verify the hash on blockchain using smart contract requires solidity to support this function through a method. Currently, Aion solidity does not have a capability to perform blake2b hashing.
N/A
- Bridge Operator: An organization(s) / project (s) / account that execute the required functions to enable a cross-chain transaction on behalf of the token holder
- Bridge Contract: A smart contract designed to receive, verify and emit events and signature bundles from/to a specific bridge
- Signatory/validator : The entity which independently goes to the source chain to verify the bundle transfer initiated by bridge operator.
A public
function must be implemented.
blake2b
function
Returns hash of the arguments (tightly coupled).
parameters
...
: Arguments.
returns: bytes32.
function blake2b(...) public returns (bytes32);
Tightly pack the arguments before initiating blake2b hash.
No cross chain function's involved for this AIP.
Compatibility notes:
Blake2b hash is natively available in Aion chain, but may not be the case with different blockchains. Thus if Aion contract needs to be ported on any Ethereum compatible smart contract, the destination blockchain's hash function should be used.
N/A
N/A
N/A
All AIP’s are public domain. Copyright waiver: https://creativecommons.org/publicdomain/zero/1.0/