Skip to content

Files

Latest commit

db405e5 · Oct 29, 2024

History

History
This branch is 71 commits ahead of statechannels/go-nitro:main.

protocols

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 27, 2024
Oct 29, 2024
Sep 27, 2024
Oct 29, 2024
Oct 8, 2024
Oct 15, 2024
Oct 15, 2024
Oct 29, 2024
Oct 9, 2024
Oct 29, 2024
Jun 26, 2023
Sep 24, 2024
Sep 27, 2024
Sep 27, 2024
Jun 26, 2023

Off-chain protocols

This package defines the off-chain protocols for managing channels. These protocols are abstract rules which nodes should follow in order to reach a desired goal.

To implement the protocols, we make use of an abstraction we call the Objective. Objectives are named for the goal which the off-chain protocol aspires to achieve.

The following table shows some example objectives and their implemetation status:

Objective type Implemented
direct-fund x
direct-defund x
virtual-fund x
virtual-defund x
challenge

The set of objectives comprises the functional core of a go-nitro node. They expose only pure functions -- but otherwise take on as much responsibility as possible, leaving only a small amount of responsibility to an imperative shell.

Each Objective type is implemented by a Go struct implementing the Objective interface. Each instance of an Objective type will hold its own data.

The imperative shell will typically be responsible for:

  • spawning new objective instances of one type or another
  • reading and persisting objectives to and from a store.
  • listening to peers and the blockchain for events relevant to the objective
  • "updating" objectives by passing events to their Update(event) function (an updated copy is returned)
  • "cranking" objectives by calling Crank() (side effects are returned)
  • executing side effects