Skip to content
SINGULARITY

Protocol documentation

SINGULARITY is an experimental on-chain evolution protocol on Elysium. This document describes exactly what the contracts do, what the website does, and what neither of them promises.

Introduction

THE CORE is a shared directed acyclic graph of logic nodes. Users add nodes, wire them together, compile closed sets of nodes into circuits and compose circuits into programs. Every one of those changes consumes SING: the exact cost is transferred to SingularityCore and burned with the token's own burn function in the same transaction.

Reading state and evaluating circuits or programs is free. Only persistent changes and on-chain execution records cost SING. A free sandbox runs the identical rules in the browser with virtual SING, so every capability can be explored before launch.

Protocol architecture

Montra launchpad (Elysium)
  └─ official SING token (Montra LaunchToken, created by the founder)
       │  approve(exact cost)
       ▼
SingularityCore (independent companion contract)
  ├─ burn engine        transferFrom → burn → verify supply delta
  ├─ evolution engine   phase = f(protocol consumption, original supply)
  ├─ graph registry     nodes, permanent forward edges
  ├─ LogicEngine        deterministic netlist evaluation (library)
  └─ program registry   bounded compositions, nesting depth ≤ 2
       │  events
       ▼
Web application (static export) — sandbox model + chain reads/writes

Montra owns token creation, trading, liquidity and creator fees. SINGULARITY never deploys, mints, prices or trades a production token. The two systems share nothing except the ERC-20 interface.

Mathematical rules

  • Original supply S₀ is immutable and taken from Montra's TokenLaunched event, never from the current total supply.
  • Protocol consumption C is the sum of verified burns executed by SingularityCore. It never decreases.
  • Phase p is the largest i with C · 10,000 ≥ tᵢ · S₀ where t = [0, t₁, t₂, t₃, t₄] in basis points.
  • Global supply reduction S₀ − S includes burns outside the protocol and is displayed separately; it never affects p.
  • All token accounting is integer arithmetic (Solidity uint256, TypeScript BigInt). No floating point.

Evolution mechanics

PhaseDefault thresholdUnlocks
Genesis0 bpscreateNodes
Ignition5 bps (0.05%)connectNodes
Expansion20 bps (0.2%)createCircuit, executeCircuit
Convergence60 bps (0.6%)createProgram, executeProgram
Singularity150 bps (1.5%)programs that reference programs

The defaults above are proposals. Production thresholds and costs are fixed at deployment only after they are checked against the real Montra supply (see DEPLOYMENT.md and npm run economics). The sandbox uses accelerated thresholds on a virtual 100,000 SING supply (1k, 3k, 8k, 20k) and is never combined with production data.

Token consumption

Every paid action runs this procedure atomically. Any failure reverts the burn and the state change together.

1  validate the operation, permissions and phase
2  check balance ≥ cost and allowance ≥ cost
3  b₀ = balanceOf(core);  transferFrom(user, core, cost)
4  require balanceOf(core) − b₀ == cost          // rejects fee-on-transfer
5  s₀ = totalSupply();  token.burn(cost)
6  require s₀ − totalSupply() == cost            // rejects fake or partial burns
7  require balanceOf(core) == b₀                  // nothing accumulates
8  C += cost;  emit TokenConsumed;  advance phase (one event per crossing)
9  apply the state change and emit its event

A reverted transaction burns nothing, but the network fee for it is still paid, and a separately confirmed approval stays active until used or reset. The website always requests approval for the exact cost only.

ActionDevelopment cost
Create node1,000 SING
Create connection250 SING
Publish circuit2,500 SING
Publish program5,000 SING
Record execution100 SING
Explore, read, preview, sandboxFree

Node specification

  • Types: INPUT=0, OUTPUT=1, AND=2, OR=3, NOT=4, XOR=5.
  • Stored fields: owner, type, input value (INPUT only, 0 or 1), x and y within ±10,000, label (32 bytes of printable ASCII), up to two input references, timestamp and block.
  • IDs start at 1 and increase. Up to 32 nodes per transaction.
  • Edges must point from an older node to a newer one (from < to), so the graph is acyclic by construction. Only the owner of the receiving node can fill its input slots; any node can be used as a source.
  • OUTPUT nodes cannot drive other nodes. INPUT nodes cannot receive edges. Duplicate edges into one node are rejected. Edges are permanent.

Gate specification

