Runnable developer learning
ENTITY Code Tutorials
These tutorials execute real ENTITY code against the pinned source commit. Each page includes the exact source file, recorded terminal run and an embedded browser-safe terminal replay.
Verification baseline: ENTITY commit
5be325437a63c2efaee0dc3caaae9ab0cd0773d9. Generated IDs and hashes vary; documented PASS/BLOCKED invariants must remain stable.Start coding
1 - Create, verify and sign with an ENTITY identityCreate an ent2 identity, verify its manifest, sign a payload and rotate the signing key.2 - Exercise authority, rights and provenanceDelegate bounded authority, constrain rights and compute deterministic provenance allocation.3 - Export and verify a portable sovereign bundleExport a portable bundle, verify it, then prove tampering fails closed.4 - Require two independent attestationsRequire two signed attestations without inferring objective truth.5 - Initialize BTDU and verify the ADAM dependency boundaryInitialize BTDU with the verified ADAM source dependency and inspect runtime status.6 - Encrypt bytes and enforce one-use purpose accessStore encrypted bytes, grant one bounded RESEARCH/READ use, consume it, then prove a second use fails closed.7 - Issue and verify rights and global passportsIssue a rights passport for a governed dataset, register a global profile, then wrap both into a verifiable global passport.8 - Detect a divergent offline partition conflictCreate two EDGE nodes, sign offline work, publish concurrent divergent checkpoints and prove ENTITY refuses automatic last-writer-wins.9 - Execute a rights trade without pretending payment occurredCreate a venue, rights instrument, disclosure and listing, match BUY/SELL orders, then prove execution remains distinct from settlement and external payment.10 - Preserve retention evidence and enforce legal holdDestroy governed payload state while preserving its commitment, then prove a legal hold blocks destruction.11 - Encrypt confidential provenance metadataRecord private lineage metadata, reveal it with the correct key and prove a wrong key fails closed.12 - Map ODRL, VC and DID without importing authorityTranslate ODRL rights and capture VC/DID evidence while preserving ENTITY's authority boundary.13 - Require a 2-of-3 recovery quorumCreate a recovery policy, block an unauthorized approver and require two authorized approvals before readiness.
How to use these examples
- Use a current ENTITY checkout.
- Set
ENTITY_ROOT. - Use disposable state only.
- Run the example and compare invariant results.
- If a negative control unexpectedly succeeds, stop and investigate.