Skip to content

t-0-network/provider-sdk

Repository files navigation

T-0 Network Provider SDK

SDKs and starter templates for building payment provider integrations with the T-0 Network. Available for Go, TypeScript, Python, Java, and C#.

Quick Start

Choose your platform and run the one-liner to scaffold a new provider project:

Go

go run github.com/t-0-network/provider-sdk/go/starter@latest my-provider

Requires Go 1.25+. See Go starter documentation for details.

TypeScript

npx @t-0/provider-starter-ts

Requires Node.js LTS. See TypeScript starter documentation for details.

Python

uvx t0-provider-starter my_provider

Requires Python 3.13+ and uv. See Python documentation for details.

Java

curl -fsSL -L https://github.com/t-0-network/provider-sdk/releases/latest/download/provider-init.jar -o provider-init.jar && java -jar provider-init.jar && rm provider-init.jar

Requires Java 17+. See Java documentation for details.

C#

dotnet tool install -g T0.ProviderStarter
t0-provider-starter my-provider

Requires .NET 10.0+. See C# documentation for details.

What the Starter Creates

Each starter generates a ready-to-run provider project with:

  • secp256k1 keypair -- auto-generated private key in .env, public key printed to console
  • Provider service stubs -- handler implementations for all T-0 Network RPC methods
  • Network client -- pre-configured client for calling T-0 Network APIs (quote publishing, payment submission)
  • Dockerfile -- production-ready container build
  • Environment config -- .env with sandbox defaults

Getting Started

After scaffolding your project:

  1. Share your public key (printed during setup) with the T-0 team to register your provider.

  2. Phase 1 -- Quoting:

    • Implement your quote publishing logic (exchange rates for your supported currency pairs)
    • Verify quotes are received by the network
  3. Phase 2 -- Payments:

    • Implement payment handlers (update_payment, pay_out)
    • Deploy and share your base URL with the T-0 team
    • Test end-to-end payment flows

Each generated project contains numbered TODO comments that guide you through these steps.

Environment Variables

All platforms use the same environment variables:

Variable Required Default Description
PROVIDER_PRIVATE_KEY Yes Auto-generated Your secp256k1 private key (hex)
NETWORK_PUBLIC_KEY Yes Sandbox key T-0 Network public key for signature verification
TZERO_ENDPOINT No https://api-sandbox.t-0.network T-0 Network API URL
PORT No 8080 (3000 for TypeScript) Server listen port
QUOTE_PUBLISHING_INTERVAL No 5000 Quote publishing interval (ms)

SDK Packages

For direct SDK usage without the starter:

Platform Package Install
Go github.com/t-0-network/provider-sdk/go go get github.com/t-0-network/provider-sdk/go
TypeScript @t-0/provider-sdk npm install @t-0/provider-sdk
Python t0-provider-sdk uv add t0-provider-sdk
Java network.t-0:provider-sdk-java See Java docs
C# T0.ProviderSdk dotnet add package T0.ProviderSdk

Security

  • Never commit .env -- it is git-ignored by default. Keep PROVIDER_PRIVATE_KEY in a secrets manager in production.
  • Share only your public key with the T-0 team. Never share your private key.
  • Use separate keys for development, staging, and production environments.
  • Signature verification -- all inbound requests from the T-0 Network are cryptographically verified using NETWORK_PUBLIC_KEY. Verification uses raw request body bytes.
  • Timestamp validation -- request timestamps must be within +/- 60 seconds of server time. Keep system clocks synchronized (NTP).

Built-in SystemService

Every SDK auto-registers tzero.v1.system.SystemService on the customer's gRPC server. Customers do not implement it; bumping the SDK dependency exposes it automatically.

The first RPC, Health(HealthRequest) returns (HealthResponse), returns:

  • services -- fully-qualified protobuf service names registered on the server (always includes tzero.v1.system.SystemService itself)
  • current_time -- server wall-clock time (use to detect clock skew)
  • sdk_version -- the semver of the SDK build serving the request
  • sdk_ecosystem -- which SDK runtime (SDK_ECOSYSTEM_GO, SDK_ECOSYSTEM_NODE, SDK_ECOSYSTEM_PYTHON, SDK_ECOSYSTEM_JAVA, SDK_ECOSYSTEM_CSHARP)

Health calls are signed with the T-0 Network keypair, just like every other provider RPC. Full details: docs/SYSTEM_SERVICE.md.

Further Reading

Support

  • Review the TODO comments in the generated project code
  • Check the T-0 Network documentation
  • Contact the T-0 team for integration support and production onboarding

Versioning

All SDKs share a unified version, managed via git tags (vX.Y.Z). See docs/VERSIONING.md for details on where the version lives in each ecosystem and docs/RELEASE_AND_PUBLISH.md for the release/publish CI flow.

Contributing

See CONTRIBUTING.md for development setup, testing, protobuf code generation, and release process.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors