v0 source realm
Package dev is the chain as a Plan 9 device tree.
View source
gno.land/r/moul/x/plan9/dev/v0
The chain as a Plan 9 device tree. Everything a realm normally reaches
through an import of chain/runtime is published here as a file instead, so it
can be read, listed, bound and unioned like anything else.
cat /dev/sysname the chain id
cat /dev/height the block height
cat /dev/session what a delegated key is allowed to touch
| device | contents |
|---|---|
caller |
pkgpath of the realm that crossed into this read |
domain |
the chain domain |
drivers |
the table itself |
height |
current block height |
null |
always empty |
random |
sha256 of chain id and height, hex; block-deterministic, not unpredictable |
session |
the calling key's session scope, one AllowPath per line |
sysname |
the chain id |
time |
block time, RFC3339 |
user |
the origin caller's address |
zero |
endless NUL bytes; reads exactly what you ask for |
A device is code, not storage: reading /dev/height runs a function, so it is
never stale.
The cross-realm mount
This realm posts its tree to
r/moul/x/plan9/ns's /srv at deploy
time, so any account can bind it into their own namespace and nobody has to
import this realm to use it:
bind /srv/dev /dev
That is the mechanism the whole experiment turns on: an interface value
published by one realm, stored by another, and called back later from a
read-only Render. Gno has no dynamic dispatch by path, so a mount cannot be a
client pulling a server by name; /srv is not a convenience here, it is the
only available mechanism, which is a pleasing accident.
The tree is read-only, like every synfs
tree: the files have no Write, so grafting this into a stranger's namespace
cannot be turned into a write against this realm.
Why /dev/session is the interesting one
A gno.land account session is a delegated key scoped to a list of path prefixes. That is Plan 9's "the namespace is the capability set", rediscovered thirty-four years later, minus the ability to look at it as a tree. This file prints it.
Design and analysis: moul/gno-contracts#136.
Not affiliated with Plan 9. Plan 9 from Bell Labs is the work of the Computing Science Research Center at Bell Labs; the name and the marks are theirs, and the copyright is held by the Plan 9 Foundation. This realm borrows the vocabulary and none of the code: it is an independent homage, asking what that ecosystem's spirit looks like on a chain. Full attribution: NOTICE.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
Dependency graph:

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Package dev is the chain as a Plan 9 device tree.
In Plan 9 a device is not storage, it is code behind a name: reading /dev/time runs a function. Everything a gno realm normally reaches through an import of chain/runtime is published here as a file instead, so it can be read, listed, bound and unioned like anything else:
Example
1cat /dev/sysname the chain id
2cat /dev/height the block height
3cat /dev/session what a delegated key is allowed to touch
The tree is posted to gno.land/r/moul/x/plan9/ns's /srv at deploy time, so any account can bind it into their own namespace, and nobody has to import this realm to use it. That is the cross-realm mount the whole experiment turns on: an interface value published by one realm, stored by another, and called later from a read-only Render.
It is READ-ONLY, like every synthetic tree: the files have no Write, so grafting this into a stranger's namespace cannot be turned into a write against this realm.
/dev/session is the one to look at. A gno.land account session is a delegated key scoped to a list of path prefixes, which is Plan 9's "the namespace IS the capability" rediscovered thirty-four years later. Printing it as a file makes that visible.
NOTICE. Plan 9 from Bell Labs is the work of the Computing Science Research Center at Bell Labs; the name and the marks are theirs, and the copyright is held by the Plan 9 Foundation (https://p9f.org). This realm is not affiliated with, endorsed by, or sponsored by them, and contains no Plan 9 code: it borrows the vocabulary so that the design reads without a glossary, and it is an homage, asking what that ecosystem's spirit looks like on a chain. Full attribution: NOTICE.md at the root of moul/gno-contracts.
2
10
- chain/runtime stdlib
- chain/runtime/unsafe stdlib
- crypto/sha256 stdlib
- encoding/hex stdlib
- gno.land/p/moul/x/plan9/ninep/v0 package
- gno.land/p/moul/x/plan9/synfs/v0 package
- gno.land/r/moul/x/plan9/ns/v0 realm
- strconv stdlib
- strings stdlib
- time stdlib