Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion LITEPAPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,43 @@ TODO: Motivation for Gno, limitations of existing blockchain platforms, and high
## Gno

### The Gno Language
TODO: Describe Gno as a Go-compatible language, supported features, determinism constraints, and why Go is the chosen abstraction.

Gno is approximately 99% compatible with Go 1.17. Developers write standard Go
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Gno is approximately 99% compatible with Go 1.17. Developers write standard Go
Gno is based on Go 1.17. Developers write standard Go

code with minimal modifications. The language enforces determinism through
careful restrictions on non-deterministic operations.

Determinism constraints:

- `time.Now()` returns block time, not system time
- No goroutines, channels, or concurrency primitives
- No OS, network, or filesystem access
- No reflection or unsafe operations
- TODO: continue this list

All standard Go types are supported: bool, int, uint, float32, float64, string,
arrays, slices, maps, structs, pointers, and functions.

TODO: Introduced keywords (address, etc).
TODO: chain/* stdlibs.
TODO: why Go is the chosen abstraction.
TODO: Document security implications of language-level constraints.

### The Gno Virtual Machine

Unlike traditional VMs that execute bytecode, GnoVM interprets the Abstract
Syntax Tree (AST) directly. Source code is parsed and stored on-chain as AST
nodes, making the execution model transparent and auditable.

When code is deployed:

1. Source is parsed into an AST
2. AST is type-checked and validated
3. AST nodes are stored on-chain (not compiled bytecode)
4. Execution walks the AST directly

This approach eliminates the compilation step that obscures intent in other
platforms. What you read is what executes.

TODO: Explain how GnoVM executes Gno code, its interpreter model, and how it differs from bytecode-based VMs.
TODO: Describe how determinism, isolation, and safety are enforced by the VM.

Expand All @@ -21,6 +54,26 @@ TODO: Describe how transactions are executed, lifecycle of execution, and runtim
TODO: Clarify how failures, reverts, and safety boundaries are handled.

### State and Persistence

Global variables are automatically persistent:

```go
package counter

var total int

func Add(n int) {
total += n
}
```

When `Add(5)` is called, `total` changes from 0 to 5. GnoVM detects this change
and commits it to the Merkle tree automatically. No `storage.set()`, no manual
encoding, no boilerplate.

This works for any Go type: structs, slices, maps, pointers. The entire object
graph rooted at package-level variables is tracked and persisted.

TODO: Explain how state is represented, how persistent objects are tracked automatically, and how changes are committed.
TODO: Describe persistence guarantees and security implications of automatic state tracking.

Expand Down