Version 2.1.0
Added
- SilverScript compiler bindings in the new
kaspa.experimental.silverscriptmodule. The module is experimental and its API may change between releases. See the SilverScript guide.compile()compiles SilverScript v1.0.0 contract source. It returns aCompiledContractwith the locking script (bytecode), the ABI, thestate_span, and thetemplate_hash.build_sig_script()andbuild_sig_script_for_covenant_decl()build the unlocking script for an entrypoint.artifact_json()exports the portable ABI artifact. For the same source and constructor arguments it is byte-for-byte what the upstreamsilverccompiler writes.load_artifact()reads that JSON back into aContractArtifact, with no source and no compiler.check_consistency()verifies the artifact against its own bytecode, andto_json()serializes it again.entry(name)looks up one entrypoint'sEntryAbi(name,params,dispatch_tag). It raisesSilverScriptErrorfor a name the contract does not declare.debug_call()runs an entrypoint through SilverScript's source-level debug engine, with no node needed. It returns aDebugCallResult, with aFailureReportwhen the call fails. Withtrace=Truethe result also carries a per-statementTraceSteptrace. Thetxargument describes the surrounding transaction, so covenant transitions can be debugged too.SilverScriptErrorexception.
- ZK script bindings for locking a UTXO behind on-chain verification of a RISC Zero proof through the
OpZkPrecompileopcode. Mirrors the WASM SDK. See the ZK guide.ZkScriptBuilderwithnew_r0(),commit_to_groth16()/commit_to_succinct(), andfinalize_with_groth16_proof()/finalize_with_succinct_proof().- Fragment methods for composing scripts by hand:
add_data(),push_r0_groth16_proof(),push_r0_succinct_witness(),append_r0_groth16_verifier(),append_r0_succinct_verifier(), their*_with_fixed_journalvariants, andappend_r0_groth16_verifier_dynamic_image_id(). FinalizedR0Script(sig_script,redeem_script) andR0SuccinctWitnessParts(claim,control_index,control_digests,seal).prepare_r0_groth16_proof()andprepare_r0_succinct_witness()convert a RISC Zero receipt into script pushes.ZkErrorexception inkaspa.exceptions.
compute_sighash()computes the signature hash for a transaction input.- Two on-chain examples:
examples/silverscript/counter.pyruns a Counter covenant on testnet-10, andexamples/zk/groth16_onchain.pydoes a Groth16 commit and redeem round trip.
Changed
- The
covenants_enabledargument ofScriptBuilder()andScriptBuilder.from_script()is deprecated and ignored. TheScriptBuilder.covenants_enabledproperty is deprecated and alwaysTrue. rusty-kaspa removed the flag now that Toccata is active on every network. Every builder now has the covenant opcodes, the explicit push opcodes, and the post-Toccata limits (1,000,000-byte scripts and elements, 1,000,000 ops), so a defaultScriptBuilder()accepts pushes over 520 bytes. Using the argument or the property emits aDeprecationWarning. Both will be removed in a future major version.ZkScriptBuilder.new_r0()accepts the same deprecated argument.
Fixed
Address(...)andAddress.validate(...)no longer panic on an address whose checksum is valid but whose payload has the wrong length for its version, or no payload at all. The panic surfaced as apyo3_runtime.PanicException, whichexcept Exceptiondoes not catch.Address(...)now raisesExceptionandvalidatereturnsFalse.SighashType.AllAnyOneCanPaynow maps to hashtype0x81(All | AnyOneCanPay). It mapped to the bareAnyOneCanPaybit (0x80), which is not a valid hashtype, so signatures made with it were rejected by the script engine.NoneAnyOneCanPayandSingleAnyOneCanPaywere already correct.TransactionInput.to_dict()now includescomputeBudget, also when nested underTransaction.to_dict().from_dictalready accepted the key, but serialization dropped it, so a round trip through JSON reset the budget to 0.UtxoEntry.to_dict()andUtxoEntryReference.to_dict()now emitcovenantIdas a hex string instead of aHashobject, so dicts with covenant UTXOs are JSON-serializable.from_dictaccepts either form.- The type stubs no longer declare
UtxoEntriestwice. The duplicate could hide every method except__repr__from type checkers. The parameters behind it (utxo_entry_sourceoncreate_transaction;entriesandpriority_entriesonGenerator,create_transactions, andestimate_transactions) are now annotatedtyping.Sequence[UtxoEntryReference], which is what they accept. - The
requires-pythonupper bound is now<3.15instead of<=3.14, which excluded every 3.14 patch release.
Development
Internal SDK changes — not visible through the Python package API.
- The crate is now a Cargo workspace with three members: the core
kaspacrate,crates/silverscript(a secondcdylibwith its own rusty-kaspa dependency graph), andcrates/core(shared macros). The SilverScript module is injected into the wheel underkaspa/experimental/silverscript/. - Bumped the pinned
rusty-kaspadependency for the corekaspamodule fromcfafeb4c0(v2.0.1) to01b532e8(v2.1.0). - Pinned
silverscript-lang,silverscript-abi, anddebugger-sessionat3ed9733(SilverScript v1.0.0).