singnet / snet-upgradeable-owners-minting-policy

1 stars 1 forks source link

Protocol - Audit #13

Open Renegatto opened 2 months ago

Renegatto commented 2 months ago

SNet Protocol

Definitions

Owners agree with the tx - means that the transaction is signed by at least the threshold number of pubkeys associated with the list recorded in the state thread datum

Incorrect protocol state - a state in which some protocol requirements can be violated.

Well-formed state thread UTxO for protocol instance $p$ - a UTxO thread $p$ that contains a small amount of Lovelace, (close to min Ada per UTxO) and an always unique single NFT state thread token $nft\ p$, such that:

protocol instance $p$ is properly initialized iff the well-formed state thread UTxO $thread\ p$ is locked on UpgradeableOwners validator $uoValidator\ p$ address.

Prerequisites

All the requirements listed are only applicable to a properly initialized protocol instance.

Requirements

Legend:

⏹ EC0: Protocol must not stale

Staling is incorrect state, so given the precondition,

Require:

R0: After creation, there is always single NFT token in existence.

This is ambiguous and partially follows from ⏹EUO0.

⏹ R1: The token is held at UpgradeableOwners script.

Require:

❌ UO0. The minimum threshold is no greater than the number of owners and greater than 1.

Require either:

✅ UO1. Owners can set a new threshold number and change the set of owners in a single transaction.

IF they can do it, they can do it in a single Tx as well.

Follows from the code.

⏹ UO2. It is impossible to stall the protocol by creating an unspendable output.

The only UTxO required for the protocol functioning is the state thread UTxO. So Require:

⏹ UO3. As a token holder I can freely burn my tokens.

Require:

⏹ EUO0: State thread UTxO is always well-formed

Require:

Reasoning:

According to EUO6, put protocol into incorrect state means to produce state thread UTxO on which protocol violate some requirements. Therefore EUO1.

❌ EUO3: Tx that spend state thread UTxO require owners agreement

Require either:

❔EUO4: Well-formed state thread UTxO is always spendable

According to the well-formed state thread UTxO it can be made unspendable only by exceeding limits on its datum size.

Require:

Reasoning:

So require:

✅ EUO7: No Tx spending non-protocol UO UTxO can put protocol into incorrect state

Require: