Skip to content

Your first app

Argent is a Rust workspace. Clone it and run the standard check loop first — if that passes, the toolchain is good.

Terminal window
git clone https://github.com/argent-lang/argent
cd argent
./check.sh

Build the tickets app

Terminal window
cargo run -- build examples/tickets.ag --out examples/build/tickets

Three things land in the output directory, and it is worth knowing what each is before moving on:

OutputWhat it is
sil/*.silGenerated Silverscript — plain, auditable, and the thing you review
artifact.jsonThe portable artifact the runtime consumes
manifest.jsonBuild metadata

When one source file declares several apps, pick one by name:

Terminal window
cargo run -- build contracts.ag --app DexCore --out build/dex-core

Inspect before you trust

Terminal window
cargo run --bin argentc -- inspect examples/build/tickets

The report summarises actor script, state and template sizes, static opcode counts, entry arguments and generated witnesses, route metadata, and signature-script size estimates.

Two reasons to run this early. Practically, script and witness sizes drive your transaction costs, and it is better to find out now than after you have designed around something too large. More importantly, it is the habit the next section depends on.

Read the generated Silverscript

Terminal window
cat examples/build/tickets/sil/*.sil

Open the .ag source and the generated .sil side by side. You are looking for the correspondence: which entry became which function, where your requires went, how the successor’s constraints were encoded, and what the compiler added that you did not write — routing, template commitments, and the witness material that makes the whole thing check out.

Within each generated contract, Silverscript supplies the types, expressions, functions, arrays, loops and control flow, then does the final type checking and Kaspa Script compilation. Argent does not use Silverscript’s covenant macros — it generates the covenant logic itself.

Where to go after tickets

examples/tickets.ag is deliberately one actor. Once it makes sense, the interesting examples are:

  • examples/stones/ — a real multi-file application, split across app, game, league, player, settle and types. This is the one that shows what the language is for.
  • examples/spawns.ag — constrained covenant spawning.
  • examples/icc/ — closed inter-covenant communication: a minter and an asset that are compiled separately and still transition together.
  • examples/open_icc/ — open ICC, where a core app accepts actors it was not compiled against.

Upstream reference

The repository’s docs/ is written for compiler authors, and it is good. Once you are past the basics: argent-design.md, icc-semantics.md, route-planner.md, and the security invariants.