Skip to main content

TxLINE integration reference

API origin and authentication

Devnet origin: https://txline-dev.txodds.com
RequestUse
POST /auth/guest/startObtain the short-lived guest JWT.
TxLINE subscribe(1, 4) instructionActivate the free World Cup tier on devnet.
POST /api/token/activateExchange subscription transaction plus wallet signature for an API token.
Activation signs the exact UTF-8 preimage `${txSig}:${leagues.join(",")}:${jwt}` with a detached Ed25519 signature encoded as base64. With no leagues, the preimage contains txSig::jwt. Authenticated data requests include both headers:
Authorization: Bearer <guest-jwt>
X-Api-Token: <activated-api-token>
The guest JWT is renewed on HTTP 401. The activated API token is retained.

Data endpoints used by Slip

EndpointParametersConsumerPurpose
GET /api/fixtures/snapshotstartEpochDayWebList future non-cancelled fixtures and orient home/away participants.
GET /api/scores/snapshot/{fixtureId}asOfKeeperRead latest sequence and determine terminal status.
GET /api/scores/stat-validationfixtureId, seq, statKey, optional statKey2Keeper and SDKRetrieve one- or two-stat proof payload for resolution.
Slip does not require TxLINE consensus odds. Parimutuel pool balances are the price input.

Soccer stat keys

statKey = periodPrefix + baseKey
Base keyMeaning
1Home goals
2Away goals
3Home yellow cards
4Away yellow cards
5Home red cards
6Away red cards
7Home corners
8Away corners
PrefixPeriod
0Full match
1000First half
2000Half time
3000Second half
4000Extra-time first half
5000Extra-time second half
6000Penalty shootout
7000Extra time total
Full-match expressions store canonical period tag 100; period-prefixed expressions store their prefix. The ScoreStat.period inside a proof is different: it is the live match phase at the time of the record.

Terminal phases

Settlement accepts ScoreStat.period 5, 10, 13, or 100. Values 11 and 12 are live penalty phases, not terminal states. The keeper also recognizes action=game_finalised as terminal.

Proof payload mapping

stat-validation returns number arrays for hashes. The SDK maps the response into ScoresProof:
  • statToProve and statProofstatA;
  • optional statToProve2 and statProof2statB;
  • summary.updateStats and summary.eventStatsSubTreeRoot → the committed fixture summary;
  • subTreeProof and mainTreeProof → the remaining proof segments.
The independent verifier uses SHA-256 with these byte layouts:
stat leaf    = sha256(key:u32 LE || value:i32 LE || phase:i32 LE)
fixture leaf = sha256(0x01 || fixture:i64 LE || update_count:i32 LE ||
                      min_ts:i64 LE || max_ts:i64 LE || subtree_root[32])
node         = right sibling ? sha256(current || sibling)
                             : sha256(sibling || current)

Daily roots account

PDA seeds: ["daily_scores_roots", epochDay_u16_le], where epoch day derives from the proof’s summary.updateStats.minTimestamp, not wall clock. Account layout: [8-byte discriminator][u16 epoch day][288 × 32-byte roots]. Each root represents a five-minute slot. Slot index is hour * 12 + floor(minute / 5).

Absence and replay constraints

A zero-valued stat can be absent from a record’s tree. An absent leaf cannot produce a valid proof; Slip treats that as proof unavailability, not as a proved zero. TxLINE devnet replays fixtures and can rewrite the current virtual five-minute root. The keeper fetches and submits promptly and uses durable retries. A transient mismatch does not permit an early void.