Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

stratum-v2层 v2

Agent Skill

stratum-v2 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

423

周安装

18

GitHub Stars

2

下载量

148
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:stratum-v2(层 v2)
来源仓库:https://github.com/b-open-io/bsv-skills
仓库路径:skills/stratum-v2
安装命令:
npx skills add https://github.com/b-open-io/bsv-skills --skill stratum-v2
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/b-open-io/bsv-skills --skill stratum-v2

简介

用于处理 GitHub 仓库、Issue、Pull Request 等协作信息,适合在多种宿主环境中整理代码变更事项。

  • 支持围绕仓库状态、代码协作流程进行信息组织与分类。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态及是否触发联网或文件操作。
  • stratum-v2 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Stratum v2 Mining Protocol

Stratum v2 is the next-generation mining protocol developed by Braiins (Slush Pool), designed to address the limitations of Stratum v1. It introduces binary framing, end-to-end encryption, and decentralized job declaration.

When to Use

  • Planning mining infrastructure upgrades
  • Evaluating v1 to v2 migration
  • Understanding modern mining security
  • Implementing next-gen pool software
  • Building decentralized mining solutions

Key Improvements Over v1

FeatureStratum v1Stratum v2
FormatJSON-RPC textBinary framed
Bandwidth~100% baseline~30% reduction
EncryptionNone (plaintext)Noise Protocol (AEAD)
AuthenticationPassword-basedCryptographic
Job SelectionPool-controlledMiner-declarable
EfficiencyHigher latencyLower latency

Protocol Architecture

Stratum v2 consists of three subprotocols:

1. Mining Protocol

Core work distribution between pool and miners.

2. Job Declaration Protocol

Allows miners to construct their own block templates.

3. Template Distribution Protocol

Distributes block templates from Bitcoin nodes to pools/miners.

Binary Framing

Message Structure

+------------------+------------------+------------------+
| Extension Type   | Message Type     | Message Length   |
| (2 bytes)        | (1 byte)         | (3 bytes)        |
+------------------+------------------+------------------+
|                      Payload                           |
|                   (variable length)                    |
+--------------------------------------------------------+

Data Types

TypeDescriptionSize
U8Unsigned 8-bit1 byte
U16Unsigned 16-bit LE2 bytes
U24Unsigned 24-bit LE3 bytes
U32Unsigned 32-bit LE4 bytes
U256256-bit hash32 bytes
STR0_255Length-prefixed string1 + n bytes
B0_32Length-prefixed bytes1 + n bytes
B0_64KLength-prefixed bytes2 + n bytes
SEQ0_64KSequence of items2 + items

Channel Types

Standard Channel

  • Basic mining operations
  • Fixed extranonce size
  • Pool-assigned difficulty

Extended Channel

  • Larger extranonce support
  • Custom coinbase prefix
  • Header-only mining mode

Group Channel

  • Aggregates multiple miners
  • Proxy/farm configurations
  • Efficient multiplexing

Encryption (Noise Protocol)

Stratum v2 uses the Noise Protocol Framework with:

  • Handshake: Noise_NX_secp256k1_ChaChaPoly_SHA256
  • Cipher: ChaCha20-Poly1305 (AEAD)
  • Curve: secp256k1
  • Hash: SHA-256

Connection Flow

1. Client initiates Noise handshake
2. Server provides certificate (signed by authority)
3. Encrypted channel established
4. All subsequent messages encrypted

Security Benefits

  • Man-in-the-middle protection
  • Hashrate hijacking prevention
  • Pool impersonation prevention
  • Privacy for miner operations

Mining Protocol Messages

Setup Messages

SetupConnection

{
  protocol: U32,
  min_version: U16,
  max_version: U16,
  flags: U32,
  endpoint_host: STR0_255,
  endpoint_port: U16,
  vendor: STR0_255,
  hardware_version: STR0_255,
  firmware: STR0_255,
  device_id: STR0_255
}

SetupConnection.Success

{
  used_version: U16,
  flags: U32
}

Channel Messages

OpenStandardMiningChannel

{
  request_id: U32,
  user_identity: STR0_255,
  nominal_hash_rate: F32,
  max_target: U256
}

OpenStandardMiningChannel.Success

{
  request_id: U32,
  channel_id: U32,
  target: U256,
  extranonce_prefix: B0_32,
  group_channel_id: U32
}

Job Messages

NewMiningJob

{
  channel_id: U32,
  job_id: U32,
  future_job: BOOL,
  version: U32,
  version_rolling_allowed: BOOL
}

SetNewPrevHash

{
  channel_id: U32,
  job_id: U32,
  prev_hash: U256,
  min_ntime: U32,
  nbits: U32
}

Share Submission

SubmitSharesStandard

{
  channel_id: U32,
  sequence_number: U32,
  job_id: U32,
  nonce: U32,
  ntime: U32,
  version: U32
}

SubmitShares.Success

{
  channel_id: U32,
  last_sequence_number: U32,
  new_submits_accepted_count: U32,
  new_shares_sum: U64
}

Job Declaration Protocol

Enables miners to select transactions for blocks:

Flow

  1. Miner connects to Template Distribution node
  2. Miner receives block template with transactions
  3. Miner declares custom job to pool
  4. Pool validates and accepts declaration
  5. Miner works on self-constructed block

Messages

DeclareMiningJob

{
  request_id: U32,
  mining_job_token: B0_255,
  version: U32,
  coinbase_prefix: B0_64K,
  coinbase_suffix: B0_64K,
  tx_short_hash_nonce: U64,
  tx_short_hash_list: SEQ0_64K[U64],
  tx_hash_list_hash: U256,
  excess_data: B0_64K
}

Benefits

  • Decentralizes transaction selection
  • Reduces pool censorship risk
  • Improves Bitcoin decentralization
  • Miners control block content

Template Distribution Protocol

Distributes templates from Bitcoin node to pools/miners:

NewTemplate

{
  template_id: U64,
  future_template: BOOL,
  version: U32,
  coinbase_tx_version: U32,
  coinbase_prefix: B0_64K,
  coinbase_tx_input_sequence: U32,
  coinbase_tx_value_remaining: U64,
  coinbase_tx_outputs_count: U32,
  coinbase_tx_outputs: B0_64K,
  coinbase_tx_locktime: U32,
  merkle_path: SEQ0_255[U256]
}

Comparison: v1 vs v2 Session

Stratum v1 Session

Client: {"method":"mining.subscribe","params":["Agent/1.0"],"id":1}
Server: {"result":[[["mining.set_difficulty","1"],["mining.notify","1"]],"08000000",4],"id":1}
Client: {"method":"mining.authorize","params":["user.worker",""],"id":2}
Server: {"result":true,"id":2}
Server: {"method":"mining.set_difficulty","params":[1024]}
Server: {"method":"mining.notify","params":["job1","prev...","cb1","cb2",[],"ver","bits","time",true]}
Client: {"method":"mining.submit","params":["user.worker","job1","00000000","time","nonce"],"id":3}
Server: {"result":true,"id":3}

Stratum v2 Session

1. Noise handshake (encrypted channel established)
2. SetupConnection → SetupConnection.Success
3. OpenStandardMiningChannel → OpenStandardMiningChannel.Success
4. SetTarget (difficulty)
5. NewMiningJob + SetNewPrevHash (job assignment)
6. SubmitSharesStandard → SubmitShares.Success

Migration Considerations

When to Migrate

  • Security is priority (MITM protection needed)
  • Bandwidth costs significant
  • Decentralization goals
  • Modern infrastructure refresh

When to Stay on v1

  • Legacy hardware compatibility
  • Existing stable infrastructure
  • Simple pool operations
  • No security concerns

Hybrid Approach

Many pools run both:

  • v1 on port 3333 (legacy compatibility)
  • v2 on port 3334 (modern miners)

Translation proxies can bridge v1 miners to v2 pools.

BSV Considerations

Current State

  • BSV pools primarily use Stratum v1
  • GorillaPool uses optimized v1 implementation
  • v2 adoption depends on ASIC firmware support

BSV-Specific Features

  • Large block templates (transaction selection matters)
  • getminingcandidate RPC (BSV-specific)
  • submitminingsolution RPC (BSV-specific)
  • Higher transaction throughput

Implementation Path

  1. Start with Stratum v1 (proven, compatible)
  2. Add v2 support when ASIC ecosystem ready
  3. Maintain both for transition period

Reference Implementation

Stratum Reference Implementation (SRI):

Components:

  • roles/pool - Mining pool role
  • roles/mining-proxy - Proxy/translator
  • roles/jd-client - Job declaration client
  • roles/jd-server - Job declaration server

Resources

Implementation Status

ComponentAvailability
Protocol SpecComplete
Reference ImplementationProduction
Pool SupportGrowing
ASIC FirmwareLimited
BSV SupportFuture

Quick Reference

Stratum v2 Ports (typical):

  • 3334 - Mining Protocol (encrypted)
  • 8442 - Template Distribution
  • 8443 - Job Declaration

Key Crates (Rust):

[dependencies]
binary_sv2 = "1.0"
codec_sv2 = "1.0"
framing_sv2 = "1.0"
noise_sv2 = "1.0"

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.24%
按下载量换算54

Claude

30.8%
按下载量换算46

Cursor

20.09%
按下载量换算30

Gemini CLI

10.64%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills