TypeScript Python Go Rust Java Solidity

Go SDK

github.com/L3RS-Foundation/L3RS-1/packages/go - Go 1.22+
go get github.com/L3RS-Foundation/L3RS-1/packages/go
Zero external dependencies - pure Go stdlib.

Quick Example

import "github.com/L3RS-Foundation/L3RS-1/packages/go/l3rs1/crypto"
import "github.com/L3RS-Foundation/L3RS-1/packages/go/l3rs1/modules"

id, _ := crypto.ConstructAssetID(
    "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
    1740355200, "0000000000000001")
// id = "593f0dfb3da2fb8e8e21059e26f4a1875e9059a6d9d634e3065541e6c193506a"

r := modules.ApplyStateTransition(types.AssetStateIssued, "ACTIVATION")
// r.Success == true, r.NewState == "ACTIVE"

API Reference

Function/Method§Description
constructAssetId / ConstructAssetID2.2H(pk_issuer ∥ ts ∥ nonce)
constructCID / ConstructCID8.3CID = H(I ∥ SH ∥ CH ∥ GH ∥ t)
constructTxId / ConstructTxID9.6TxID = H(sender ∥ receiver ∥ amount ∥ nonce ∥ ts)
canonicalize13.11Sorted-key JSON, no whitespace
applyStateTransition2.5Deterministic state machine, Invariant I1
evaluateCompliance4.3C: E to {0,1}, O(n), Invariant I2
validateFeeModule6.12Allocations must sum to 10000 bp
identityStatus3.6VALID / EXPIRED / REVOKED
isReplay9.6Replay protection via TxID/nonce

State Transition Matrix

FromTriggerTo
ISSUEDACTIVATIONACTIVE
ACTIVEBREACHRESTRICTED
ACTIVEFREEZEFROZEN
RESTRICTEDCLEAREDACTIVE
FROZENRELEASEACTIVE
ACTIVEREDEMPTIONREDEEMED
REDEEMEDFINALIZATIONBURNED (terminal)
ACTIVESUSPENSIONSUSPENDED
SUSPENDEDREINSTATEMENTACTIVE