Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

README.md

7.18 Kb · 92 lines

Gnoël

Twenty-four riddles, sealed guesses, and one very small VM. Gnoël is an Advent calendar for Gnomes: the organizer opens each door with a transaction, and every opened door stays playable. GnoWeb serves the calendar, a page for each riddle, its public seals, and the Nice List. The rich app adds the wallet flow, personal progress, and a live calendar.

GnoWeb on Onyx · GnoWeb beta · Rich app beta

Play

Connect Adena or use a local gnokey account. Get test GNOT from the Onyx faucet. Choose an open door and type an answer. Outer ASCII whitespace is ignored. Spelling, accents, and case matter.

Each address can have one pending guess per door. A player can replace it before review. A miss allows a new guess. A solve earns one point and closes that door for the solver. The Nice List shows the first 24 scores, with address order breaking ties. A day’s solve count is the number of addresses that solved it.

Open doors and review seals

On Onyx and Moul’s GnoDev, the dedicated organizer is the testnet deployment account. Other chains default to the home realm’s admin. The organizer can delegate door publishing and corrections through SetPublisher and delegate verdicts through SetOracle. Both roles initially belong to the organizer. The companion lives in tools/gnoel. It prints commands by default and invokes gnokey interactively with -run.

Create a private key and its public companion outside the checkout:

1go -C tools tool gnoel keygen -key /path/to/private/gnoel.pem

Open a door with one transaction. The tool schedules the first review one hour after the door opens. Use absolute paths because Go executes the tool from tools/.

1go -C tools tool gnoel publish -day 1 -title 'A Tiny Runtime' \
2  -clue /path/to/door-01.txt -public /path/to/private/gnoel.pem.public -run

For a typo in an open door, send the corrected clue as a text file. The title, review schedule, oracle key, attempts, and scores are kept.

1go -C tools tool gnoel edit -day 1 -clue /path/to/door-01.txt -run

Keep a private solutions JSON file beside the PEM. Each entry contains the winning strings and the key used for that door. You can reuse the key across doors or rotate it for a new door.

1{
2  "1": {"key": "gnoel.pem", "answers": ["example answer", "accepted variant"]}
3}

Run the oracle every 15 minutes. Its first observation of each seal starts a one-hour waiting period. A replacement restarts the hour. The oracle keeps its observation timestamps alongside the private solutions file and reviews consecutive eligible guesses in order. Supply -day N to review only one door. Omit -run to inspect the proposed transactions.

1go -C tools tool gnoel review -solutions /path/to/private/solutions.json -run

For the GnoDev beta, add -chain moulstaging-1 -rpc https://rpc.gno-staging.moul.p2p.team -realm gno.land/r/moul/advent/v1. On a paused GnoDev, a review becomes available once a new block carries a timestamp past the cutoff. Use -signer for your gnokey name. A terminal-only player can use gnoel seal -day N -address g1… -answer /path/to/guess.txt. Add -replace for a pending guess.

What the public sees

The browser generates a fresh 32-byte random salt for every guess. SHA-256 binds the answer and salt to the network, realm, door, and wallet address. RSA-OAEP encrypts only the salt for the oracle, with the commitment as the OAEP label. The transaction contains the hash and ciphertext. The wallet sees those same fields.

The oracle decrypts the salt and tests the organizer’s accepted strings against the commitment. It publishes only a verdict for each ID. Anyone can read the commitments and verdicts. The oracle’s attestation is trusted. The private key can reveal the salts, so keep it and the solutions file out of Git and retain them for late guesses.

Calendar(), Leaders(), Progress(address), and paginated Attempts(day, start) give clients a public view of the same state as GnoWeb. The oracle includes a fingerprint of each batch in its review transaction, so replacing a pending guess invalidates any review computed against the old seal.

Versions

Each version asks r/moul/releases whether it is still the latest, under the project name advent. Its pages open with the registry's banner when it is not, and the home page links the stage of every version. From v2 on, Publish, UpdateClue, Submit and ReplaceGuess refuse once the version is past a deprecation sunset, yanked or vulnerable. Review only stops when the version is yanked or vulnerable, so the seals sent before a sunset still get their verdict. SetPublisher and SetOracle never stop, so a leaked key can be rotated on any version.

v0 and v1 predate the guard and cannot gain it: they are listed and labelled, and only the stage page says they are old. The project is opened by an owner call, not seeded, because the registry's code is frozen. On each chain, the address that should administer the calendar sends, in order:

NewProject("advent", "Gnoël, the advent calendar")
AddRelease("advent", "v0", "<v0 path>", "", "first calendar, its seals carried over to v1", "supported")
AddRelease("advent", "v1", "<v1 path>", "", "agent-managed doors, replaceable seals, first-solve points", "supported")
Deprecate("advent", "v0", "superseded by v1, which carried its seals over", <height>)
SetSuccessor("advent", "v0", "v1")
AddRelease("advent", "v2", "<v2 path>", "", "asks the registry for its banner and write guard", "draft")

v2 stays a draft until it carries the game. Then SetStatus("advent", "v2", "supported", "") makes it the latest, and Deprecate("advent", "v1", ...) gives v1 its sunset.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

On mainnet: deployment status transactions unique callers deployed revision

Dependency graph:

gno.land/r/moul/advent/v2 dependency graph

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.