from l3rs1.crypto import construct_asset_id, canonicalize
from l3rs1.types import AssetState
from l3rs1.modules import apply_state_transition
asset_id = construct_asset_id(
issuer_pubkey_hex="0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
timestamp_unix=1740355200,
nonce_hex="0000000000000001",
)
# → "593f0dfb3da2fb8e8e21059e26f4a1875e9059a6d9d634e3065541e6c193506a"
result = apply_state_transition(AssetState.ISSUED, "ACTIVATION")
# → StateTransitionResult(success=True, new_state=AssetState.ACTIVE)
§2.2 — I = H(pk_issuer ∥ ts ∥ nonce). Returns 64-char lowercase hex.
§8.3 — CID = H(I ∥ SH ∥ CH ∥ GH ∥ t).
§9.6 — TxID = H(sender ∥ receiver ∥ amount ∥ nonce ∥ timestamp).
§13.11 — Canonical JSON: sorted keys, no whitespace, UTF-8.
§2.5 — Deterministic state machine. Returns StateTransitionResult(success, new_state, error). Enforces Invariant I₁.
§4.3 — C: E → {0,1}. O(n) rule evaluation in priority order. First blocking rule terminates. Enforces I₂.
§6.12 — Raises ValueError if allocations don't sum to 10000 basis points.
§3.6 — Returns VALID, EXPIRED, or REVOKED.
§9.6 — Returns True if event's TxID is already in ledger history.
| Type | Section | Values |
|---|---|---|
AssetState | §2.4 | ISSUED · ACTIVE · RESTRICTED · FROZEN · SUSPENDED · REDEEMED · BURNED |
AssetType | §2.3 | CBDC · INDUSTRY_STABLE · REGULATED_SECURITY · UTILITY · GOVERNANCE · STORAGE_BACKED |
IdentityLevel | §3.2 | UNBOUND (0) · VERIFIED (1) · SOVEREIGN_VALIDATED (2) · MULTI_JURISDICTION (3) |
RuleType | §4.4 | HOLDING_PERIOD · SANCTIONS_SCREENING · TRANSACTION_THRESHOLD · … |
EnforcementAction | §4.7 | REJECT · FREEZE · RESTRICT · FLAG · REQUIRE_DISCLOSURE |
GovernanceAction | §5.3 | FREEZE_BALANCE · EMERGENCY_ROLLBACK · … |
| From | Trigger | To |
|---|---|---|
| ISSUED | ACTIVATION | ACTIVE |
| ACTIVE | BREACH | RESTRICTED |
| ACTIVE | FREEZE | FROZEN |
| RESTRICTED | CLEARED | ACTIVE |
| FROZEN | RELEASE | ACTIVE |
| ACTIVE | REDEMPTION | REDEEMED |
| REDEEMED | FINALIZATION | BURNED ⛔ |
| ACTIVE | SUSPENSION | SUSPENDED |
| SUSPENDED | REINSTATEMENT | ACTIVE |