wattsy

October 2021·Engineering

A generative-art engine in Solidity. In 2021 the engine worked, but the tokenURIs did not return the images yet.

Kohi

Kohi tests one question: can a contract draw an image from math when you ask for it?

Kohi is a graphics library in Solidity. It is an anti-aliased software rasteriser, similar to AGG, on fixed-point math: Fix64 (Q31.32), sine lookup tables, and an XorShift PRNG. Thus the EVM calculates curves, gradients, and flow fields deterministically. A C# version makes the same bytes.

mochi was a hand-modified geth client without gas limits, because at the time I hadn’t figured out how to get stepped or windowed calls under the gas limit. That was fixed in KVM1.

In 2021, code on the chain made the art. But the tokenURIs point off-chain. At first, Kintsugi and City Lights used the kohi.art API. Now all Kohi tokens point to IPFS, and no token calls kohi.art.

ChainToadz already returned a 36×36 GIF from the chain. A full painting is much more difficult, and I continue that work.

Kohi went live on 8 October 2021 with Kintsugi. Later, it also made City Lights (eepmon) and The Universe Machine (praystation).

2021-10-08 — Kohi goes live

The Kohi contract (symbol KOHI) deploys to mainnet with the first collection.

Receiptverified
projectKohi, on-chain generative-art engine (kohi-composer)
contract0xDf6e32D85d17e907e0DA157faB7C12788e7161Da (Kohi / KOHI · ERC-721)
networkEthereum mainnet
deployed8 October 2021 · block 13376094
deployer0xFDc91fE3f9fC29A8c53D2Bbb7dB39A29b2639736
stackSolidity AGG rasteriser · Fix64 (Q31.32) · SinLut256 · XorShift PRNG · mochi
deliverythe engine composes on-chain, but the minted tokenURIs resolve off-chain, now to IPFS only (no kohi.art calls). Full on-chain rendering is later work
verifycast call 0xDf6e32D85d17e907e0DA157faB7C12788e7161Da "name()(string)" --rpc-url <rpc>

The name() call returns Kohi.