This skill should be used when the user asks to "calculate mining difficulty", "convert target to difficulty", "analyze block difficulty", "BSV difficulty calculation", or needs to compute difficulty from block headers.
From bsv-skillsnpx claudepluginhub b-open-io/claude-plugins --plugin bsv-skillsThis skill is limited to using the following tools:
scripts/difficulty.test.tsscripts/difficulty.tsGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Calculate and analyze BSV mining difficulty from targets, bits, and network data.
# Get current network difficulty
bun run skills/calculate-mining-difficulty/scripts/difficulty.ts --current
# Calculate from compact bits (e.g., genesis block)
bun run skills/calculate-mining-difficulty/scripts/difficulty.ts --bits 0x1d00ffff
# Calculate from target hex (64 characters)
bun run skills/calculate-mining-difficulty/scripts/difficulty.ts --target 00000000ffff0000000000000000000000000000000000000000000000000000
# JSON output for scripting
bun run skills/calculate-mining-difficulty/scripts/difficulty.ts --bits 0x1d00ffff --json
# Show help
bun run skills/calculate-mining-difficulty/scripts/difficulty.ts --help
Default output:
Mining Difficulty Analysis
==========================
Difficulty: 1
Target: 0x00000000ffff0000000000000000000000000000000000000000000000000000
Bits: 0x1d00ffff
Expected hashes: 4.29e+9
JSON output (--json):
{
"difficulty": 1,
"target": "00000000ffff0000000000000000000000000000000000000000000000000000",
"bits": "1d00ffff",
"expectedHashes": "4.29e+9"
}
The script uses the standard Bitcoin difficulty formula:
0x00000000FFFF0000000000000000000000000000000000000000000000000000 (difficulty 1)max_target / current_targettarget = mantissa * 2^(8*(exponent-3))difficulty * 2^32Uses WhatsOnChain API for current network data:
GET https://api.whatsonchain.com/v1/bsv/main/chain/infoComplete - All functionality implemented and tested.