inicasino.netContents

On-chain games · 13 / 23

How to verify a Solana game transaction in an explorer

A block explorer is a website that displays what a network node returns for a transaction. The names on screen vary a little between explorers. The record underneath is the same, and this page follows the record.

Outline of a record: Signatures; Message; Account addresses; Recent blockhash; Instructions; Result; Status; Fee; Balances before and after; Inner instructions; Log messages; Slot and block time.
The fields of a transaction record and seven steps for comparing a round with it.

Looking up a transaction needs its signature and nothing else. No explorer needs your wallet to be connected, and none needs a secret phrase or a private key. Close any page that asks for one.

What a transaction record contains
  • Signatures One per required signer. The first is the transaction ID you search for.
  • Message The content that was signed.
    • Account addresses The accounts the instructions use, including the programs. A versioned transaction can load further accounts from address lookup tables; explorers list those separately.
    • Recent blockhash Acts as a timestamp. A transaction with an old one is rejected.
    • Instructions Each names a program, the accounts passed to it and a block of data.
  • Result Recorded by the network after execution.
    • Status Success, or the error that stopped it.
    • Fee What the fee payer was charged.
    • Balances before and after One pair per account, in lamports.
    • Inner instructions Calls that a program made to other programs.
    • Log messages Lines of text that programs wrote while running.
  • Slot and block time The numbered time window in which the block was produced, and an estimated clock time.

The structure is from Solana's documentation on transaction structure, which states that a transaction is signatures plus a message and that the first signature “also serves as the transaction ID”. The same page describes an instruction as an index identifying the program to invoke, the accounts to pass to it, and a byte array of data. The RPC structures page defines the slot as the “Slot that contains this transaction” and the block time as an estimated production time of that block. The terminology page defines rent as a fee paid to store data on the chain and a rent-exempt account as one that keeps a minimum balance in proportion to the data it stores.

Seven steps

  1. Copy the transaction signature from your wallet's history or from the game's record of the round, and paste it into the search field of a block explorer.
  2. Read the status. A failed transaction did not carry out its instructions, though the fee was still charged. Then read the confirmation level. Solana's RPC documentation describes a finalized block as one “the cluster recognizes as finalized with maximum lockout”, while a block that is only processed “can still be rolled back”.
  3. Find the program the instruction was sent to and compare its address with the one the project publishes. Take the published address from the project's documentation or source repository, reached by your own route.
  4. Look at the signers. For your bet, the signer and fee payer should be your own address. For a settlement, note which address signed.
  5. Open the instruction data and the log messages. A game that can be checked writes the values of the round there: the commitment, the revealed secret, the slot and the result. Explorers show data in raw form unless they know the program's layout.
  6. Compare the balances before and after. In the bet transaction your account should fall by the stake plus the fee and, where the program creates an account for the round, the lamports deposited to keep that account rent exempt. In the settlement the payout should arrive at the same account.
  7. Recompute the result from the logged values with the formula the project publishes. Do it yourself, or with an open-source checker whose code you have read.

What to compare

Diagram that pairs each item with its counterpart. Fields and what to hold them against: Program address; Signer; Status and confirmation; Balance change; Logged commitment; Recomputed result.
Fields and what to hold them against
Fields and what to hold them against
FieldCompare withIf it differs
Program addressThe address in the project's documentation, every characterYou are looking at a different program. Stop.
SignerYour wallet addressThe transaction was not signed with your key
Status and confirmationSuccess, finalizedWait, or treat the round as not having happened
Balance changeYour stake, or the payout the game displayedAsk the operator, quoting the signature
Logged commitmentThe commitment recorded before your bet, in an earlier transactionThe secret was not fixed in advance
Recomputed resultThe result the game displayedKeep the signatures of both transactions as evidence

Two values that are easy to confuse

The recent blockhash in the message is a timestamp. Solana's confirmation guide defines a blockhash as the last Proof of History hash for a slot and says a transaction can use one for about 60 to 90 seconds. A game that takes randomness from the SlotHashes account uses a different value, which the validator documentation describes as hashes of the slot's parent banks. If a project's formula uses a slot hash, take it from the program's logs or from the round's own account. The blockhash shown in the transaction header is the wrong number for that purpose. The background is on the page about on-chain randomness.

What the record does not tell you

  • An explorer shows what its node reports. For anything that matters, look the signature up in a second explorer.
  • A record with missing log lines cannot be used to recompute a result. Treat that round as unverified.
  • The record shows what the program did in this transaction. It does not show what the program is able to do, or whether it can be replaced. The documentation on programs says a program can be upgraded while an upgrade authority is set. The page on audit reports explains how to read that.
  • A correct record of one round says nothing about the odds of the game.

The scheme behind the logged values is usually a commit-reveal scheme. For games that use seeds and a nonce without a blockchain, the equivalent procedure is on the page about verifying a round by hand.

Questions people ask

Do I have to connect my wallet to an explorer to see my transaction?

No. Paste the signature or your public address into the search field. Viewing is read-only and needs no connection and no secret.

How do I check the program ID?

It is the address of the program named in the instruction. Compare every character with the address in the project's documentation. Look-alike addresses are made to share their first and last characters, so checking the ends is not enough.

How do I read program logs?

Open the transaction and find the section for log messages. Lines are grouped by the program that wrote them. Values a game logs for verification may be printed as hex or as base58 text.

What is the difference between slot and block time?

Solana's terminology defines a slot as the period of time for which each leader ingests transactions and produces a block. Slots are numbered, and a slot can pass without a block, which is called a skipped slot. The block time is an estimated clock time for the block.

Sources

How we checked: statements about a named body link to that body's own page and carry the date we read it. Numbers in worked examples are computed by the site's build from the formulas shown, with routines covered by its test suite.