Phala TEE randomness
  • TypeScript 55.3%
  • JavaScript 44.2%
  • Dockerfile 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thomas Vu 948e0668cf fix(security): atomic payment replay claim and 5xx rollback
Use Redis SET NX (and single-process LRU) for tryClaimPayloadHash.
Rollback claimed hashes on handler 5xx so paid clients can retry.
Internal service auth still skips replay entirely.
2026-07-19 04:22:24 -04:00
worker fix(security): atomic payment replay claim and 5xx rollback 2026-07-19 04:22:24 -04:00
.gitignore Add gitignore rules for build artifacts and vendored x402 copy 2026-02-11 17:27:04 -05:00
API.md feat: dual-mode RNG landing — HTTP x402 + Phala Flash VRF 2026-07-11 23:56:41 -04:00
DEPLOYMENT.md Remove stale randomness deploy assets 2026-03-10 17:19:46 -04:00
README.md feat: dual-mode RNG landing — HTTP x402 + Phala Flash VRF 2026-07-11 23:56:41 -04:00
TESTING.md refactor: rename domain to rng.mysterygift.fun, remove API key auth 2026-02-28 22:20:03 -05:00
X402-INTEGRATION.md feat: add Robinhood Chain (eip155:4663) to x402 and landing 2026-07-11 19:56:05 -04:00

Verifiable Randomness Service

This service provides the live Mystery Gift randomness product at https://rng.mysterygift.fun.

Dual mode on the landing page:

  • HTTP API / x402 — TEE seeds and helpers (POST /v1/*) for Miss, raffles, agents
  • On-chain Flash VRF — status + request UI for Phala Flash coordinators used by pack escrows (set FLASH_VRF_COORDINATOR_* env after deploy)

Current Scope

  • TEE-backed randomness on Phala
  • x402 payment flow at $0.01 per request
  • Solana and Base payment support
  • optional Arweave commitment publishing

The older whitelist / partner API-key flow is no longer the canonical model.

Deploy

Use the worker compose files:

  • worker/phala-compose.prod.yaml
  • optional worker/phala-compose.dev.yaml

See worker/README.md for the current runtime contract.