JAR: Join-Accumulate Refine

6.2. Service Account Types (§8)🔗

🔗structure
Jar.ServiceAccount [Jar.JarConfig] : Type
Jar.ServiceAccount [Jar.JarConfig] : Type

𝔸 : Service account. GP eq (9.3). A = ⟨s, p, l, econ, c, g, m, i, r, a⟩

Contains code, storage, preimages, and gas configuration. The economic model (balance vs quota) is determined by the variant.

Constructor

Jar.ServiceAccount.mk

Fields

storage : Dict ByteArray ByteArray

s : Key-value storage. ⟨𝔹→𝔹⟩.

preimages : Dict Hash ByteArray

p : Preimage lookup. ⟨ℍ→𝔹⟩.

preimageInfo : Dict (Hash × Jar.BlobLength) (Array Jar.Timeslot)

l : Preimage request metadata. ⟨(ℍ, ℕ_L) → ⟦ℕ_T⟧_{:3}⟩.

econ : Jar.JarConfig.EconType

Economic model fields (balance+gratis for gp072, quotaItems+quotaBytes for jar1).

codeHash : Hash

c : Service code hash. ℍ.

minAccGas : Jar.Gas

g : Minimum accumulation gas. ℕ_G.

minOnTransferGas : Jar.Gas

m : Minimum on-transfer (memo) gas. ℕ_G.

itemCount : UInt32

a_i : Number of storage items. ℕ_I.

creationSlot : Jar.Timeslot

a_r : Creation timeslot. ℕ_T.

lastAccumulation : Jar.Timeslot

a_a : Most recent accumulation timeslot. ℕ_T.

parentServiceId : Nat

a_p : Parent service ID. ℕ_S.

totalFootprint : Nat

a_o : Total storage footprint in octets (computed). Preserved from serialized state.

🔗structure
Jar.PrivilegedServices : Type
Jar.PrivilegedServices : Type

χ : Privileged service identifiers. GP §9.4. χ = ⟨χ_M, χ_A, χ_V, χ_R, χ_Z, χ_Q⟩

Constructor

Jar.PrivilegedServices.mk

Fields

manager : Jar.ServiceId

χ_M : Manager (blessed) service. ℕ_S.

assigners : Array Jar.ServiceId

χ_A : Core assigner services. ⟦ℕ_S⟧_C.

designator : Jar.ServiceId

χ_V : Validator-set designator service. ℕ_S.

registrar : Jar.ServiceId

χ_R : Registrar service. ℕ_S.

alwaysAccumulate : Dict Jar.ServiceId Jar.Gas

χ_Z : Always-accumulate services with gas limits. ⟨ℕ_S → ℕ_G⟩.

quotaService : Jar.ServiceId

χ_Q : Quota manager service (jar1 coinless). ℕ_S.

🔗structure
Jar.DeferredTransfer [Jar.JarConfig] : Type
Jar.DeferredTransfer [Jar.JarConfig] : Type

𝕏 : Deferred transfer. GP eq (12.3). X = ⟨s, d, payload, m, g⟩ The economic payload (token amount vs nothing) is determined by the variant.

Constructor

Jar.DeferredTransfer.mk

Fields

source : Jar.ServiceId

s : Source service. ℕ_S.

dest : Jar.ServiceId

d : Destination service. ℕ_S.

payload : Jar.JarConfig.TransferType

Economic payload (amount for gp072, unit for jar1).

memo : OctetSeq Jar.W_T

m : Memo. 𝔹_{W_T} (128 bytes).

gas : Jar.Gas

g : Gas limit for on-transfer. ℕ_G.

🔗structure
Jar.BalanceEcon : Type
Jar.BalanceEcon : Type

Balance-based economic model (gp072 variants). Services must hold sufficient balance to cover storage costs. GP §9, eq (9.8): a_t = B_S + B_I × items + B_L × bytes - min(f, minBal).

Constructor

Jar.BalanceEcon.mk

Fields

balance : Jar.Balance

b : Account balance. ℕ_B.

gratis : Jar.Balance

f : Free (gratis) storage allowance. ℕ_B.

🔗structure
Jar.BalanceTransfer : Type
Jar.BalanceTransfer : Type

Balance-based transfer payload (gp072 variants). Carries a token amount to be debited from sender and credited to receiver.

Constructor

Jar.BalanceTransfer.mk

Fields

amount : Jar.Balance

a : Transfer amount. ℕ_B.

🔗structure
Jar.QuotaEcon : Type
Jar.QuotaEcon : Type

Quota-based economic model (jar1 coinless). Storage limits set by a privileged quota service (χ_Q).

Constructor

Jar.QuotaEcon.mk

Fields

quotaItems : UInt64

q_i : Maximum storage items allowed.

quotaBytes : UInt64

q_o : Maximum storage bytes allowed.

🔗structure
Jar.QuotaTransfer : Type
Jar.QuotaTransfer : Type

Quota-based transfer payload (jar1 coinless). Pure message-passing — no token amount.

Constructor

Jar.QuotaTransfer.mk