Project

What you sign

Every action on the site that needs a signature is a Solana transaction. This page lists, action by action, the programs it calls, the instructions, the accounts, the expected balance change and the network fee, so that you can compare them with your wallet's window.

  • The site never asks you to sign a message, only transactions. A wallet can simulate a transaction and show what it changes.
  • The site never asks for the secret phrase of your own wallet. The phrase of a wallet created on this site is entered only here: three of its words as a check right after creation, and all twelve when you restore that wallet. It stays in your browser.
  • The temporary key of “play without signatures” is kept in this browser's storage unencrypted. The program lets it do one thing on your behalf: place bets from your game balance, within the bet limit and until the session expires.

Connecting

Connecting signs nothing and sends no transaction: the wallet only tells the site its address.

Top-up from your wallet

Signed by
your wallet
Programs and instructions
  • Compute Budget: SetComputeUnitLimit, SetComputeUnitPrice
  • FAIRDRUM: register first top-up only
  • Associated Token: CreateIdempotent
  • System: Transfer
  • Token: SyncNative
  • FAIRDRUM: deposit(amount)
  • Token: CloseAccount
  • Memo: fairdrum-ref:<address> only when an invitation is being recorded
Accounts
Your wallet, your player account, the shared game account, the vault, and a temporary wrapped SOL account of your wallet that the same transaction creates and closes. When an invitation is being recorded, the inviter's address is added to the deposit instruction as a read-only account: it signs nothing and receives nothing.
Balance change
Wallet −amount, game balance +amount. The first top-up also pays about 0.0028 SOL to the network for your player record. About 0.002 SOL is taken as the network deposit of the temporary account and returned in the same transaction.
Network fee
about 0.000095 SOL at the default priority fee

A transfer to your personal top-up address needs no signature of yours: anyone may send the FAIRDRUM deposit_sweep instruction that credits it, and usually the house does. If you press the crediting button in the cashier, your wallet or the temporary key sends that one instruction. Out of such a transfer the program pays 0.00003 SOL to whoever sends the crediting instruction, usually the house. That is more than the base network fee of a transaction (0.000005 SOL); the difference covers the sender's priority fee, and what is left of it stays with the sender. The wrapped SOL account that a top-up closes is your wallet's ordinary one. If it already held wrapped SOL, closing it turns all of that into regular SOL in your wallet: nothing is lost, but it is no longer wrapped. The earlier form of withdrawal does the same.

Moving SOL from the wallet on this device

The same transaction as a top-up from your wallet. The key of the wallet on your device signs it in the browser, with no window, and about 0.01 SOL stays in that wallet for network fees.

Starting “play without signatures”

Signed by
your wallet
Programs and instructions
  • Compute Budget: SetComputeUnitLimit, SetComputeUnitPrice
  • FAIRDRUM: session_open(key, secs, limit)
  • System: Transfer
Accounts
Your wallet, your player account, the session record of your wallet and the temporary key created in this browser.
Balance change
Wallet −0.01 SOL: the temporary key's reserve for network fees. About 0.0015 SOL more is the network deposit of the session record. Closing the session (FAIRDRUM session_close, one signature) returns the deposit, and the temporary key then sends back what is left of its reserve.
Network fee
about 0.000021 SOL at the default priority fee

Round

Signed by
your wallet, the temporary key of a session, or the wallet on your device
Programs and instructions
  • Compute Budget: SetComputeUnitLimit, SetComputeUnitPrice
  • FAIRDRUM: spin_commit(n, use_free, mode)
Accounts
The signer, your wallet address, your player account, the shared game account, and the session record when the temporary key signs.
Balance change
Game balance −the round, from 0.1 SOL. The signer pays only the network fee. The settlement is a separate transaction that the house sends and pays for: it credits the prize to your game balance.
Network fee
about 0.000045 SOL at the default priority fee

Withdraw

Signed by
your wallet
Programs and instructions
  • Compute Budget: SetComputeUnitLimit, SetComputeUnitPrice
  • FAIRDRUM: withdraw_sol(amount)
  • System: Transfer only when you withdraw to another address
Accounts
Your wallet, your player account, the shared game account, the vault, the wrapped SOL mint and the program's own service account of wrapped SOL.
Balance change
Game balance −amount, wallet +amount in ordinary SOL. The program itself turns wrapped SOL into SOL inside this instruction; your wallet pays for no temporary account. There is no waiting period after a top-up. The wallet must hold about 0.001 SOL: the network fee and the smallest balance the network lets a wallet keep.
Network fee
about 0.00002 SOL at the default priority fee

If the program cannot take this instruction, the site sends the earlier form of the same withdrawal: Associated Token: CreateIdempotent, FAIRDRUM: withdraw(amount), Token: CloseAccount. Then the contract pays wrapped SOL to a temporary account of your wallet, and closing it in the same transaction turns it into SOL; the wallet needs about 0.002 SOL for that account's network deposit, which returns at once. The network rejects a withdrawal that would leave the receiving wallet with less than its minimum of 0.00089088 SOL: a smaller amount sent to a wallet that holds nothing fails, and nothing is deducted. A wallet that already holds the minimum, or a larger amount, works. When the game balance is below the smallest round, the cashier also offers to give the remainder to the project. That is this same withdrawal followed by a transfer to the administrator's address; the amount is shown before you confirm, and the transfer cannot be returned.

Withdrawing without this site

A withdrawal is one instruction of the program, signed by your wallet: withdraw_sol(amount) with the amount in lamports. Its accounts, in this order: your wallet (signer); the shared game account 2QYMsfTvKkrf9vtsrnbx6WbQKZBj4zbwn8HqS2B1Dov7; your player account (the program address derived from the seeds “player” and your wallet address); the vault Bhf8tXXrer3naZpDsx7LMxixCJcPpdxXzD5cE2NFM3G7; the wrapped SOL mint So11111111111111111111111111111111111111112; the program's service account (derived from the seed “unwrap”); the Token program; the System program. Any tool that builds a Solana transaction from the program's interface description can send it, and no other signature is needed. A ready script for this will be published in the public checker repository; it is not there yet.

Do not send SOL to the vault address. SOL sent straight to it is credited to nobody, and no command of the program can return it. Top up only through the cashier or your personal top-up address.

Bet refund for an unfinished round

Signed by
anyone; on this site your wallet or the temporary key, when you press the game's main button
Programs and instructions
  • Compute Budget: SetComputeUnitLimit, SetComputeUnitPrice
  • FAIRDRUM: spin_expire
  • FAIRDRUM: spin_seal a separate transaction when you return to an unsealed round; it moves no SOL
Accounts
The signer, your player account, the shared game account, the vault, the wrapped SOL mint and the network's list of recent block hashes.
Balance change
The bet returns to your game balance in full. The program accepts this only after the round's deadline has passed.
Network fee
about 0.000045 SOL at the default priority fee

Programs called

FAIRDRUM
5ww3w4HrQrrrPcjfxVRvjLpL5vBJqLt7M5ThsnEkkngf
System Program
11111111111111111111111111111111
Token Program
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Associated Token Program
ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL
Compute Budget Program
ComputeBudget111111111111111111111111111111
Memo Program
MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr

The site puts no other program into its transactions; a wallet may add its own protective instructions before signing. The priority fee the site sets is at most 0.0009 SOL per transaction.

Read on