bitcoin-secp256k1
БесплатноБез исполняемых скриптовНе проверенsecp256k1 elliptic curve: parameters, group law, key encoding, point serialization, library bindings (libsecp256k1 in C, Rust, Python). USE WHEN: low-level…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
secp256k1
The elliptic curve Bitcoin uses for all signatures (ECDSA + Schnorr).
Defined by SECG (SEC 2: Recommended Elliptic Curve Domain Parameters).
Parameters
p = 2^256 - 2^32 - 977 (the field prime)
a = 0
b = 7
G = (0x79BE667E_F9DCBBAC_55A06295_CE870B07_029BFCDB_2DCE28D9_59F2815B_16F81798,
0x483ADA77_26A3C465_5DA4FBFC_0E1108A8_FD17B448_A6855419_9C47D08F_FB10D4B8)
n = 0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFE_BAAEDCE6_AF48A03B_BFD25E8C_D0364141
h = 1 (cofactor)
The curve equation: y^2 = x^3 + 7 (mod p).
Point operations
- Point addition: P + Q with chord-and-tangent rule mod p.
- Scalar multiplication:
k*Gis the public key for private scalar k. - Point doubling: 2P via tangent line.
- Point at infinity: identity for the group.
Key encoding
Public key (full)
- Uncompressed (65 bytes):
0x04 || x || y(32-byte each). - Compressed (33 bytes):
0x02 || xif y even,0x03 || xif y odd.
x-only (BIP340, Taproot)
- 32 bytes: just
x. Implicit even-y convention. - Used in Schnorr signatures and Taproot output keys.
Why secp256k1 (not P-256)?
- No NSA-derived seed in the parameter generation (P-256 has the controversial Dual_EC seeds and the ad-hoc base point).
- Endomorphism
λ = ...allows fast multiplication: any point P has a known(λ·P)derivable cheaply, used in optimized scalar mult. - Sufficient security: ~128-bit classical security against discrete-log attacks, parity to symmetric-128. See the quantum caveat below.
Quantum outlook (as of September 2026)
The ~128-bit figure above is classical security. Shor's algorithm solves the discrete log on an elliptic curve in polynomial time, so no secp256k1 key size helps against a cryptographically relevant quantum computer; the exposed surface is any published public key (a Taproot x-only key sits in the scriptPubKey, a reused-address ECDSA key sits in a spent input). None of this changes how you sign or verify today.
Two consensus-track drafts frame the response. Both are Draft in the BIPs repo as of September 2026, with no activation parameters:
- BIP 360, "Pay-to-Merkle-Root (P2MR)" (Beast, Heilman, Foxen Duke; Consensus soft fork, assigned 2024-12-18, spec version 0.12.1) — P2TR with the key path removed, so the output publishes no EC point. It targets long exposure attacks only and deliberately picks no post-quantum signature algorithm, deferring that to a later proposal.
- BIP 361, "Post Quantum Migration and Legacy Signature Sunset" (Lopp et al.; Consensus soft fork, Type: Informational, assigned 2026-02-11) — a phased sunset that first disallows sending to quantum-vulnerable outputs, then encumbers ECDSA/Schnorr spends with a quantum-safe rescue protocol.
Detail lives in schnorr/SKILL.md (BIP340 key exposure) and ../../protocol/proposals/SKILL.md (output types, migration policy, rescue mechanics). libsecp256k1 ships no post-quantum module.
Critical operations to never mess up
- Modular inverse: Use Fermat's little theorem
a^(p-2) mod por extended Euclidean. Constant-time required for security. - Scalar generation: 32 bytes of CSPRNG, reduce mod n. Reject zero. On a signing device, show the raw device-generated entropy and mix in independent user entropy (dice/coin) — both practices were reinforced by the July 2026 Coldcard advisory below.
- Range check pubkey: x in [0, p), y satisfies curve equation.
- Co-factor: cofactor h = 1, so any non-zero point on curve is in the prime-order subgroup. No subgroup check needed.
Recommended library: libsecp256k1
The C library maintained at github.com/bitcoin-core/secp256k1:
- Constant-time everywhere by default.
- Optimized scalar mult using endomorphism.
- Modular APIs:
secp256k1_ec_*,secp256k1_ecdsa_*,secp256k1_xonly_*/secp256k1_keypair_*(extrakeys),secp256k1_schnorrsig_*(BIP340),secp256k1_ecdh_*,secp256k1_recovery_*,secp256k1_musig_*(MuSig2, BIP327 — the C prefix has no2),secp256k1_ellswift_*(BIP324),secp256k1_silentpayments_*(BIP352). All modules are configure-time options; as of master (September 2026) every one defaults to enabled exceptrecovery, which is off by default. - There is no FROST module upstream (checked against master,
September 2026).
secp256k1-frostis a third-party fork, not a libsecp256k1 module — see frost/SKILL.md. - Bindings:
rust-secp256k1,python-bitcoinlib(via cffi),secp256k1-node, etc.
Avoid rolling your own EC math in production. Subtle errors here are catastrophic.
Current release (as of September 2026)
v0.8.0 (2026-08-03). Modules are exactly: ecdh, ellswift, extrakeys, musig, recovery, schnorrsig, silentpayments.
- v0.8.0 added the
silentpaymentsmodule (BIP352 send/receive; needs full transaction data, no ligh
Установить bitcoin-secp256k1 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobFAQ
Что делает скилл bitcoin-secp256k1?
secp256k1 elliptic curve: parameters, group law, key encoding, point serialization, library bindings (libsecp256k1 in C, Rust, Python). USE WHEN: low-level key/point operations, debugging signature failures, understanding why Bitcoin uses this curve specifically.
Как установить скилл bitcoin-secp256k1?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bitcoin-secp256k1 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic