params/params.go
56 lines
1// Package params holds the protocol constants, mirroring the "Constants"2// section of the specification. Everything else derives from these.3package params45const (6// TOKEN is one token in base units (8 decimals).7TOKEN uint64 = 100_000_00089// SlotsPerPeriod is four weeks in one-minute slots.10SlotsPerPeriod uint64 = 4032011SlotSeconds uint64 = 6012PeriodSeconds uint64 = SlotsPerPeriod * SlotSeconds // 2 419 20013SlotsPerPhase uint64 = 10080 // one week14NumPhases uint64 = 41516// Demurrage: coins retain 0.983 of their value per period (~20%/year).17// DecayShift is the fixed-point width and Decay0 the per-slot factor,18// floor(2^63 × 0.983^(1/SlotsPerPeriod)). The squaring chain built from19// Decay0 (see package coin) is the definition of the curve.20DecayShift uint = 6321Decay0 uint64 = 92233681145986172732223// UBIPerPeriod equals the demurrage on one token over one period:24// TOKEN × 1.7%.25UBIPerPeriod uint64 = 1_700_0002627// RentShift: rent = 1 base unit per 1 024 slots (~39 per period).28RentShift uint = 102930MaxMixes uint32 = 32 // cap on a token's mix_count31MaxOwners int = 8 // max owners per coin UTXO32InviteCost int = 3 // invite tokens per new registration3334// MaxBlockSize is a matter of consensus outside this library (e.g. 1 GB).35)3637// Token types in the token trie.38const (39TokenElection uint8 = 0x0040TokenRegistration uint8 = 0x0141TokenInvite uint8 = 0x0242)4344// Operation codes.45const (46OpTransfer uint8 = 0x0047OpMix uint8 = 0x0148OpVote uint8 = 0x0249OpRegister uint8 = 0x0350OpVerify uint8 = 0x0451OpVerified uint8 = 0x0552OpCommit uint8 = 0x0653OpReveal uint8 = 0x0754OpPrune uint8 = 0xFF55)