GateInputsTruth table (00, 01, 10, 11)
AND20 0 0 1
OR20 1 1 1
XOR20 1 1 0
NOT11 0

Circuit execution

createCircuit(nodeIds) compiles a strictly ascending list of node IDs into a netlist. INPUT nodes become signals0…n−1 in ID order, each gate appends one signal, and OUTPUT nodes list the signals they read. Every gate and output must have all inputs connected, and every input must come from inside the set.

gate   = uint16  op(4) << 12 | in0(6) << 6 | in1(6)     NOT encodes in1 = 0
output = uint8   signal index
limits: ≤ 32 nodes, ≤ 8 inputs, ≤ 8 outputs, ≥ 1 gate
XOR    : gates 0x5001  outputs 0x02

Evaluation is a single forward pass over the gates with a bitmap of signal values. evaluateCircuit(id, inputs) is a free view; executeCircuit records the inputs and outputs on-chain for COST_EXECUTION. The TypeScript engine implements the same encoding and is checked against Solidity with 47 shared circuit vectors and 14 program vectors.

Program definition

  • A program has 1–8 inputs, 1–8 steps and 1–8 outputs. Each step calls a published circuit (or, from the Singularity phase, a published program) and maps one earlier signal to every callee input.
  • Callee outputs are appended as new signals. At most 64 signals and 256 gate evaluations per program, including nested programs. Nesting depth is at most 2.
  • Programs are immutable and public. Anyone may reuse any circuit or program as a component.

Challenges

A challenge is a target truth table. Solving one means building a circuit from THE CORE nodes you own whose output matches the target for every input combination. SingularityChallenges verifies this on-chain, so no judge or admin is involved.

  • Submit: submitSolution(challengeId, nodeIds). The contract checks that you own every node, compiles them through SingularityCore, and evaluates all 2n rows. A single wrong row reverts the whole transaction and nothing is burned.
  • Score: the number of gates in the node set (unused gates count). Fewer gates rank higher. Ties go to the earlier submission. A resubmission is accepted only if it uses fewer gates than your previous best.
  • Pin order: input bit i is the i-th INPUT node by ID, output bit j the j-th OUTPUT node by ID. The editor pins them in the right order and commits every INPUT first and every OUTPUT last.
  • Create: createChallenge(title, numInputs, numOutputs, target) burns a fixed fee. 1–8 inputs and outputs; one output byte per input row; duplicates of an existing truth table are rejected. Challenges cannot be edited or removed.
  • Genesis challenges are passed to the constructor at deployment from packages/shared/challenges.json. Their published par is the gate count of a reference solution kept in the test suite; it is beatable.
  • Fees: burned with the same verified-burn checks as the Core. They reduce SING supply but do not count toward evolution, because SingularityCore is immutable and only counts its own consumption. No fee is paid to anyone.
  • Public by design: a solution is public on-chain as soon as its nodes are wired. Someone can copy it, but a copy can only tie and ranks after an earlier submission. Submit right after committing.

Montra integration

  • Production SING is created only through Montra by the founder's own wallet. This repository contains no production token, factory, curve, pool or DEX.
  • Verified from Montra's published ABI: the LaunchToken exposes burn(uint256) and no burnFrom; decimals are 18; supply is fixed at launch between 1 billion and 1 quadrillion with no further minting, no owner and no transfer tax.
  • Not documented by Montra: whether burn lowers totalSupply. SingularityCore measures it and reverts otherwise, so an incompatible token can never count fake consumption.
  • Montra's own RPC refuses non-Montra transactions, so the app and deployments use the public Elysium RPC.
  • Official trading page format: https://montraxyz.com/token/<address in lowercase>.

Contract architecture

  • SingularityCore.sol: all state, consumption and evolution. No owner, admin, pause, proxy or withdrawal function. Token, original supply, thresholds and costs are immutable.
  • SingularityChallenges.sol: challenges, verified submissions and leaderboards. Reads nodes through SingularityCore. No owner, admin, pause, proxy, withdrawal or payout function.
  • LogicEngine.sol: pure library for netlist validation and evaluation.
  • MockSingToken.sol: development and testnet only. Never a production token.
  • IMontraToken.sol: the verified subset of the LaunchToken interface.

