Documentation
Learn about the TSB-P protocol and how to use the Token Scanner API
Overview
The TSB-P Token Scanner is a tool for discovering and exploring programmable Bitcoin tokens embedded directly within Taproot script paths. These tokens follow the TSB-P protocol, enabling fully Bitcoin-native tokens with metadata, timestamps, and programmable attributes.
Token Format
TSB-P tokens are encoded inside the witness data of Bitcoin transactions via a Taproot script path. The encoding follows this programmable format:
OP_TRUE OP_IF 03 "TSB" # TSB marker (3 bytes) 10 [token ID] # Token ID (16 bytes) 08 [amount] # Amount (8 bytes, big endian) 01 [typeCode] # Type Code (1 byte) OP_DROP OP_DROP OP_DROP OP_DROP [metadata] # Metadata (variable length) 08 [timestamp] # Timestamp (8 bytes, big endian) OP_DROP OP_DROP OP_TRUE OP_ENDIF
Field Descriptions
- TSB: Marker to identify token scripts
- Token ID: Unique 16-byte identifier (padded with zeros if shorter)
- Amount: 8-byte unsigned integer representing the token supply
- TypeCode: 1-byte integer specifying the token type (see below)
- Metadata: Arbitrary user-defined metadata (string)
- Timestamp: 8-byte UNIX timestamp (creation time)
Token Type Codes
Each token has a typeCode indicating its purpose:
| Code | Type | Description |
|---|---|---|
| 0 | Fungible Token (FT) | Standard fungible tokens like currencies |
| 1 | Non-Fungible Token (NFT) | Unique digital assets |
| 2 | Proof-of-Existence (PoE) | Document/data timestamping |
| 3 | Smart Contract Trigger | Triggers off-chain smart contracts |
| 4 | Oracle-Verified | Tokens with oracle attestation |
| 5 | Compliance-Bound | KYC/AML compliant tokens |
| 6 | Vesting Token | Time-locked token releases |
| 7 | Multi-Sig Restricted | Requires multi-signature approval |
| 8 | DAO Governance | Voting and governance rights |
| 9 | Fee Payment | Protocol fee payment tokens |
| 10 | Wrapped Asset | Cross-chain wrapped assets |
| 11 | Cross-Chain Bridge | Bridge transfer tokens |
| 12 | Royalty Token | Revenue share tokens |
| 13 | Subscription Access | Access control tokens |
| 14 | Identity Token | KYC/verifiable claims |
| 15 | Treasury Reserve | DAO treasury tokens |
Note: If a token's typeCode is outside the 0-15 range, it will be displayed as "Unknown Type".
API Reference
GET /api/tokens
Returns a list of all TSB-P tokens found in the blockchain.
Query Parameters:
refresh=true- Force a full re-scan of the blockchain (ignores cache)
Example:
GET /api/tokens GET /api/tokens?refresh=true
GET /api/token/:txid
Returns detailed information about a specific token by its transaction ID.
Parameters:
txid- Transaction ID containing the token witness
Example:
GET /api/token/4fef74...ccc59
GET /api/status
Returns status and connection information about the Bitcoin node used by the scanner.
Example:
GET /api/status