Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalu committed Aug 1, 2024
1 parent a283456 commit 29bbdb1
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 43 deletions.
6 changes: 5 additions & 1 deletion docs/advanced/building_avs.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Building an AVS
---
title: Building an AVS
---

These documents will be filled out shortly as the software is dogfooded internally.
6 changes: 5 additions & 1 deletion docs/advanced/building_lrt.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Building an LRT
---
title: Building an LRT
---

These documents will be filled out shortly as the software is dogfooded internally.
16 changes: 0 additions & 16 deletions docs/architecture.md

This file was deleted.

Binary file added docs/assets/staked_venn_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 47 additions & 5 deletions docs/concepts/restaking_program.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,53 @@
title: Restaking Program
---

# Restaking Programfasjdflkasdf
### About the program

The restaking program acts as a registry for AVS, operators, and relationships between AVS, operators, and vaults.

It allows users to do the following:

- Registers AVS, operators, and their configurations.
- Stores relationships between AVS, operators, and vaults.

The restaking program does not store any funds; it is purely used as a registry and relationship manager between
entities in the system.

### AVS

AVS are services that provide infrastructure to the network, such as validators, oracles, keepers, bridges, L2s, and
other services that require a staking mechanism for security.

Actively Validated Services (AVS) can be registered through the restaking program.

There are several things one can do after registering an AVS:

- Add and remove support for operators participating in the AVS validator set.
- Add and remove support for vaults
- Add and remove support for slashers
- Withdraw funds sent to the AVS from rewards, airdrops, and other sources.

### Operator

Operators are entities responsible for running AVS software.

Operators can register through the restaking program and configure several variables:

- Add and remove support for vaults
- Add and remove support for AVS
- Change voter keys
- Withdraw funds sent to the operator from rewards, airdrops, and other sources.

### Relationships

The restaking protocol leverages the concept of entity tickets to track relationships between AVS, operators, and vaults
on-chain. This allows for an extremely flexible opt-in and opt-out system.
The Jito Restaking protocol requires mutual opt-in from all parties entering stake agreements: vaults, operators, and
AVS.

It leverages the concept of entity tickets, which are PDAs representing opt-in from one party to another. These tickets
are created on-chain and can be used to track relationships between AVS, operators, and vaults. In addition to entity
information, these tickets can store additional data like slot activated/deactivated, slashing conditions, and more.

The tickets are detailed below:

#### Operator AVS Ticket

Expand Down Expand Up @@ -75,8 +116,9 @@ graph TD

#### AVS Vault Slasher Ticket

This ticket represents the slashing relationship between an AVS and a Vault. It is created by the AVS, allowing the AVS
to potentially slash the Vault under certain conditions.
This ticket represents the slashing relationship between an AVS and a Vault.

AVS register slashers, which allows the slasher to potentially slash the Vault under appropriate conditions.

