Skip to main content

Totem Digital Asset System

The Totem Digital Asset System is Shamwari Network's protocol-native for issuing, managing, trading, and governing digital assets, equities, debt instruments, non-fungible tokens (NFTs), and Real-World Assets (RWAs).

Unlike legacy smart contract platforms that rely on EVM/WASM code execution—introducing multi-billion-dollar reentrancy risks and costly audit cycles—Shamwari embeds the full lifecycle of digital assets, multi-currency limit-order book trading, non-dilutive asset splits, and governance phasing directly into the blockchain consensus runtime.


1. System Architecture & Core Concepts

A Totem is a protocol-enforced digital representation of ownership bound to a specific sovereign BetaChain (e.g., ZWGZWG, ZARZAR).

+-----------------------------------------+
| TOTEM ASSET |
| (Name, Description, Decimals, Types) |
+-----------------------------------------+
|
+----------------------------------+----------------------------------+
| | |
v v v
+------------------+ +--------------------+ +--------------------+
| TotemType Rules | | Multi-Currency DEX | | TotemControl |
| - NON_FUNGIBLE | | - Native Orderbook| | - Phased Voting |
| - NON_SPLITTABLE| | - Tax Withholding | | - Whitelist Rules |
+------------------+ +--------------------+ +--------------------+

Core Data Model (Totem.java)

Each Totem record maintains the following immutable and mutable properties on-chain:

ParameterTypeDescription
totemIdlongUnique 64-bit integer identifier generated from the issuance transaction hash.
issuerIdlongAccount ID of the entity that created the Totem.
betaChainBetaChainThe specific sovereign child-chain where the asset resides and trades.
nameStringHuman-readable identifier (unique indexed).
descriptionStringAsset description (up to 1000 characters).
typeintBitmask defining Totem capabilities (TotemType).
quantityQNTlongCurrent circulating supply in base Quantum Units (QNT).
maxQuantityQNTlongMaximum allowable total supply cap (QNT).
decimalsbyteDivisibility precision (0 to 8).
hasPhasingControlbooleanFlag indicating if operations require governance poll approvals.

2. Totem Types & Classification (TotemType.java)

Shamwari strictly validates asset behavior based on strict protocol-enforced bitmasks. Assets must adhere to mutually exclusive classification rules:

A. Non-Fungible Assets (NON_FUNGIBLE = 0x01)

  • Quantity Constraints: Initial supply must be exactly 1 QNT, maxQuantityQNT must be 1, and decimals must be 0.
  • Operational Rules: Supply cannot be increased (TOTEM_INCREASE is prohibited). Metadata properties can only be modified or set by the original issuer.
  • Use Cases: Titles of land, vehicle registrations, identity certificates, physical real-world asset (RWA) tokens.

B. Non-Splittable Fixed Assets (NON_SPLITTABLE = 0x02)

  • Quantity Constraints: maxQuantityQNT must equal the initial quantityQNT.
  • Operational Rules: Supply increases (TOTEM_INCREASE) are structurally blocked by consensus.
  • Use Cases: Fixed-cap corporate bond issuances, fixed-supply utility tokens, capped equity rounds.

C. Splittable Assets (SPLITTABLE = 0x04)

  • Quantity Constraints: maxQuantityQNT must be strictly greater than initial quantityQNT.
  • Operational Rules: Allows proportional non-dilutive share increases across all existing holders based on snapshot block heights.
  • Use Cases: Public equities, fund units, tokenized real-estate trusts.

3. Protocol-Native Order-Book Exchange Engine (OrderHome.java & TradeHome.java)

The Totem Exchange Engine eliminates Automated Market Makers (AMMs) and liquidity provider impermanent loss by embedding a high-throughput, deterministic limit-order book directly into each sovereign BetaChain.

Order Matching Algorithm

Trading orders are paired automatically during block execution using a deterministic Price-Time Priority matching engine:

  1. Ask Sorting: ORDER BY price ASC, creation_height ASC, transaction_height ASC, transaction_index ASC
  2. Bid Sorting: ORDER BY price DESC, creation_height ASC, transaction_height ASC, transaction_index ASC
  3. Execution Price: Determined by the resting order (maker price).
[Ask Order (Seller)] ---\
+---> [Order Matching Loop] ---> [Capital Gains Tax Engine] ---> [Balance Settlement]
[Bid Order (Buyer)] ---/

Protocol-Level Tax Withholding

When an Ask order and Bid order match, the chain automatically calculates and deducts regulatory withholding tax before settling funds:

