marmot

Marmot docs

20 pages, from the idea to the error codes

Concepts

The waiting room

Delay, ripeness, expiry, epochs and panic.

The delay

Set at creation, between 5 minutes and 30 days. Every announcement, including settings, ripens at block.timestamp + delay measured when it was announced. Changing the delay later only affects announcements made after the change.

Ripe, then expired

An announcement can be run from readyAt until readyAt + 14 days. After that it is dead. This stops an old forgotten announcement from being run months later by surprise.

Phases an announcement goes through

PhaseMeaningCan happen next
waitingAnnounced, not ripe yetveto, panic, cancel, owner rotation
readyRipe and not expired: anyone can run itexecute, veto, panic, cancel
expiredMore than 14 days after ripenothing
executedDonenothing
vetoedRefused by the guardiannothing
cancelledWithdrawn by the ownernothing
killedIts epoch is over (panic, or owner rotation)nothing

Epochs and panic

The vault keeps a counter, the epoch. Each announcement remembers the epoch it was made in. panic adds one to the epoch, which kills every pending announcement in one step. It does not touch money and it does not stop new announcements: it is "refuse everything announced so far".

A guardian's signed panic includes the epoch it was signed for. Once the epoch moves, that signature is worthless, so it cannot be replayed.

Owner rotation

When an announcement that changes the owner is executed, the epoch also moves. Everything the previous key announced is killed. This is how you recover from a stolen key: announce a new owner, let the guardian refuse the thief's announcements while yours ripens, run it, and the old key's leftovers die.

Choosing a delay

You areSuggested waitWhy
Testing5 to 30 minutesFast feedback. Not for real money.
Checking your phone every day12 to 24 hoursYou will see the alert on time.
Holding savings3 to 7 daysCovers travel and sleep. Withdrawals are rare anyway.
Holding for years14 to 30 daysA thief would need you absent for weeks.

The wait must be longer than the longest time you are ever unreachable. That is the whole trade.

About time

The vault uses block.timestamp, in whole seconds. On a rollup the sequencer sets it, within small bounds. A wait of minutes or more is not affected by that.