HYBRID DEVNET · PUBLIC EVIDENCE LIVEVerifiable infrastructure for value, markets, identity, and operational dataInspect the network
Developers/HybridScript 0.1/Write your first HybridScript
LANGUAGE & RUNTIME · VERSION 0.1

Write your first HybridScript

A small language for deterministic computation, explicit capabilities, and inspectable state transitions.

Preview profilehybridscript-0.1-previewReviewed 2026-09-30

Language reference 0.1 · preview

HybridScript is Python-derived, but it is not a general Python environment. The reference interpreter walks a validated syntax tree; it does not execute CPython bytecode. This manual documents the hybridscript-0.1-preview profile (profile version 0.1.0). Documentation version 0.1 does not mean that every target deployment enables that runtime.

This section explains program behavior. The API reference remains authoritative for requests, authentication, publication, deployment, and execution access. SDKs, supported installation packages, and GitHub release downloads are a separate forthcoming workstream; this manual does not announce a library release.

A complete example

This example adds an integer to private contract state and emits a demonstration event. It does not transfer funds. Entrypoints take exactly two arguments: the supplied context and input value.

contract.py
from hybrid import contract, state, event

@contract.entrypoint
def accumulate(ctx, payload):
    previous = state.get("total")
    if previous == None:
        previous = 0
    total = previous + int(payload["amount"])
    state.put("total", total)
    event.emit("demo.accumulated", {"total": total})
    return {"total": total}

Declare the package boundary

The manifest must identify the exact profile, entrypoints, execution budget, and capabilities. This JSON object is the manifest representation used by the registry. The source tooling also reads equivalent fields from hybrid.toml.

manifest.json
{
  "profile": "hybridscript-0.1-preview",
  "entrypoints": [
    "accumulate"
  ],
  "execution_limit": 50000,
  "capabilities": {
    "state": [
      "private:read",
      "private:write"
    ],
    "events": [
      "demo.*"
    ]
  }
}

Check the outcome

These results were checked with the pinned reference interpreter. Validate the source, build the package, and simulate with the declared capabilities before requesting an enabled execution. A simulation result is not a deployed contract or a payment.

ItemValue
Input{"amount":7}
Initial state{"total":5}
Output{"total":12}
Resulting state{"total":12}
Eventdemo.accumulated with {"total":12}

From source to evidence

StepWhat to check
ValidateSyntax, imports, entrypoints, and profile diagnostics.
PackageSource, manifest, policy, capability, and schedule commitments.
SimulateExpected output, state transition, events, and rejected cases.
IntegrateUse the current Execution Studio API contract and admitted environment.
InspectRetain the receipt and any independently verifiable node attestation.