Concepts

Seats

Some protocols keep a position open after you act: a loan at Kamino stays there until it is repaid. A position needs an owner the protocol can see. In Pook that owner is a seat, an address no wallet controls, and the right to command it is a note in your private balance.

The two halves of a seat

A seat starts from a secret only you can derive. Its hash is the seat's commitment, and two addresses are derived from the commitment.

PartWhat it isWhere it lives
Seat secret32 bytes derived from your wallet's signature and the seat's number.On your device, and inside the seat note.
CommitmentA Poseidon hash of the secret.Public.
The seatThe address derived from seat and the commitment. It owns the position at the protocol and signs for it.Public. It holds no data.
Seat stateThe account derived from seat_state and the commitment. It records the commitment, the relayer that opened the seat and the time.Public, owned by Pook.
Seat noteA note that carries the secret.In your private balance, encrypted.

To the protocol a seat is an ordinary account. Kamino sees an obligation whose owner is the seat and treats it like any other.

Commanding a seat

A seat hook is run like any hook, with one addition: the proof presents the seat note. It shows that whoever made it holds a note whose secret hashes to the seat's commitment. The program then signs the call to the protocol as that seat.

Each run on a seat spends the seat note and creates it again under a new one-time key, so the right to command the seat moves forward with every action and stays yours.

Seat hooks come in two kinds, by which way the asset moves.

KindWhat the run doesLaunch hooks
Into the seatSpends your notes, sends the amount to the protocol through the seat's own token account, renews the seat note.kamino.collateral.deposit, kamino.repay
Out of the seatSpends no balance notes. The protocol pays the seat, and the result becomes a new note for you. Renews the seat note.kamino.borrow, kamino.collateral.withdraw

A hook has to be published as a seat hook to name the seat among its accounts. A flow hook cannot reach a seat.

Opening and closing

Opening is the instruction open_seat. Its proof shows you know the secret behind the commitment. The program creates the seat state account and reserves the commitment in Rings so it can be opened only once, and the first seat note is created for you. The relayer that submits it pays the rent for the seat state account and is recorded as the opener.

open_seat can also carry up to four setup calls to the protocol, signed by the seat. A Kamino seat uses them to create the seat's obligation in the same transaction, so the seat is ready for its first deposit the moment it exists.

You do not open a seat as a step of its own. Running kamino.collateral.deposit without naming a seat opens one first and then makes the deposit: two transactions from one press of Run, or one call of pook.run.

Closing is close_seat. Its proof spends the seat note without renewing it. The program closes the seat state account and returns its rent, with any SOL left on the seat, to the relayer that opened it.

Close a seat once its position at the protocol is empty: debt repaid and collateral withdrawn.

What a seat shows

A seat's address is public, and so is everything the protocol records under it: the collateral, the debt, each deposit and each borrow. Every run on a seat names it.

What ties the seat to a person is the seat note, and that is encrypted. No wallet appears in the seat's address, in its state account or in any run on it. The assets that enter a seat come from notes, and the assets that leave it become notes.

Seats in the app and the SDK

Seats lists each seat you hold with what it holds and owes at the protocol, and the hooks that act on it. The app finds your seats the way it finds your balance: it decrypts your seat notes on your device, then reads each seat's public position.

In the SDK the same list is pook.seats(), and pook.closeSeat(seatAddress) closes one.