Compatibility with the Ethereum Virtual Machine (EVM)¶
The Aurora Engine implements an Ethereum Virtual Machine (EVM) on top of the NEAR Protocol.
EVM address balances are denominated in ether (ETH) for compatibility with Ethereum.
See notes on gas.
||ECDSA public key recovery||Yellow Paper||✅|
||SHA-2 256-bit hash function||Yellow Paper||✅|
||RIPEMD 160-bit hash function||Yellow Paper||✅|
||Identity function||Yellow Paper||✅|
||Big integer modular exponentiation||EIP-198||✅|
||Elliptic curve addition||EIP-196||✅|
||Elliptic curve scalar multiplication||EIP-196||✅|
||Elliptic curve pairing check||EIP-197||✅|
This opcode currently does not return a real blockhash. However, it does respect the logic that a non-zero value is returned for the most recent 256 blocks (not including the current block). For all other inputs it returns zero. The non-zero value that is returned is computed based on the block height and properties of the Aurora Engine contract (chain ID and account ID). Concretely, as of #213, the value returned is
BLOCKHASH(h: u64) = sha256( 0x00 || h || chain_id || account_id )
|| is byte concatenation and it is assumed
h (a 64-bit number) is converted to bytes in big endian encoding.
The leading zero byte in the concatenation is a version byte which may change if a new blockhash scheme is introduced in the future.
chain_id depends on the network the Aurora Engine contract is deployed to (see networks table).
account_id is the name of the NEAR account where the contract is deployed (see the Engine ID column in the networks table).
This opcode returns the EVM address of the Aurora Engine.
For example, for the Aurora Engine deployment on the
COINBASE returns 0x4444588443C3a91288c5002483449Aba1054192b.
This opcode always returns zero, since NEAR is not a proof-of-work (PoW) network.
This opcode always returns 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff (2^256-1).
The Berlin hard fork is not yet supported. The EVM currently supports the feature set of the Istanbul hard fork.
BLOCKHASHopcode does not return the hash of an actual block (see above for details).
The Aurora Engine source code repository is at: github.com/aurora-is-near/aurora-engine.