📄️ 1. Zero, the Box, and the Natural Numbers
Box arithmetic starts at the bottom — not with variables or polynomials, but with the simplest thing that exists: nothing.
📄️ 1. Polynumbers
Box arithmetic begins with the natural numbers — zero and the counting numbers. No negatives, no fractions, no irrationals. Everything built from here stays in that world.
📄️ 2. Incommensurability — √2 and Integer Powers
Box arithmetic has no fractions, so quantities like √2 — numbers whose square is a natural number but which are not themselves natural numbers — require a different treatment than you might expect.
📄️ 4. Multivariate: Base Multinumbers
To go beyond one variable, Wildberger introduces base multinumbers — a family of primitive elements, one for each natural number index:
📄️ 5. From Encoding to Logic
The previous pages showed how to encode a polynomial as a box. Now we use those boxes to make assertions — to check that a condition holds rather than just compute a value.
📄️ 6. A Transfer with a Tax Rate
A linear conservation law: three parties hold balances, and the total must be preserved across every transaction.
📄️ 7. Constant Product Invariant
The AMM constant product curve is the multiplicative analogue of the linear conservation law from §6:
📄️ 8. Degree Truncation and Composability
SafeMath, PRBMath, and Q-number libraries each solve a real problem. SafeMath prevents integer overflow. PRBMath provides high-precision fixed-point arithmetic within a single protocol. Q-numbers give you a consistent decimal convention. None of them address what happens at the boundary between protocols — and that boundary is where the most damaging exploits live.
📄️ 9. Case Study: The Balancer V2 Hack
On November 3 2025, an attacker drained $128.64 million from Balancer V2's ComposableStablePool contracts across six networks in under 30 minutes. The root cause was a rounding error in the pool's upscaling function — not a logic bug, not a reentrancy, not a missing access check. The arithmetic itself was used as a weapon.
📄️ 10. Linear Algebra Primitives: Pixels, Vexels, Maxels
The polynumber layer of box arithmetic — Polynumber, Multinumber, degree truncation — gives us a powerful tool for encoding scalar invariants. But DeFi protocols do not operate on scalars alone. A portfolio is a vector of balances. A swap is a linear map between token spaces. A routing graph is a directed structure over token indices. These are linear-algebraic objects, and box arithmetic has a natural foundation for them that requires no fractions, no floating point, and no division.
📄️ 11. Case Study: Pixel-Algebraic Route Validation
Multi-hop swaps are one of the most common operations in DeFi. Routing USDC → BTC through an intermediate ETH pool requires the router to verify that the output token of each hop equals the input token of the next — a path connectivity check.