Huff Basics - Video introduction to Huff (programming language)

Huff Basics - Video introduction to Huff (programming language)

Huff is an extremely low-level language for writing smart contracts. It compiles to EVM bytecode, so it functions on all blockchains that run an EVM. It is designed to make extremely gas-efficient smart contracts, at the cost of user-readability and developer sanity. It is similar to solidity assembly, with the notable distinction that it uses “macros”, which can be easily tested on their own.

Huff was developed by the AZTEC protocol team while writing their Weierstrudel smart contract.

AZTEC don’t currently have any Huff code in production; they wrote Huff so that they could implement semi-efficient elliptic curve cryptography, but EIP-1108 solved that problem for them.

Disclaimer from the AZTEC team

Huff was designed with a complete disregard for semantics, safety or basic consistency. Any similarities to production code are purely incidental and Huff should on no account be used by anybody.

Video Presentation

Huff Basics

Slides

Huff Basics

Factual corrections

The "takes/returns" structure actually is not validated by the compiler, and the Aztec team does not actually have any Huff code in production.

1 Like

Also see Huff resources:

1 Like