```mermaid
graph TD
Expand Down
Empty file removed docs/concepts/slashing.md
Empty file.
144 changes: 144 additions & 0 deletions docs/concepts/vault_program.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
title: Vault Program
---

## About the program

The vault program manages the liquid restaking tokens (LRTs) and associated deposits. The program stores deposited funds
and handles the minting and burning of tokenized stake.

The vault program allows users to do the following:

- Create LRTs (staked assets)
- Deposit assets and receive LRTs in return
- Burn LRTs to withdraw assets
- Manage delegations to operators
- Handle slashing events

The vault program stores user funds and is responsible for the issuance and redemption of LRTs.
Funds do not leave the program under any conditions unless they are withdrawn by the user or a slashing takes place.

## Vault

Vaults are the core entities that manage deposits, withdrawals, and LRT minting/burning.

Several operations can be performed with a vault:

- Initialize a new vault with specific parameters
- Add and remove support for operators
- Add and remove support for AVS
- Manage delegations to operators
- Process deposits and withdrawals
- Handle slashing events

## LRT (Liquid Restaking Token)

LRTs represent a user's share in the vault's assets.
They are minted when users deposit and burned when users withdraw.

## Relationships

The vault program interacts with other entities in the Jito Restaking protocol:

- Operators: The vault delegates to operators and manages these relationships
- AVS: The vault interacts with AVS for slashing and other protocol-specific operations
- Users: Deposit assets and receive LRTs, or burn LRTs to withdraw assets

The vault program uses similar ticket structures as the restaking program to manage these relationships, ensuring mutual
opt-in from all parties involved. Those tickets include:

#### Vault AVS Ticket

```mermaid
graph TD
classDef main fill: #f9f, stroke: #333, stroke-width: 2px;
classDef ticket fill: #fff, stroke: #333, stroke-width: 1px;
Vault[Vault]:::main
AVS[AVS]:::main
VaultAvsTicket[VaultAVSTicket]:::ticket
Vault -->|Creates| VaultAvsTicket
Vault -.->|Opts in| AVS
```

#### Vault Operator Ticket

```mermaid
graph TD
classDef main fill: #f9f, stroke: #333, stroke-width: 2px;
classDef ticket fill: #fff, stroke: #333, stroke-width: 1px;
Vault[Vault]:::main
Operator[Operator]:::main
VaultOperatorTicket[VaultOperatorTicket]:::ticket
Vault -->|Creates| VaultOperatorTicket
Vault -.->|Opts in| Operator
```

#### Vault AVS Slasher Ticket

```mermaid
graph TD
classDef main fill: #f9f, stroke: #333, stroke-width: 2px;
classDef ticket fill: #fff, stroke: #333, stroke-width: 1px;
Vault[Vault]:::main
AvsVaultSlasherTicket[AVSVaultSlasherTicket]:::ticket
Vault -->|Creates| VaultAvsSlasherTicket
Vault -.->|Recognizes and copies from| AvsVaultSlasherTicket
```

#### Vault AVS Slasher Operator Ticket

```mermaid
graph TD
classDef main fill: #f9f, stroke: #333, stroke-width: 2px;
classDef ticket fill: #fff, stroke: #333, stroke-width: 1px;
Vault[Vault]:::main
AVS[AVS]:::main
Slasher[Slasher]:::main
Operator[Operator]:::main
VaultAvsSlasherOperatorTicket[VaultAVSSlasherOperatorTicket]:::ticket
Vault -->|Creates| VaultAvsSlasherOperatorTicket
Vault -.->|Tracks slashing for| AVS
Vault -.->|Tracks slashing by| Slasher
Vault -.->|Tracks slashing of| Operator
```

## Delegations

The vault program manages delegations to operators. This involves:

- Adding new delegations to operators
- Removing delegations from operators
- Updating delegations at epoch boundaries

Delegations are stored in the VaultDelegationList.

## Slashing

The vault program handles slashing events, which may occur if an operator misbehaves. This includes:

- Processing slash instructions from authorized slashers
- Adjusting the vault's total assets and individual delegations
- Ensuring the integrity of the LRT exchange rate
- Respects the maximum slashing conditions set by the AVS

## Tracking State

State in these programs is spread out across many accounts.
To reason about the state of stake at any given time, one can reference the chart below.

Assets are considered staked iff:

- The AVS has opted-in to the operator
- The operator has opted-in to the AVS
- The operator has opted-in to the vault
- The vault has opted-in to the operator
- The vault has opted-in to the AVS
- The AVS has opted-in to the vault
- The Vault is delegated to that operator

When assets are staked and the following conditions are met, the vault can be slashed by a given slasher:

- The AVS has opted in to a slasher for the given vault.
- The vault has agreed to the conditions set by the AVS for slashing the vault.

![img.png](../assets/staked_venn_diagram.png)
24 changes: 4 additions & 20 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
# Jito Multi-Asset Restaking on Solana
---
title: Jito Restaking and Vault Program
---

Welcome to the documentation for Jito's Multi-Asset (Re)staking project on Solana. This project implements a
next-generation (re)staking platform for Solana and SVM environments.

## Overview

Jito Restaking is a comprehensive framework for staking, restaking, and liquid restaking on the Solana blockchain. It
provides a flexible and secure way to manage assets across multiple operators and actively validated services (AVS).

### Key Features

- Universal framework for staking and restaking **any** SPL token on Solana
- All stake is tokenized into a receipt token representing the staked assets (LRT)
- Customizable slashing conditions and administration across all functionality.
- Flexible AVS and operator management
next-generation (re)staking platform for staking SPL tokens on Solana and SVM environments.

## Core Concepts

Understanding these core concepts will help you navigate the Jito Restaking ecosystem:

- [(Re)staking Explained](restaking.md)
- [Architecture](architecture.md)
- [Restaking Program](concepts/restaking_program.md)
- [Vault Program](concepts/vault_program.md)
- [Slashing](concepts/slashing.md)

## Developer Resources

- [Testing](development/testing.md)

## Advanced Topics

Expand Down
Empty file removed docs/installation.md
Empty file.
11 changes: 11 additions & 0 deletions docs/restaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Overview

Jito Restaking is a comprehensive framework for staking, restaking, and liquid restaking on the Solana blockchain. It
provides a flexible and secure way to manage assets across multiple operators and actively validated services (AVS).

### Key Features

- Universal framework for staking and restaking **any** SPL token on Solana
- All stake is tokenized into a receipt token representing the staked assets (LRT)
- Customizable slashing conditions and administration across all functionality.
- Flexible AVS and operator management

0 comments on commit 29bbdb1

Please sign in to comment.