{"id":51240734,"url":"https://github.com/gryszzz/kaspa-script","last_synced_at":"2026-06-29T00:01:25.526Z","repository":{"id":360385650,"uuid":"1249774828","full_name":"gryszzz/Kaspa-Script","owner":"gryszzz","description":"KaspaScript: Rust compiler and Kaspa-native programmability kernel , AI-compatible , upgrade readiness.","archived":false,"fork":false,"pushed_at":"2026-06-13T03:00:53.000Z","size":2888,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-13T05:04:10.168Z","etag":null,"topics":["blockdag","bytecode","compiler","compiler-design","covenants","cyptocurrency","dapp","deterministic","dsl","kaspa","parser","rust","semantic-analysis","smart-contracts","verification","web3"],"latest_commit_sha":null,"homepage":"https://gryszzz.github.io/Kaspa-Script/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gryszzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"gryszzz","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":"kaspa:qpv7fcvdlz6th4hqjtm9qkkms2dw0raem963x3hm8glu3kjgj7922vy69hv85"}},"created_at":"2026-05-26T03:00:03.000Z","updated_at":"2026-06-13T03:00:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"666d164d-551a-4cee-8bf2-c8a53c3c6637","html_url":"https://github.com/gryszzz/Kaspa-Script","commit_stats":null,"previous_names":["gryszzz/kaspa-script"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gryszzz/Kaspa-Script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryszzz%2FKaspa-Script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryszzz%2FKaspa-Script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryszzz%2FKaspa-Script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryszzz%2FKaspa-Script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gryszzz","download_url":"https://codeload.github.com/gryszzz/Kaspa-Script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryszzz%2FKaspa-Script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34907985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockdag","bytecode","compiler","compiler-design","covenants","cyptocurrency","dapp","deterministic","dsl","kaspa","parser","rust","semantic-analysis","smart-contracts","verification","web3"],"created_at":"2026-06-29T00:01:23.454Z","updated_at":"2026-06-29T00:01:25.518Z","avatar_url":"https://github.com/gryszzz.png","language":"Rust","funding_links":["https://github.com/sponsors/gryszzz","kaspa:qpv7fcvdlz6th4hqjtm9qkkms2dw0raem963x3hm8glu3kjgj7922vy69hv85"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./logo.png\" alt=\"KaspaScript\" width=\"680\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA readable, deterministic language and toolkit for programmable UTXOs on Kaspa.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Write contract intent in \u003ccode\u003e.ks\u003c/code\u003e. Inspect the UTXO transition model. Compile source-grounded txscript. Package everything wallets, indexers, SDKs, and applications need to understand it.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e ·\n  \u003ca href=\"#what-kaspascript-does\"\u003eWhat It Does\u003c/a\u003e ·\n  \u003ca href=\"#example\"\u003eExample\u003c/a\u003e ·\n  \u003ca href=\"#current-status\"\u003eStatus\u003c/a\u003e ·\n  \u003ca href=\"https://gryszzz.github.io/Kaspa-Script/\"\u003eProject Site\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Rust 1.80+\" src=\"https://img.shields.io/badge/Rust-1.80%2B-111827?style=flat-square\u0026logo=rust\"\u003e\n  \u003cimg alt=\"Deterministic artifacts\" src=\"https://img.shields.io/badge/Artifacts-Deterministic-0f766e?style=flat-square\"\u003e\n  \u003cimg alt=\"Source grounded\" src=\"https://img.shields.io/badge/Protocol-Source_Grounded-0891b2?style=flat-square\"\u003e\n  \u003cimg alt=\"Verified TN12 target\" src=\"https://img.shields.io/badge/Target-Verified_TN12-2563eb?style=flat-square\"\u003e\n  \u003cimg alt=\"Mainnet status\" src=\"https://img.shields.io/badge/Mainnet-Not_Claimed-7c3aed?style=flat-square\"\u003e\n\u003c/p\u003e\n\n---\n\n## What Is KaspaScript?\n\nKaspaScript is a Rust-based language, compiler, and programmability toolkit for\nexpressing Kaspa-native UTXO behavior without writing raw txscript opcodes.\n\nIt is designed around how Kaspa actually works:\n\n- UTXOs and explicit value movement\n- deterministic scripts and artifacts\n- transaction-level input and output constraints\n- signatures, timelocks, hashlocks, and multisig\n- covenant lineage and state-transition modeling\n- BlockDAG-aware finality and sequencing assumptions\n- wallet signing intent and indexer interpretation\n- target-specific protocol evidence and readiness gates\n\nKaspaScript is not an Ethereum-style account runtime, and it does not pretend\nthat preview or testnet capabilities are active on mainnet.\n\n```text\nReadable .ks source\n        ↓\nSemantic checks and typed constraints\n        ↓\nCanonical UTXO application model\n        ↓\nTyped opcode-agnostic IR\n        ↓\nTarget-gated Kaspa txscript\n        ↓\nDeterministic artifact and kernel package\n        ↓\nWallet · SDK · Indexer · Node · Application\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Rust 1.80 or newer\n- Git\n\n### Build The Project\n\n```bash\ngit clone https://github.com/gryszzz/Kaspa-Script.git\ncd Kaspa-Script\ncargo build --workspace\n```\n\n### Explore A Contract\n\nStart with the included escrow contract:\n\n```bash\ncargo run -p kaspascript-cli -- \\\n  inspect tests/contracts/escrow.ks\n```\n\nKaspaScript explains the important parts:\n\n```text\ncontract Escrow\n  transition release\n    signing: 2-of-3 multisig\n    require: output(0).value \u003e= input(0).value\n    fees/change: external and explicit\n\n  transition refund\n    signing: buyer\n    require: block.height \u003e= timeout\n    require: output(0).script == buyer\n```\n\n### Compile It\n\n```bash\ncargo run -p kaspascript-cli -- \\\n  compile tests/contracts/escrow.ks \\\n  --target verified-tn12 \\\n  --output /tmp/escrow.artifact.json\n```\n\nThe artifact contains deterministic bytecode plus the application model,\nsigning intent, source hash, target, KIP requirements, and warnings.\n\n### Build An Application Package\n\n```bash\ncargo run -p kaspascript-cli -- \\\n  kernel package tests/contracts/escrow.ks \\\n  --target verified-tn12 \\\n  --compute-grams 1000 \\\n  --tx-bytes 400 \\\n  --output /tmp/escrow.kernel.json\n```\n\nThe kernel package adds wallet previews, capability profiles, indexer\nrequirements, fee assumptions, source evidence, and network readiness.\n\n## What KaspaScript Does\n\n| Surface | What you get |\n| --- | --- |\n| Language | Readable `.ks` contracts with typed parameters and explicit spend paths. |\n| Compiler | Lexer, parser, semantic analysis, typed IR, target gates, and deterministic txscript. |\n| Application model | Signing requirements, constraints, UTXO references, output bindings, continuation, and monetary responsibilities. |\n| Inspector | Human-readable and JSON explanations of what each transition requires. |\n| Kernel package | A single package for wallets, SDKs, indexers, agents, and review tools. |\n| Protocol grounding | Claims tied to pinned Kaspa sources, KIPs, releases, and activation posture. |\n| Verification | Golden artifacts, ASM/hex snapshots, negative tests, determinism tests, and fuzz smoke tests. |\n\n### Design Principles\n\n- No hidden recipients, fees, change, or monetary behavior.\n- No secret-key handling in generated application logic.\n- No abstraction that hides signing intent or UTXO ownership.\n- No unsupported opcode invention.\n- No mainnet claim beyond available evidence.\n- No linear-chain assumptions where BlockDAG behavior matters.\n- Every compiler output should be inspectable and explainable.\n\n## Example\n\n```kaspascript\ncontract Escrow {\n  params {\n    buyer: PublicKey,\n    seller: PublicKey,\n    arbiter: PublicKey,\n    timeout: BlockHeight,\n    finality_depth: 10,\n  }\n\n  spend release(sig_a: Signature, sig_b: Signature) {\n    require multisig(2, [buyer, seller, arbiter], [sig_a, sig_b]);\n    require output(0).value \u003e= input(0).value;\n  }\n\n  spend refund(sig: Signature) {\n    require sig.verify(buyer);\n    require block.height \u003e= timeout;\n    require output(0).script == buyer;\n  }\n}\n```\n\nKaspaScript preserves more than bytecode. The compiled application model can\nanswer:\n\n- Who can authorize `release` and `refund`?\n- Which inputs and outputs are referenced?\n- Which value and script constraints must hold?\n- Are extra outputs still permitted?\n- Does the source bind a successor state output?\n- Who remains responsible for fees and change?\n- What did the compiler prove, and what must a wallet or node verify?\n\nMachine-readable inspection is available for applications and coding agents:\n\n```bash\ncargo run -p kaspascript-cli -- \\\n  inspect tests/contracts/escrow.ks --json\n```\n\n## Core Commands\n\n```bash\n# Explain source or a compiled artifact\nkaspascript inspect contract.ks\nkaspascript inspect contract.ks --json\nkaspascript inspect contract.artifact.json\n\n# Compile deterministic artifacts\nkaspascript compile contract.ks --target verified-tn12\n\n# Verify emitted bytecode\nkaspascript verify contract.artifact.json\n\n# Check readiness and assumptions\nkaspascript kernel check contract.ks --target verified-tn12\nkaspascript doctor contract.ks --target future-mainnet --json\n\n# Preview wallet signing intent\nkaspascript kernel preview contract.ks --transition release\n\n# Package compiler, wallet, indexer, evidence, and fee metadata\nkaspascript kernel package contract.ks \\\n  --target verified-tn12 \\\n  --compute-grams 1000 \\\n  --tx-bytes 400\n\n# Inspect Toccata target and fee posture\nkaspascript toccata status\nkaspascript toccata targets\nkaspascript toccata fee --compute-grams 1000 --tx-bytes 400\n```\n\nFor operator and app-builder prep, see\n[`docs/TOCCATA_UPGRADE_CHECKLIST.md`](docs/TOCCATA_UPGRADE_CHECKLIST.md).\n\nWhen developing from the repository, prefix commands with:\n\n```bash\ncargo run -p kaspascript-cli --\n```\n\n## Contract Patterns\n\nReady-to-study examples live in [`tests/contracts`](tests/contracts).\n\n| Pattern | Demonstrates | Current posture |\n| --- | --- | --- |\n| Escrow | 2-of-3 release, timeout refund, value and script constraints | Verified TN12 subset |\n| Timelock | Signature authorization after a block-height threshold | Verified TN12 subset |\n| Multisig | Static threshold signatures | Verified TN12 subset |\n| Atomic swap | Hashlock claim path and timeout refund | Verified TN12 subset |\n| Vault | Owner/recovery paths with explicit output constraints | Verified subset, lineage future-gated |\n| DAGSafe channel | Cooperative, mediated, and timeout close paths | Verified TN12 subset |\n| DAGSafeVault | Covenant-oriented UTXO state-machine blueprint | TN10/kernel preview |\n\nCommitted deterministic outputs live in [`tests/golden`](tests/golden).\n\n## How The Pieces Fit\n\n```text\ncompiler/\n├── lexer       source positions and tokens\n├── parser      contracts, params, spends, and expressions\n├── semantic    types, scopes, builtins, and finality checks\n├── model       canonical Kaspa UTXO application model\n├── ir          opcode-agnostic instructions\n├── codegen     source-grounded txscript and artifacts\n└── protocol    target manifests and feature gates\n\nkernel/         wallet previews, capability profiles, indexer schemas,\n                source evidence, fee policy, and readiness reports\n\nsdk/            Rust compile API, kernel package builder, and preview transaction surfaces\ncli/            human and JSON workflows\ntests/          contracts, deterministic goldens, and integration tests\ndocs/           architecture, schemas, protocol audits, and roadmaps\n```\n\nThe important architectural rule is simple: the compiler, kernel, CLI, SDK,\nwallet integrations, and indexers should describe the same application model.\n\nRead the deeper design:\n\n- [KaspaScript Program Model](docs/KASPASCRIPT_PROGRAM_MODEL.md)\n- [Architecture Decision: Canonical Application Model](docs/architecture/ADR-001-canonical-application-model.md)\n- [Kaspa Programmability Kernel](docs/KASPA_PROGRAMMABILITY_KERNEL.md)\n- [Kernel Package Schema](docs/KERNEL_PACKAGE_SCHEMA.md)\n\n## Current Status\n\nKaspaScript is an active developer-preview project with a verified compiler\nsubset and deterministic tooling.\n\n### Available Today\n\n- complete V1 lexer, parser, semantic checker, typed IR, and txscript backend\n- canonical `kaspascript.application.v0` model\n- deterministic JSON, hex, and ASM artifacts\n- `verified-tn12`, `tn10-toccata`, `toccata-preview`, and `future-mainnet` gates\n- wallet previews and signing-intent metadata\n- kernel packages and versioned JSON report schemas\n- SDK kernel package builder, offline SDK flows, and feature-gated testnet harnesses\n\n### Intentionally Gated\n\n- production covenant-ID lowering\n- production ZK verifier lowering\n- script-visible sequencing flows\n- complete Rusty Kaspa transaction construction and broadcasting\n- production mainnet treatment\n\n`future-mainnet` remains blocked until activation, source compatibility,\nwallet/indexer assumptions, and fee behavior are independently verified.\n\nSee [Project Status](docs/PROJECT_STATUS.md) for the current roadmap and\n[Kaspa Source Audit](docs/kaspa-source-audit.md) for the evidence boundary.\n\n## Quality Gates\n\n```bash\ncargo fmt --all -- --check\ncargo test --workspace\ncargo clippy --workspace --all-targets -- -D warnings\ncargo test --workspace --features testnet-integration\n```\n\nThe repository checks:\n\n- deterministic compilation across repeated runs\n- committed artifact, bytecode, ASM, kernel, and CLI-report goldens\n- semantic and unsupported-feature failures\n- random-input lexer/parser panic resistance\n- feature-gated offline and live-testnet workflows\n\nLive RPC tests remain ignored unless the required testnet environment is\nconfigured. See [Testnet Guide](docs/TESTNET.md).\n\n## Documentation\n\n| Start here | Purpose |\n| --- | --- |\n| [Project Status](docs/PROJECT_STATUS.md) | What works, what is gated, and what comes next |\n| [Program Model](docs/KASPASCRIPT_PROGRAM_MODEL.md) | What a KaspaScript program means at every layer |\n| [Kernel Package](docs/KERNEL_PACKAGE_SCHEMA.md) | Wallet, indexer, evidence, and readiness package format |\n| [CLI Report Schemas](docs/CLI_REPORT_SCHEMAS.md) | Stable JSON contracts for agents and CI |\n| [Source Grounding](docs/source-grounding.md) | How protocol-sensitive claims are verified |\n| [Toccata Integration](docs/TOCCATA_V2_INTEGRATION.md) | Upgrade and integration posture |\n| [Transaction Builder](docs/TRANSACTION_BUILDER.md) | Current builder boundary and roadmap |\n\n## Contributing\n\nUseful contributions include:\n\n- language and semantic tests\n- deterministic compiler passes\n- wallet-preview fixtures\n- indexer lineage and reorg fixtures\n- protocol source audits\n- Rusty Kaspa compatibility work\n- documentation and beginner examples\n\nPlease keep changes deterministic, source-grounded, explicit about monetary\nbehavior, and honest about network readiness.\n\n## Support Development\n\nKaspa:\n\n```text\nkaspa:qpv7fcvdlz6th4hqjtm9qkkms2dw0raem963x3hm8glu3kjgj7922vy69hv85\n```\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eMake simple things simple, advanced things possible, and dangerous things obvious.\u003c/strong\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgryszzz%2Fkaspa-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgryszzz%2Fkaspa-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgryszzz%2Fkaspa-script/lists"}