Taxtotal=TaxCalculator.computeTotalTax(TOTEM_ASK_ORDER_PLACEMENT,TaxPolicy,AmountQNT)NetSellerAmountQNT=AmountQNTTaxtotal\text{Tax}_{\text{total}} = \text{TaxCalculator.computeTotalTax}(\text{TOTEM\_ASK\_ORDER\_PLACEMENT}, \text{TaxPolicy}, \text{Amount}_{\text{QNT}}) \text{NetSellerAmount}_{\text{QNT}} = \text{Amount}_{\text{QNT}} - \text{Tax}_{\text{total}}
  • Seller Settlement: Receives NetSellerAmount in target currency.
  • Tax Collector Settlement: Tax_total is immediately credited to the sovereign tax collector account (CurrencyTaxRecord.creditTaxAccount) specified by the BetaChain tax policy.
  • Buyer Settlement: Receives exact filled Totem QNT quantity without incurring additional hidden slippage.

4. Corporate Actions & Asset Lifecycle

Proportional Non-Dilutive Supply Increases (increaseTotem)

For SPLITTABLE Totems, issuers can increase circulating supply (e.g., executing stock splits or capitalization issues) without diluting existing shareholder ratios:

  1. A snapshot height H_snap is specified.
  2. The system queries account holdings at H_snap via Account.getTotemAccounts.
  3. For each holder i with holding Q_i, the additional allocation is calculated:
Qi,new=Convert.unitRateToAmount(Qi,decimals,increasePerShareQNT,decimals)Q_{i, \text{new}} = \text{Convert.unitRateToAmount}(Q_i, \text{decimals}, \text{increasePerShareQNT}, \text{decimals})
  1. Total supply increases by sum of Q_i_new, maintaining exact relative equity ownership percentages across all shareholders.

Dividend Distributions (dividendPayment)

Totem issuers can distribute currency dividends directly to all asset holders. Payments are calculated proportionally based on snapshot account balances and dispatched via protocol ledger events (TOTEM_DIVIDEND_PAYMENT).

Asset Deletion & Burning (deleteTotem)

Holders can permanently decrease circulating supply by deleting Totems from their balance. Deletions are logged immutably in TotemHistory with a negative quantity change (-QNT).


5. Metadata & Provenance Properties (TotemProperty)

Totems support dynamic key-value property attachments, enabling enterprise metadata management linked to post-quantum digital certificates:

+-------------------------------------------------------------------------+
| TOTEM PROPERTY |
| (Property Key, Value, Setter Account ID, PQC Certificate ID Anchor) |
+-------------------------------------------------------------------------+

System Standard Properties

  • Freeze (TOTEM_FREEZE_HEIGHT_PROPERTY): Height at which trading and transfers are frozen by regulatory order.
  • Migrate (TOTEM_MIGRATE_HEIGHT_PROPERTY): Block height specifying mandatory cross-chain or asset migration.
  • certificateId: Links property attestations directly to a NIST FIPS 204 (ML-DSA-2) PQC digital identity certificate.

6. Governance & Phasing Control (TotemControl.java)

Sensitive operations on high-value Totems can be gated behind protocol-enforced governance policies via TotemControl.

Controlled Transaction Types

When phasing control is enabled on a Totem, the following transaction types require formal poll execution before taking effect:

  • TOTEM_TRANSFER
  • TOTEM_DELETE
  • ASK_ORDER_PLACEMENT / BID_ORDER_PLACEMENT
  • DIVIDEND_PAYMENT
  • TOTEM_INCREASE
  • TOTEM_PROPERTY_SET / TOTEM_PROPERTY_DELETE
  • SHUFFLING_CREATION

Voting Models & Sub-Polls

TotemControl supports complex approval rules:

  • Whitelist Models: Only pre-approved account addresses can vote or sign off.
  • Property-Weighted Voting: Voting power proportional to specific account property claims.
  • Sub-Poll Expressions: Conditional logical trees (PhasingOnlySubPoll) requiring multi-factor stakeholder consensus.

Summary Matrix

FeatureEVM Smart Contract EquivalentShamwari Totem Native Advantage
Asset SecurityCustom ERC-20 / ERC-1155 codeConsensus-layer execution; immune to reentrancy.
Trading EngineUniswap / AMM Smart ContractsBuilt-in order book with Price-Time priority matching.
Tax WithholdingManual contract fee hooksAutomatic regulatory tax calculation & collector dispatch.
Asset SplitsManual rebase contracts / Dilutive mintsNon-dilutive, snapshot-based proportional share increases.
GovernanceCompound DAO smart contractsOn-chain TotemControl phasing & sub-poll voting engine.