← Back to home

EVM+

EIP: Decimal math for EVM. If EVM is a basic calculator, EVM+ is a scientific calculator.

Screenshots

EVM+ screenshot 1
EVM+ screenshot 2
EVM+ screenshot 3
EVM+ screenshot 4
EVM+ screenshot 5
EVM+ screenshot 6

Problem Statement

This EIP adds decimal float OPCODEs for arithmetic (DECADD, DECNEG, DECMUL, DECINV) and expression of all elementary functions (DECEXP, DECLN, DECSIN). All decimal values upto the maximal precision allowed by a int256 coefficient and exponent are represented exactly, as c*10^q. All implemented algorithms converge for all inputs given enough precision, as chosen by the user. All calculations are deterministic and gas is embedded bottom-up. Allowing high precision decimal elementary functions invites the worlds of mathematical finance, machine learning, science, digital art, games and others to Ethereum. The implementation is functional.

Solution

golang, fork of geth, GCP VM for public EVM+ node, Yul for smart contracts (Black-Scholes and Neuron), bottom-up gas calculation by wrapping uint256 lib, decimal math, Taylor series of exp and sin, continued fractions expansion of ln, scaling of ln input to interval ]0, 2], ethers.js and geth console for testing, all on stream.

Hackathon

ETHOnline 2023

2023

Prizes

  • 🏆

    🏆 ETHOnline 2023 Finalist

Contributors