Skip to content
Open app

ProtocolConfiguration

Configuration

Every value Talaria is configured with, on chain and off, its rules, its development default and who sets it.

Talaria has two kinds of configuration: the program's Config account, which every instruction reads, and the settings each off-chain service starts with. The values shown as development defaults are the local build's. On a running deployment the live on-chain values are read from GET /pool.

On chain#

ConfigArgs#

initialize and set_config take one ConfigArgs. Config stores these fields with the admin and the account's bump. Program accounts gives the account's layout.

message_feeu64
Lamports per message a pass can send. A pass costs its daily limit × its days × this fee. Development default.

RequiredDefault 10,000

relay_feeu64
Lamports the Vault pays the relay for each post. Development default.

RequiredDefault 7,500

protocol_share_bpsu16
The protocol's share of each pass sale, in basis points, sent to the FeeVault. Set at launch.

Required

tiers[u32; 3]
The daily limits a pass can have, in messages a day. buy_pass takes the tier as its index, 0 to 2; the API names them light, daily and frequent. Development default.

RequiredDefault 25 / 250 / 2,500

lengths[u16; 3]
The lengths a pass can be bought for, in days. Development default.

RequiredDefault 30 / 90 / 365

day_length_secondsu32
The length of a day. A day is the chain's Unix time divided by this, rounded down, and the day is what passes expire on and nullifiers are scoped to. Development default.

RequiredDefault 86,400

root_history_sizeu16
How many of the latest pool roots a post may prove against, from 1 to 64. Set at launch.

Required

Validation#

Every ConfigArgs is checked before it is stored. A failing rule refuses the whole instruction.

RuleError
message_fee and relay_fee are above zeroInvalidConfiguration
protocol_share_bps is at most 10,000InvalidConfiguration
message_fee × (10,000 − protocol_share_bps) ÷ 10,000 is at least relay_feeInsolventConfiguration
day_length_seconds is above zeroInvalidConfiguration
root_history_size is from 1 to 64InvalidConfiguration
Every tier and every length is above zeroInvalidConfiguration
Tiers strictly increase, and lengths strictly increaseInvalidConfiguration
The largest tier × the longest length × message_fee fits in a u64ArithmeticOverflow

The solvency rule means the part of a message's price that stays in the Vault always covers the relay fee, so every pass prepays the relay for every message it can send.

Who sets it#

  • initialize creates Config, the Pool, the Vault and the FeeVault once. Its signer must be the program's upgrade authority and becomes the admin.
  • set_config replaces every field at once, and only the admin may sign it. The admin stays the same. It replaces the day length too: existing passes' expiry days and nullifier days are then read with the new length.

Instructions gives the accounts of both.

The protocol share#

The protocol share and the developer allocation have no figure in this build. Both are set at launch: the share in Config, the allocation as the developer's own first buy at the token's fair launch. TALARIA covers what the share buys.

Off chain#

The SDK#

createTalaria takes these as options: apiUrl (required) and relayUrls (with none given, the relays GET /relays lists). .sol names resolve on the device through nameService: local, the local build's table and the default; sns, the SPL Name Service read over the client's own rpcUrl; or a table of the app's own. The API never sees a name. SDK reference gives every option.