Viem-go brings a modern, high-level Ethereum developer experience to the Go ecosystem — inspired by the architecture and abstractions pioneered by TypeScript viem.
Viem-go blows TypeScript viem out of the water in every benchmark we ran. Benchmarks are run against the same Anvil instance (mainnet fork) for a fair comparison.
| Metric | Go (viem-go) | TypeScript (viem) |
|---|---|---|
| Geometric mean speedup | 7.12x | - |
| Avg ns/op | 2,020,982 | 10,567,395 |
| Avg ops/s | 495 | 95 |
| Wins | 59/59 | 0/59 |
See the Performance page for interactive charts, per-test analysis, and full results across all 9 suites.
go-ethereum is excellent for low-level operations, but it can be verbose for common tasks. viem-go provides higher-level abstractions while still using go-ethereum under the hood for cryptographic primitives.
1// Reading an ERC20 balance2balance, _ := client.ReadContract(ctx, client.ReadContractOptions{3 Address: "0xA0b86991c...",4 ABI: abiJSON,5 FunctionName: "balanceOf",6 Args: []any{ownerAddress},7})Viem-go was built with simplicity and composability in mind. Thats why we decided to build from the roots of the very sucessful TypeScript viem library. Neary every ethereum developer knows of or has expereience wth viem. The Golang developer ecosystem doesnt have such an equivilent resource for ethereum dev. So we decided to fix that that building on top of what is currently the industry standard.
When possible, viem-go uses the same function names, option structs, and patterns as viem. This makes it easy to translate examples and share knowledge between TypeScript and Go codebases.
While mirroring viem, we embrace Go conventions:
context.Context as its first argument. Use context.WithTimeout or context.WithCancel to control request lifetimes and avoid hanging calls.viem-go doesn't reinvent cryptographic wheels. It des howeevry optimise for small things in the go-ethereum library that are tailored specifically for viem-go's usecase that otherwise would be unfeasable to optimise for in go-ethereum. It uses go-ethereum for:
viem-go is under active development. Current features include:
Ready to dive in? Head to the Getting Started guide to set up your first viem-go project.