Security model

  • Reentrancy guard on every write. Balance and supply deltas are checked around every transfer and burn.
  • Batch sizes, circuit size, program steps, signals, gate evaluations and nesting are all bounded, so gas use per call is bounded.
  • Labels are restricted to printable ASCII on-chain and rendered as text, never as HTML.
  • Tokens sent to the contract by mistake are not counted and cannot be withdrawn by anyone, including the founder.
  • The frontend simulates every transaction before signing, shows only confirmed receipts as success, refuses writes on the wrong chain or with incomplete configuration, and never requests seed phrases, private keys or unlimited approvals.
  • Mainnet writes stay disabled until an explicit activation flag is set after review.

Developer interfaces

createNodes((uint8 nodeType,int16 x,int16 y,uint8 value,bytes32 label)[]) → firstId
connectNodes((uint32 from,uint32 to)[])
createCircuit(uint32[] nodeIds) → circuitId
createProgram(uint8 numInputs,(uint8 kind,uint32 id,bytes inputMap)[],bytes outputs) → programId
executeCircuit(uint256 id,uint8 inputs) → outputs
executeProgram(uint256 id,uint8 inputs) → outputs

compile(uint32[]) · evaluateCircuit · evaluateProgram · stats() · getNode · getNodes
getCircuit · getProgram · thresholdsBps · costs · thresholdAmount · phaseFor
getCurrentPhase · getProtocolConsumption · getRemainingToNextPhase · phaseBlocks

events: TokenConsumed NodeCreated NodesConnected CircuitCreated CircuitExecuted
        ProgramCreated ProgramExecuted EvolutionAdvanced
// SingularityChallenges
createChallenge(bytes32 title,uint8 numInputs,uint8 numOutputs,bytes target) → challengeId
submitSolution(uint256 challengeId,uint32[] nodeIds) → (gates, newRecord)

check(challengeId,nodeIds,solver) · getChallenge · challengeCount · getEntry · getEntries
costs · arenaConsumption · submissionCount · challengeIdOf

events: ArenaConsumed ChallengeCreated ChallengeSolved

SDK examples

The @singularity/logic-engine package is the SDK: the same engine powers the sandbox and the cross-checks against the contract.

import { compileGraph, evaluateNetlist, encodeGates, NodeType } from "@singularity/logic-engine";

const { netlist } = compileGraph({
  nodes: [
    { id: "a", type: NodeType.INPUT, rank: 0 },
    { id: "b", type: NodeType.INPUT, rank: 1 },
    { id: "x", type: NodeType.XOR, rank: 2 },
    { id: "q", type: NodeType.OUTPUT, rank: 3 },
  ],
  edges: [{ source: "a", target: "x" }, { source: "b", target: "x" }, { source: "x", target: "q" }],
});
evaluateNetlist(netlist, 0b01).outputs; // 1
encodeGates(netlist.gates);             // "0x5001" — same bytes as getCircuit().gates
// read with viem
const out = await client.readContract({
  address: CORE, abi: singularityCoreAbi,
  functionName: "evaluateCircuit", args: [1n, 0b01],
});

Known limitations

  • Montra's burn semantics are unverified until the real token exists; production consumption is blocked by the contract if they differ.
  • Fixed token costs can become expensive or trivial as the market price moves. There is deliberately no admin function to change them.
  • Thresholds of 0.05–1.5% of supply may take a long time to reach. The protocol remains fully usable in whatever phase it is in.
  • The explorer scans event logs directly from the RPC in bounded windows; very old history loads on request.
  • The 3D view renders at most 2,000 nodes and the editor loads the most recent 500 live nodes.
  • Node positions are visual metadata only and have no computational meaning.

Deployment addresses

ModeSANDBOX
Chain—
SING tokenNot launched
SingularityCoreNot deployed
SingularityChallengesNot deployed

Addresses appear here only after deployment and verification. Nothing on this site should be treated as official unless it matches the founder's published records.

Risk disclosures

  • SINGULARITY is experimental and has not been independently audited. Smart contracts can contain undiscovered bugs.
  • Consumed SING is destroyed permanently. Actions cannot be undone and there are no refunds.
  • SING is not an investment. Consumption does not guarantee scarcity value, price increases or any return. There are no rewards, dividends, yield or obligations to holders.
  • Users pay their own network fees, including for transactions that revert.
  • Token markets on Montra are operated by Montra, not by SINGULARITY. Trading carries a risk of total loss.
  • Nothing on this site is financial, legal or tax advice.