ce-net / demos / budget key

A key with a spending limit.

An agent holds a key worth 100 units and calls three cells that cost different amounts. Every call is debited from one ledger keyed by the key's chain root. At 3 units left, a 5-unit call is refused by a cell that has never seen the key. Splitting the key into two keys worth 100 each is refused: attenuation can only lower the budget.

connecting…
100of 100 units left

Every debit and refusal

    The budget, as CAL

    waiting for a key…

    The issuer compiles this text with ce-net-proto's CAL compiler and signs it. The credits 100 clause is the budget. A child link can never carry more credits than its parent (the verifier's rule), and the ledger counts every child's spend against the parent too.

    Source, tests and the recorded run