Data Streaming
Stream Light Protocol account state transitions via Laserstream gRPC.
Workflow
- 1. Clarify intent
- Recommend plan mode, if it's not activated
- Use
AskUserQuestion to resolve blind spots
- All questions must be resolved before execution
- 2. Identify references and skills
- Match task to
domain references below
- Locate relevant documentation and examples
- 3. Write plan file (YAML task format)
- Use
AskUserQuestion for anything unclear — never guess or assume
- Identify blockers: permissions, dependencies, unknowns
- Plan must be complete before execution begins
- 4. Execute
- Use
Task tool with subagents for parallel research
- Subagents load skills via
Skill tool
- Track progress with
TodoWrite
- 5. When stuck: spawn subagent with
Read, Glob, Grep, DeepWiki MCP access and load INLINECODE8
When NOT to use
For simple account lookups, call get_account_interface from light-client. It races hot and cold lookups automatically.
This skill is for continuous data pipelines: aggregators, market makers, and indexers that need real-time state change notifications rather than point queries.
Domain references
| Audience | Reference |
|---|
| All — shared architecture (read first) | references/shared.md |
| Token accounts (SPL-compatible, 165 bytes) |
references/token-accounts.md |
| Mint accounts (borsh-deserialized, metadata) |
references/mint-accounts.md |
| Compressible PDAs (per-program, discriminator check) |
references/pdas.md |
Account type decision
| Streaming... | Account type | Key difference |
|---|
| SPL-compatible token balances | Token accounts | INLINECODE11 parsing, 165-byte layout |
| Mint supply, metadata, authorities |
Mint accounts |
Mint::deserialize, borsh layout |
| Your program's PDA state | Compressible PDAs | 8-byte discriminator check, per-program filter |
Program addresses
| Program | Address |
|---|
| Light Token Program | INLINECODE13 |
| Light System Program |
SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7 |
External references
zkcompression.com/light-token/toolkits/for-streaming-tokens |
| Streaming mints toolkit |
zkcompression.com/light-token/toolkits/for-streaming-mints |
SDK references
| Package | Link |
|---|
| INLINECODE15 | API docs |
| INLINECODE16 |
docs.rs |
Security
This skill does not pull, store, or transmit external secrets. It provides code patterns, documentation references, and development guidance only.
- - No credentials consumed. The skill requires no API keys, private keys, or signing secrets.
env: [] is declared explicitly. - User-provided configuration. RPC endpoints, wallet keypairs, and authentication tokens (Privy, wallet adapters) are configured in the user's own application code — the skill only demonstrates how to use them.
- API keys. Reference code uses
HELIUS_API_KEY as a placeholder. For production, set your RPC provider key as an environment variable. - Subagent scope. This skill may spawn read-only subagents that use
Read, Glob, and Grep to search the local repository. Restrict the working directory to your project. - Install source.
npx skills add Lightprotocol/skills installs from the public GitHub repository (Lightprotocol/skills). Verify the source before running. - Audited protocol. Light Protocol smart contracts are independently audited. Reports are published at github.com/Lightprotocol/light-protocol/tree/main/audits.
数据流
通过Laserstream gRPC传输Light协议账户状态变更。
工作流程
- 1. 明确意图
- 若未激活,推荐计划模式
- 使用AskUserQuestion解决盲点
- 执行前必须解决所有问题
- 2. 识别参考资料和技能
- 将任务匹配至下方
领域参考
- 定位相关文档和示例
- 3. 编写计划文件(YAML任务格式)
- 对任何不明确之处使用AskUserQuestion——切勿猜测或假设
- 识别阻塞项:权限、依赖、未知项
- 执行开始前计划必须完整
- 4. 执行
- 使用带子代理的Task工具进行并行研究
- 子代理通过Skill工具加载技能
- 使用TodoWrite跟踪进度
- 5. 遇到困难时:生成子代理,使用Read、Glob、Grep、DeepWiki MCP访问权限,并加载skills/ask-mcp
何时不使用
对于简单的账户查询,从light-client调用getaccountinterface。它会自动竞速热查询和冷查询。
本技能适用于持续数据管道:需要实时状态变更通知而非点查询的聚合器、做市商和索引器。
领域参考
references/token-accounts.md |
| Mint账户(borsh反序列化,元数据) |
references/mint-accounts.md |
| 可压缩PDA(按程序,鉴别器检查) |
references/pdas.md |
账户类型决策
| 流式传输... | 账户类型 | 关键区别 |
|---|
| 兼容SPL的代币余额 | 代币账户 | PodAccount解析,165字节布局 |
| Mint供应量、元数据、权限 |
Mint账户 | Mint::deserialize,borsh布局 |
| 您程序的PDA状态 | 可压缩PDA | 8字节鉴别器检查,按程序过滤 |
程序地址
| 程序 | 地址 |
|---|
| Light代币程序 | cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m |
| Light系统程序 |
SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7 |
外部参考
zkcompression.com/light-token/toolkits/for-streaming-tokens |
| 流式Mint工具包 |
zkcompression.com/light-token/toolkits/for-streaming-mints |
SDK参考
| 包 | 链接 |
|---|
| @lightprotocol/stateless.js | API文档 |
| light-client |
docs.rs |
安全性
本技能不拉取、存储或传输外部机密。仅提供代码模式、文档参考和开发指导。
- - 不消耗凭证。 本技能不需要API密钥、私钥或签名机密。显式声明了env: []。
- 用户提供的配置。 RPC端点、钱包密钥对和认证令牌(Privy、钱包适配器)在用户自己的应用程序代码中配置——本技能仅演示如何使用它们。
- API密钥。 参考代码使用HELIUSAPIKEY作为占位符。生产环境中,将您的RPC提供商密钥设置为环境变量。
- 子代理范围。 本技能可能生成只读子代理,使用Read、Glob和Grep搜索本地仓库。将工作目录限制在您的项目中。
- 安装来源。 npx skills add Lightprotocol/skills从公共GitHub仓库(Lightprotocol/skills)安装。运行前验证来源。
- 审计协议。 Light Protocol智能合约经过独立审计。报告发布在github.com/Lightprotocol/light-protocol/tree/main/audits。