Kaspa v2.1.0 is a feature, security, and maintenance release introducing P2P Protocol Version 11 with chunked Initial Block Download (IBD), network and P2P transport hardening, Stratum bridge hardening and performance enhancements, extraction of the standalone ZK SDK crate (kaspa-txscript-zk-sdk), an extensive workspace-wide arithmetic safety audit, and post-Toccata consensus streamlining.
Highlights
- P2P Protocol Version 11 & Chunked IBD: Large IBD payloads (Pruning Point Proofs, headers, and trusted data) are now streamed in 20 MiB chunks, avoiding message-framing bottlenecks and timeouts during node sync. Protocol 11 maintains full backwards compatibility with Protocol 10 peers.
- P2P & Transport Hardening: Lowered
P2P_MAX_MESSAGE_SIZEfrom 1 GB to 256 MB, enforced wire-level transaction and block limits (2 MB maximum block size), added immediate rejection of banned inbound peers, and bounded compressed parent counts (MAX_UNCOMPRESSED_PARENTS) against hashing DoS vectors. - Stratum Bridge Hardening: Patched a static asset path-traversal vulnerability in the web dashboard, eliminated
CLOSE_WAITsocket leaks with per-connection worker tasks and explicitConnection: closeheaders, and bounded Prometheus metric cardinality on/metrics. - Standalone ZK SDK (
kaspa-txscript-zk-sdk): Extracted RISC Zero Groth16 and STARK proof script-generation logic into a dedicated crate with dynamic/static image ID support, control proof length bounds, and Windows build fixes. - Workspace-Wide Arithmetic Overflow Audit: Enforced
clippy::arithmetic_side_effectsacross production crates under a formal policy documented indocs/ARITH-SAFETY.md, hardening counters, retry loops, and arithmetic operations across the node. - Node & Library Bug Fixes: Added safe Borsh address decoding without panicking on invalid payload lengths, corrected output count reporting in txscript errors, and fixed constant-time private key equality in
kaspa-bip32.
Detailed Changes
P2P Protocol & Sync (Protocol v11)
- Chunked IBD Streaming (#1136):
- Introduced Protocol Version 11 while negotiating Protocol 10 with older peers.
- Large IBD payloads are split into 20 MiB chunks:
- Pruning Point Proof chunks via
PruningPointProofChunkMessageandPruningPointProofChunksEndMessage. - Headers chunking during sync.
- Trusted data chunks via
TrustedDataChunkMessageandTrustedDataChunksEndMessage.
- Pruning Point Proof chunks via
- Added an overall 1 GiB safety limit and total transfer timeouts with progress logging.
- P2P Wire Limits & Safety (#1138):
- Lowered
P2P_MAX_MESSAGE_SIZEin the connection handler from 1 GB to 256 MB. - Enforced pre-validation P2P size limits on transaction messages and block messages (wire block capped at 2 MB).
- Banned inbound connections are now rejected immediately during initial connection setup.
- Verified that relay blocks triggering IBD are not processed as trusted data.
- Lowered
Consensus & Pruning Proofs
- Tightened Parent Bounds:
- Bounded cumulative uncompressed parent count across all levels in
CompressedParentstoMAX_UNCOMPRESSED_PARENTS = 255 * 2048, returningCompressedParentsError::SizeExceededon malformed headers.
- Bounded cumulative uncompressed parent count across all levels in
- Pruning Proof Invariants:
- Strictly enforce during pruning proof validation that proof headers without parents must be genesis; non-genesis parentless headers return
PruningImportError::NonGenesisParentlessHeader.
- Strictly enforce during pruning proof validation that proof headers without parents must be genesis; non-genesis parentless headers return
- Post-Toccata Consensus Streamlining (#1082, #1083, #1084, #1086, #1087, #1089, #1101):
- Collapsed activation branches into unconditional post-Toccata logic across consensus, mempool, and P2P layers.
- Consolidated
BLOCK_VERSIONto 2 (removedTOCCATA_BLOCK_VERSIONand transitional params). - Replaced legacy sigops accounting with script units, making covenant script verification unconditional.
- Bound PSKT extraction by input committed script units.
- Activated Toccata on devnet and refreshed DAG fixtures.
Stratum Bridge
- Web Dashboard Security & Concurrency (#1079, #1138):
- Fixed path traversal in web dashboard static asset serving by rejecting non-normal path components and asserting canonicalized paths stay within the static root directory.
- Handled incoming HTTP requests in dedicated worker tasks with a 10-second read timeout and explicit
Connection: closeheaders to prevent socket exhaustion andCLOSE_WAITaccumulation. - Bounded Prometheus cardinality on
/metricsby stripping ephemeral ports from client IPs, unifying worker/miner labels, and introducing an eviction ring (512 blocks) for the mined blocks gauge.
ZK SDK & Covenants
- Standalone ZK SDK (#953):
- Extracted ZK-to-script and proof tooling into the dedicated
kaspa-txscript-zk-sdkcrate. - Added support for Groth16 verifier generation with static or dynamic image IDs via
append_r0_groth16_verifierandappend_r0_groth16_verifier_with_image_id(#1067). - Bounded Poseidon2 control inclusion proofs to guard against oversized proof verification.
- Pinned
risc0-zkvm-platformand resolved Windows link issues viarisc0-export-syscall(#1064, #1071).
- Extracted ZK-to-script and proof tooling into the dedicated
Mempool & Mining
- Coinbase Mempool Rejection (#1137):
- Explicitly reject coinbase transactions submitted to the mempool with
RuleError::RejectCoinbaseduring validation, even if non-standard transactions are enabled.
- Explicitly reject coinbase transactions submitted to the mempool with
- Relay Fee Calculation:
- Used
saturating_mulin minimum required transaction relay fee calculations to prevent integer overflow on extreme mass transactions.
- Used
Workspace Arithmetic Safety Audit
- Overflow Prevention Policy (
docs/ARITH-SAFETY.md):- Enabled
clippy::arithmetic_side_effectsacross production crates and standardized invariant annotations. - Fixed connection handler retry loop counter overflow.
- Hardened registration rollbacks and widened reference counting to
u64in the notification address tracker. - Applied
saturating_subto peer handshake timestamp offset calculations. - Used proper integer types and bounds in mempool topological sorting routines.
- Corrected file descriptor subtraction casting during node startup.
- Enabled
Wallets, RPC & SDK Fixes
- BIP-32 Key Equality (#1072):
- In
kaspa-bip32, fixedExtendedPrivateKey::ct_eqwhere private key byte comparison was incorrectly checkingselfagainstselfrather thanother.
- In
- Txscript Error Reporting (#1096):
- Corrected
TxScriptError::InvalidOutputIndexin output inspection opcodes to report output counts rather than input counts.
- Corrected
- RPC Conversions (#1056, #1138):
- Preserved the covenant field when converting optional transaction outputs in
vspcv2RPC flows. - Enforced checked integer conversions in gRPC optional header and transaction decoders (
RpcOptionalHeader,RpcOptionalTransaction).
- Preserved the covenant field when converting optional transaction outputs in
- Wasm SDK (#1085):
- Corrected sighash type mapping for
SighashType::AllAnyOneCanPayto set bothSIG_HASH_ALLandSIG_HASH_ANY_ONE_CAN_PAY.
- Corrected sighash type mapping for
Upgrade Recommendation
All node, mining, and infrastructure operators across mainnet and testnets are strongly encouraged to upgrade to Kaspa v2.1.0.
This release reflects ongoing focus on proactive defense-in-depth, introducing systematic security hardening and stricter validation bounds across the P2P transport layer, synchronization flows, and node
subsystem boundaries. Together with a comprehensive audit enforcing strict arithmetic safety invariants and the rollout of Protocol Version 11 chunked sync, these structural safeguards significantly
strengthen node resilience and provide higher confidence in the overall security.