From bsv-skills
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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bsv-skills:calculate-mining-difficultyThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Calculate and analyze BSV mining difficulty from targets, bits, and network data.
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.
npx claudepluginhub b-open-io/claude-plugins --plugin bsv-skillsAnalyzes digital assets including cryptocurrency fundamentals, blockchain mechanics, DeFi protocols, staking yields, impermanent loss, and on-chain metrics like NVT, TVL.
Reviews Bitcoin Lightning Network protocol designs, compares channel factory approaches, analyzes Layer 2 scaling tradeoffs. Covers trust models, on-chain footprint, consensus, HTLC/PTLC, liveness, watchtowers.
Estimates block times and converts blocks to seconds for Ritual dApps. Guides TTL, lock durations, scheduler frequency, and polling window settings.