@tat-protocol/gate
v1.1.1
Published
Gate Agent for TAT Protocol - Access verification and validation
Downloads
170
Maintainers
Readme
@tat-protocol/gate
Gate services for access verification and challenge/proof workflows.
Install
npm install @tat-protocol/gateExports
GateServerSpec(spec-oriented NWPC gate service)GateBase(extensible base class)Gate(minimal wrapper)- Types from
types.tsandspec-types.ts
Quick Start (Spec Server)
import { GateServerSpec } from "@tat-protocol/gate";
import { NodeStore } from "@tat-protocol/storage";
import { KeySigner } from "@tat-protocol/signers";
const gate = await GateServerSpec.create({
signer: new KeySigner(process.env.GATE_SECRET_KEY!),
storage: new NodeStore(".gate"),
relays: ["wss://relay.damus.io"],
serviceName: "Premium API",
challengeExpiry: 300,
sessionExpiry: 3600,
});
console.log(gate.getPublicKey());Protocol Flow
- Client calls
gate.request_access. - Server returns challenge (
gate.challenge). - Client submits proof to
gate.verify. - Server responds with
gate.resultand optional session token.
Runtime Notes
- Session validation is available via
verifySession(sessionToken). - Gate supports full and minimal proof modes.
- Persist state to avoid replay gaps across restarts.
