Verify a trade

A revealed trade can be checked without trusting Unseen: hash its opening and compare the result with the commitment its exec account carried on-chain when the trade landed.

In the browser

Every strategy page lists its revealed trades. The page fetches each opening, hashes it in your browser with Web Crypto, and shows Opening matches its commitment when the two agree. The landing's Check a revealed trade yourself runs the same check step by step, and lets you change one byte of the salt to watch it fail.

By hand

A version-1 commitment is SHA-256 over 80 bytes:

  • strategy_id — the strategy's 32-byte ID
  • exec_index — the exec account's index, unsigned 64-bit, little-endian
  • signal_seq — the signal's sequence, unsigned 64-bit, little-endian
  • salt — 32 random bytes

Version 2 commitments use the same construction over a longer encoding that also binds the deployment (genesis hash, program, executor key), the signed signal's hash, the executor receipt's sequence and time, and the policy-evidence hash; the contract package encodes it for you.

import { createUnseenClient, verifyOpening } from '@unseen/contract'

const api = createUnseenClient({ baseUrl: 'https://<api host>' })
const { data } = await api.request('revealedExecution', { params: { executionId } })
const ok = await verifyOpening(data.opening, data.commitment) // true when the opening fits

What else you can check

  • The trade. The exec account's transactions on Solana show the market, side, size, price and fees.
  • The chain of commitments. Each execution extends an on-chain hash chain: the new head is the SHA-256 of the previous head and the new commitment, so none can be dropped or reordered afterwards.
  • The NAV. GET /v1/revealed-strategies/:id/nav returns the strategy's NAV rebuilt from revealed data, point by point, with the commitments it used.