cyberia 3.0.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/{.env.production → .env.example} +20 -2
  2. package/.github/workflows/engine-cyberia.cd.yml +41 -10
  3. package/.github/workflows/engine-cyberia.ci.yml +53 -14
  4. package/.github/workflows/ghpkg.ci.yml +1 -1
  5. package/.github/workflows/gitlab.ci.yml +1 -1
  6. package/.github/workflows/hardhat.ci.yml +82 -0
  7. package/.github/workflows/npmpkg.ci.yml +37 -8
  8. package/.github/workflows/publish.ci.yml +5 -5
  9. package/.github/workflows/publish.cyberia.ci.yml +5 -5
  10. package/.github/workflows/pwa-microservices-template-page.cd.yml +3 -3
  11. package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
  12. package/.github/workflows/release.cd.yml +3 -2
  13. package/.vscode/extensions.json +9 -8
  14. package/.vscode/settings.json +3 -2
  15. package/CHANGELOG.md +533 -290
  16. package/CLI-HELP.md +79 -53
  17. package/WHITE-PAPER.md +1540 -0
  18. package/bin/build.js +16 -11
  19. package/bin/cyberia.js +959 -8
  20. package/bin/deploy.js +103 -270
  21. package/bin/file.js +2 -1
  22. package/bin/index.js +959 -8
  23. package/bin/vs.js +3 -3
  24. package/conf.js +277 -77
  25. package/deployment.yaml +218 -4
  26. package/hardhat/.env.example +31 -0
  27. package/hardhat/README.md +531 -0
  28. package/hardhat/WHITE-PAPER.md +1540 -0
  29. package/hardhat/contracts/ObjectLayerToken.sol +391 -0
  30. package/hardhat/deployments/.gitkeep +0 -0
  31. package/hardhat/deployments/hardhat-ObjectLayerToken.json +11 -0
  32. package/hardhat/hardhat.config.js +136 -0
  33. package/hardhat/ignition/modules/ObjectLayerToken.js +21 -0
  34. package/hardhat/networks/besu-object-layer.network.json +138 -0
  35. package/hardhat/package-lock.json +7628 -0
  36. package/hardhat/package.json +45 -0
  37. package/hardhat/scripts/deployObjectLayerToken.js +98 -0
  38. package/hardhat/test/ObjectLayerToken.js +590 -0
  39. package/jsdoc.dd-cyberia.json +59 -0
  40. package/jsdoc.json +20 -13
  41. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  42. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  43. package/manifests/deployment/dd-cyberia-development/deployment.yaml +490 -0
  44. package/manifests/deployment/dd-cyberia-development/proxy.yaml +261 -0
  45. package/manifests/deployment/dd-cyberia-development/pv-pvc.yaml +132 -0
  46. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  47. package/manifests/deployment/dd-test-development/deployment.yaml +52 -52
  48. package/manifests/deployment/dd-test-development/proxy.yaml +4 -4
  49. package/manifests/pv-pvc-dd.yaml +1 -1
  50. package/package.json +60 -50
  51. package/proxy.yaml +128 -9
  52. package/pv-pvc.yaml +132 -0
  53. package/scripts/k3s-node-setup.sh +1 -1
  54. package/scripts/ports-ls.sh +2 -0
  55. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +3 -1
  56. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +1 -2
  57. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +40 -7
  58. package/src/api/document/document.service.js +1 -1
  59. package/src/api/file/file.controller.js +3 -1
  60. package/src/api/file/file.service.js +28 -5
  61. package/src/api/ipfs/ipfs.service.js +2 -2
  62. package/src/api/object-layer/object-layer.controller.js +6 -2
  63. package/src/api/object-layer/object-layer.model.js +67 -21
  64. package/src/api/object-layer/object-layer.router.js +668 -42
  65. package/src/api/object-layer/object-layer.service.js +10 -16
  66. package/src/api/object-layer-render-frames/object-layer-render-frames.model.js +1 -2
  67. package/src/api/user/user.router.js +10 -5
  68. package/src/api/user/user.service.js +7 -7
  69. package/src/cli/baremetal.js +6 -10
  70. package/src/cli/cloud-init.js +0 -3
  71. package/src/cli/db.js +54 -71
  72. package/src/cli/deploy.js +64 -12
  73. package/src/cli/env.js +5 -5
  74. package/src/cli/fs.js +0 -2
  75. package/src/cli/image.js +0 -3
  76. package/src/cli/index.js +41 -13
  77. package/src/cli/monitor.js +5 -6
  78. package/src/cli/repository.js +329 -46
  79. package/src/cli/run.js +210 -122
  80. package/src/cli/secrets.js +1 -3
  81. package/src/cli/ssh.js +1 -1
  82. package/src/client/Itemledger.index.js +1 -959
  83. package/src/client/Underpost.index.js +36 -0
  84. package/src/client/components/core/AgGrid.js +20 -5
  85. package/src/client/components/core/Alert.js +2 -2
  86. package/src/client/components/core/Content.js +22 -3
  87. package/src/client/components/core/Docs.js +30 -6
  88. package/src/client/components/core/FileExplorer.js +71 -4
  89. package/src/client/components/core/Input.js +1 -1
  90. package/src/client/components/core/Modal.js +22 -6
  91. package/src/client/components/core/PublicProfile.js +3 -3
  92. package/src/client/components/core/RichText.js +1 -2
  93. package/src/client/components/core/Router.js +34 -1
  94. package/src/client/components/core/Worker.js +1 -1
  95. package/src/client/components/cryptokoyn/CssCryptokoyn.js +63 -1
  96. package/src/client/components/cyberia/ObjectLayerEngineModal.js +145 -119
  97. package/src/client/components/cyberia/ObjectLayerEngineViewer.js +64 -6
  98. package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +1 -0
  99. package/src/client/components/cyberia-portal/CssCyberiaPortal.js +44 -2
  100. package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +0 -1
  101. package/src/client/components/cyberia-portal/MenuCyberiaPortal.js +64 -2
  102. package/src/client/components/cyberia-portal/RoutesCyberiaPortal.js +1 -0
  103. package/src/client/components/itemledger/CssItemledger.js +62 -0
  104. package/src/client/components/underpost/CommonUnderpost.js +29 -0
  105. package/src/client/components/underpost/CssUnderpost.js +281 -0
  106. package/src/client/components/underpost/CyberpunkBloggerUnderpost.js +879 -0
  107. package/src/client/components/underpost/DocumentSearchProvider.js +448 -0
  108. package/src/client/components/underpost/ElementsUnderpost.js +38 -0
  109. package/src/client/components/underpost/LabGalleryUnderpost.js +82 -0
  110. package/src/client/components/underpost/LogInUnderpost.js +23 -0
  111. package/src/client/components/underpost/LogOutUnderpost.js +15 -0
  112. package/src/client/components/underpost/MenuUnderpost.js +691 -0
  113. package/src/client/components/underpost/RoutesUnderpost.js +47 -0
  114. package/src/client/components/underpost/SettingsUnderpost.js +16 -0
  115. package/src/client/components/underpost/SignUpUnderpost.js +9 -0
  116. package/src/client/components/underpost/SocketIoUnderpost.js +54 -0
  117. package/src/client/components/underpost/TranslateUnderpost.js +10 -0
  118. package/src/client/public/cryptokoyn/assets/logo/base-icon.png +0 -0
  119. package/src/client/public/cryptokoyn/browserconfig.xml +12 -0
  120. package/src/client/public/cryptokoyn/microdata.json +85 -0
  121. package/src/client/public/cryptokoyn/site.webmanifest +57 -0
  122. package/src/client/public/cryptokoyn/sitemap +3 -3
  123. package/src/client/public/default/sitemap +3 -3
  124. package/src/client/public/itemledger/browserconfig.xml +2 -2
  125. package/src/client/public/itemledger/manifest.webmanifest +4 -4
  126. package/src/client/public/itemledger/microdata.json +71 -0
  127. package/src/client/public/itemledger/sitemap +3 -3
  128. package/src/client/public/itemledger/yandex-browser-manifest.json +2 -2
  129. package/src/client/public/test/sitemap +3 -3
  130. package/src/client/services/object-layer/object-layer.management.js +23 -4
  131. package/src/client/ssr/body/404.js +15 -11
  132. package/src/client/ssr/body/500.js +15 -11
  133. package/src/client/ssr/body/SwaggerDarkMode.js +285 -0
  134. package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +83 -0
  135. package/src/client/ssr/head/PwaItemledger.js +60 -0
  136. package/src/client/ssr/head/UnderpostScripts.js +6 -0
  137. package/src/client/ssr/offline/NoNetworkConnection.js +11 -10
  138. package/src/client/ssr/pages/Test.js +11 -10
  139. package/src/client.build.js +0 -3
  140. package/src/client.dev.js +0 -3
  141. package/src/db/DataBaseProvider.js +17 -2
  142. package/src/db/mariadb/MariaDB.js +14 -9
  143. package/src/db/mongo/MongooseDB.js +17 -1
  144. package/src/index.js +1 -1
  145. package/src/proxy.js +0 -3
  146. package/src/runtime/express/Express.js +15 -9
  147. package/src/runtime/lampp/Lampp.js +6 -13
  148. package/src/server/auth.js +12 -14
  149. package/src/server/backup.js +2 -3
  150. package/src/server/besu-genesis-generator.js +1630 -0
  151. package/src/server/client-build-docs.js +126 -17
  152. package/src/server/client-build-live.js +9 -18
  153. package/src/server/client-build.js +203 -75
  154. package/src/server/client-dev-server.js +14 -13
  155. package/src/server/conf.js +376 -164
  156. package/src/server/cron.js +2 -1
  157. package/src/server/dns.js +28 -12
  158. package/src/server/downloader.js +0 -2
  159. package/src/server/logger.js +27 -9
  160. package/src/server/object-layer.js +92 -16
  161. package/src/server/peer.js +0 -2
  162. package/src/server/process.js +1 -50
  163. package/src/server/proxy.js +4 -8
  164. package/src/server/runtime.js +5 -8
  165. package/src/server/semantic-layer-generator.js +1 -0
  166. package/src/server/ssr.js +0 -3
  167. package/src/server/start.js +19 -12
  168. package/src/server/tls.js +0 -2
  169. package/src/server.js +0 -4
  170. package/.env.development +0 -43
  171. package/.env.test +0 -43
  172. package/hardhat/contracts/CryptoKoyn.sol +0 -59
  173. package/hardhat/contracts/ItemLedger.sol +0 -73
  174. package/hardhat/contracts/Lock.sol +0 -34
  175. package/hardhat/hardhat.config.cjs +0 -45
  176. package/hardhat/ignition/modules/Lock.js +0 -18
  177. package/hardhat/networks/cryptokoyn-itemledger.network.json +0 -29
  178. package/hardhat/scripts/deployCryptokoyn.cjs +0 -25
  179. package/hardhat/scripts/deployItemledger.cjs +0 -25
  180. package/hardhat/test/Lock.js +0 -126
  181. package/hardhat/white-paper.md +0 -581
  182. package/white-paper.md +0 -581
package/WHITE-PAPER.md ADDED
@@ -0,0 +1,1540 @@
1
+ ## Object Layer Token: A Semantic Interoperability Protocol for Composable Digital Entities
2
+
3
+ <p align="center">
4
+ <img src="https://www.cyberiaonline.com/assets/splash/apple-touch-icon-precomposed.png" alt="CYBERIA Network Object Layer Engine CLI"/>
5
+ </p>
6
+
7
+ <div align="center">
8
+
9
+ <h3> CYBERIA </h3>
10
+
11
+ Network Object Layers
12
+
13
+ *The Cyberian frontier Entity*
14
+
15
+ Stackable Rendering Layers as a Unified Tokenized Reality
16
+
17
+ [![Downloads](https://img.shields.io/npm/dm/cyberia.svg)](https://www.npmjs.com/package/cyberia) [![Version](https://img.shields.io/npm/v/cyberia.svg)](https://www.npmjs.org/package/cyberia)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ **Version:** 3.0.3
24
+
25
+ **Status:** Draft
26
+
27
+ **Authors:** Underpost Engineering
28
+
29
+ ---
30
+
31
+ ## Abstract
32
+
33
+ This paper introduces the **Object Layer Protocol** — a semantic interoperability standard that defines digital entities as literally stackable rendering layers, each associated with a presentation, UX, economic, and mechanical reality. The protocol enables composable, verifiable, and interoperable digital objects across decentralized runtimes by binding four distinct semantic layers into a single atomic unit. A reference implementation is provided through **Cyberia Online**, a browser-based MMORPG deployed on Hyperledger Besu, where the protocol is realized as an ERC-1155 multi-token contract managed through Kubernetes infrastructure via the Underpost CI/CD CLI.
34
+
35
+ The protocol leverages the **Ethereum secp256k1** key pair as the universal identity primitive. A single Ethereum key pair authenticates players, proves ownership on-chain, and authorizes off-chain actions via **EIP-712 typed structured data signatures**. The on-chain economy is split across two dedicated service domains: **cryptokoyn.net** (fungible CKY currency hub) and **itemledger.com** (semi-fungible and non-fungible Object Layer registry), both backed by the same `ObjectLayerToken` ERC-1155 contract on Hyperledger Besu.
36
+
37
+ The Object Layer Protocol is not a token standard — it is a **semantic interoperability layer** that happens to use ERC-1155 as its on-chain ledger binding. The innovation lies in the composable, layer-first architecture where every entity in a runtime is a stack of independently addressable, independently renderable, and independently ownable layers — each carrying its own mechanical, presentational, experiential, and economic meaning.
38
+
39
+ ---
40
+
41
+ ## Table of Contents
42
+
43
+ 1. **Executive Summary**
44
+ 2. **Introduction**
45
+ - 2.1 [Problem statement: the Ethereum ecosystem and the absence of semantic interoperability](#header-2.1)
46
+ - 2.2 [Solution: the Object Layer Protocol and Ethereum-native identity](#header-2.2)
47
+ 3. **Ethereum Identity and Authentication**
48
+ - 3.1 [secp256k1 key pairs as universal identity](#header-3.1)
49
+ - 3.2 [EIP-712 signed claims and gasless authentication](#header-3.2)
50
+ - 3.3 [Authentication flow: key → claim → verify → mint → own](#header-3.3)
51
+ 4. **The Object Layer Protocol**
52
+ - 4.1 [Semantic interoperability through stackable layers](#header-4.1)
53
+ - 4.2 [Four realities of an Object Layer](#header-4.2)
54
+ - 4.3 [AtomicPrefab and layer-first rendering](#header-4.3)
55
+ - 4.4 [Canonical Object Layer schema](#header-4.4)
56
+ - 4.5 [Composability: entities as layer stacks](#header-4.5)
57
+ 5. **Service Architecture**
58
+ - 5.1 [Three-domain topology](#header-5.1)
59
+ - 5.2 [cryptokoyn.net — Financial portal and CKY token hub](#header-5.2)
60
+ - 5.3 [itemledger.com — Object Layer registry and metadata indexer](#header-5.3)
61
+ - 5.4 [cyberiaonline.com — Game runtime and player portal](#header-5.4)
62
+ 6. **Technology Stack**
63
+ - 6.1 [Hyperledger Besu](#header-6.1)
64
+ - 6.2 [Hardhat](#header-6.2)
65
+ - 6.3 [OpenZeppelin ERC-1155 contracts](#header-6.3)
66
+ - 6.4 [MongoDB schemas](#header-6.4)
67
+ - 6.5 [IPFS storage](#header-6.5)
68
+ 7. **Tokenomics**
69
+ - 7.1 [ObjectLayerToken: unified multi-token contract](#header-7.1)
70
+ - 7.2 [Token classification: fungible, semi-fungible, and non-fungible](#header-7.2)
71
+ - 7.3 [Token distribution and allocation](#header-7.3)
72
+ - 7.4 [Governance and circulation](#header-7.4)
73
+ 8. **Blockchain Network and Deployment**
74
+ - 8.1 [Hyperledger Besu IBFT2/QBFT consensus](#header-8.1)
75
+ - 8.2 [Kubernetes deployment architecture (kubeadm)](#header-8.2)
76
+ - 8.3 [Hardhat deployment workflow](#header-8.3)
77
+ 9. **On-Chain Lifecycle and Game Mechanics**
78
+ - 9.1 [On-chain lifecycle: register → mint → transfer → burn](#header-9.1)
79
+ - 9.2 [Decentralized player progression](#header-9.2)
80
+ - 9.3 [Item crafting, trading, and incubation](#header-9.3)
81
+ 10. **Security and Transparency**
82
+ - 10.1 [Blockchain security measures](#header-10.1)
83
+ - 10.2 [Smart contract audits](#header-10.2)
84
+ 11. **Future Directions**
85
+ 12. **References**
86
+
87
+ ---
88
+
89
+ ### 1. Executive Summary
90
+
91
+ Current approaches to digital asset tokenization treat tokens as isolated ledger entries — a balance, a URI, a metadata pointer. They lack a coherent semantic model that binds what an object *does*, what it *looks like*, how a *human understands it*, and what it *is worth* into a single interoperable unit. The Ethereum ecosystem provides the cryptographic and economic primitives to solve this, but existing standards (ERC-721, ERC-1155) leave semantic structure as an afterthought.
92
+
93
+ The **Object Layer Protocol** solves this by defining a **semantic interoperability standard** where each digital entity is composed of literally stackable rendering layers, and each layer carries four bound realities:
94
+
95
+ | Reality | Semantic Role | Schema Path |
96
+ |---------|---------------|-------------|
97
+ | **Mechanical** | What the layer *does* — statistical attributes governing behavior | `data.stats` |
98
+ | **Presentational** | What the layer *looks like* — IPFS-addressed atlas sprite sheets | `data.render` |
99
+ | **Experiential (UX)** | What the layer *means to a human* — identifiers, descriptions, activation | `data.item` |
100
+ | **Economic** | What the layer *is worth* — on-chain ledger binding and ownership proof | `data.ledger` |
101
+
102
+ These four realities are not metadata annotations on a token. They are the **constitutive semantic dimensions** of the entity itself. A layer without mechanics is decorative. A layer without presentation is invisible. A layer without UX is incomprehensible. A layer without economics is unownable. The protocol requires all four.
103
+
104
+ **Key architectural decisions:**
105
+
106
+ - **Ethereum secp256k1 keys** serve as the single identity primitive — the same key pair authenticates with the game server, signs EIP-712 claims, and owns on-chain tokens.
107
+ - **Fungible currency (CKY)** is managed via **cryptokoyn.net** — a dedicated financial portal for staking, governance, analytics, and fiat bridges.
108
+ - **Semi-fungible and non-fungible Object Layers** are managed via **itemledger.com** — the canonical registry, metadata resolver, and IPFS indexer for all item tokens.
109
+ - **A single `ObjectLayerToken` (ERC-1155) contract** on Hyperledger Besu backs both domains, managing the entire token economy in one deployment.
110
+
111
+ The result is a composable, interoperable digital object format where:
112
+
113
+ - **Entities are stacks.** A player character is skin + armor + weapon + effect layers, each independently addressable and ownable.
114
+ - **Layers are atoms.** Each layer is a self-contained AtomicPrefab with its own four-reality representation, content hash, and IPFS persistence.
115
+ - **Ownership is semantic.** Holding an ERC-1155 token proves ownership not just of a balance — but of a complete four-dimensional semantic object.
116
+ - **Interoperability is structural.** Any runtime that understands the Object Layer schema can render, simulate, display, and trade any layer from any source.
117
+
118
+ The reference implementation deploys the `ObjectLayerToken` contract on a Hyperledger Besu private network. Infrastructure is orchestrated through Kubernetes clusters initialized via `kubeadm` and managed through the **Underpost CI/CD CLI**.
119
+
120
+ ---
121
+
122
+ ### 2. Introduction
123
+
124
+ <a name="header-2.1"></a>
125
+
126
+ #### 2.1 Problem Statement: The Ethereum Ecosystem and the Absence of Semantic Interoperability
127
+
128
+ The Ethereum ecosystem established the foundational primitives for digital ownership — accounts derived from secp256k1 key pairs, smart contracts executing deterministic state transitions, and token standards (ERC-20, ERC-721, ERC-1155) encoding fungible and non-fungible balances. These primitives solved the *ownership* problem: a private key holder can provably own, transfer, and burn on-chain tokens without trusting a central authority.
129
+
130
+ However, the ecosystem has failed to solve the *meaning* problem. Existing token standards conflate **ownership** with **identity**. Owning an ERC-721 or ERC-1155 token proves you hold a balance — but it says nothing structural about what the asset *is*, what it *does*, how it *renders*, or how a human *understands* it. Metadata URIs are an afterthought, not a constitutive part of the asset's semantic identity.
131
+
132
+ This creates several cascading failures across the Ethereum ecosystem:
133
+
134
+ **At the token standard level:**
135
+
136
+ - **No structural interoperability.** Two applications cannot share assets because there is no common semantic schema — only opaque metadata blobs stored behind a `uri()` function call.
137
+ - **Presentation is disconnected from ownership.** The visual representation of an asset lives on a centralized server or IPFS with no formal binding to the token's mechanical or economic identity. The `tokenURI` is a hint, not a guarantee.
138
+ - **UX is an afterthought.** Human-readable names, descriptions, and interaction flags are buried in unstructured JSON with no protocol-level validation or composition rules.
139
+ - **Composition is impossible.** There is no standard way to express "this entity is composed of these five independently-owned layers stacked in this order."
140
+
141
+ **At the infrastructure level:**
142
+
143
+ - **Key management fragmentation.** Users manage separate identities for wallets, game accounts, and platform logins. The Ethereum key pair — already a strong cryptographic identity — is underutilized as a universal authentication primitive.
144
+ - **Gas cost barriers.** Public Ethereum mainnet gas fees make per-item minting economically infeasible for game economies with thousands of in-game items. This pushes projects toward centralized databases, negating the ownership guarantees of the blockchain.
145
+ - **Metadata availability.** When IPFS pins expire or centralized metadata servers go offline, tokens become opaque pointers to nothing — the semantic content is lost even though the ownership record persists.
146
+
147
+ **At the application level (digital worlds, MMORPGs):**
148
+
149
+ - **Lack of true ownership.** Players invest significant time and real-world value but hold no cryptographic proof of their digital assets. Server shutdowns erase player progress permanently.
150
+ - **Opacity and manipulation.** Centralized game operators unilaterally control in-game economies — adjusting drop rates, devaluing items, or introducing pay-to-win mechanics without accountability or transparency.
151
+ - **Security risks.** Centralized servers concentrate attack surface. A single breach can compromise the entire player economy.
152
+
153
+ <a name="header-2.2"></a>
154
+
155
+ #### 2.2 Solution: The Object Layer Protocol and Ethereum-Native Identity
156
+
157
+ The Object Layer Protocol addresses every layer of the problem stack by leveraging Ethereum's existing cryptographic primitives — secp256k1 keys, EIP-712 typed data signatures, and ERC-1155 multi-token contracts — and extending them with a **semantic interoperability standard** that gives tokens structural meaning.
158
+
159
+ **Identity solved: one key pair, universal authentication.**
160
+
161
+ A player generates a single Ethereum secp256k1 key pair. That key pair:
162
+
163
+ 1. **Authenticates** with the game server via EIP-712 signed claims (no passwords, no OAuth).
164
+ 2. **Owns** on-chain tokens in the `ObjectLayerToken` ERC-1155 contract.
165
+ 3. **Authorizes** off-chain actions (crafting, trading, staking) via signed messages verified server-side.
166
+ 4. **Interoperates** across all three service domains (cryptokoyn.net, itemledger.com, cyberiaonline.com) with a single identity.
167
+
168
+ **Ownership solved: semantic tokens, not opaque balances.**
169
+
170
+ Every on-chain token maps to a complete **AtomicPrefab** — a four-reality semantic unit (mechanics, presentation, UX, economics) content-addressed on IPFS. Owning a token means owning a fully-defined digital entity, not just a ledger entry.
171
+
172
+ **Gas solved: permissioned Besu network with zero gas fees.**
173
+
174
+ The `ObjectLayerToken` is deployed on a Hyperledger Besu private network with IBFT2/QBFT consensus and gas price zero. The game server acts as a trusted relayer — verifying player EIP-712 signatures and submitting transactions on their behalf. Players never pay gas; the permissioned validator set provides the economic security model.
175
+
176
+ **Composition solved: entities as layer stacks.**
177
+
178
+ The protocol defines entities as ordered stacks of independently-owned Object Layers. A player character is not one token — it is a stack of skin + armor + weapon + effect layers, each with its own token ID, its own stats, its own sprite sheet, and its own owner. Any layer can be transferred, traded, or burned independently.
179
+
180
+ **Service architecture solved: domain-separated concerns.**
181
+
182
+ The token economy is served through dedicated domains:
183
+
184
+ - **cryptokoyn.net** — Financial portal for CKY fungible currency: balances, staking, governance, analytics, and fiat on-ramps.
185
+ - **itemledger.com** — Canonical registry for Object Layer items: metadata resolution, IPFS pinning, on-chain event indexing, item search, and marketplace.
186
+ - **cyberiaonline.com** — Game runtime: real-time multiplayer, inventory management, crafting, and the live rendering engine.
187
+
188
+ All three domains share the same Besu blockchain, the same MongoDB off-chain store, and the same Ethereum key-based identity system.
189
+
190
+ ---
191
+
192
+ ### 3. Ethereum Identity and Authentication
193
+
194
+ <a name="header-3.1"></a>
195
+
196
+ #### 3.1 secp256k1 Key Pairs as Universal Identity
197
+
198
+ The Ethereum ecosystem standardizes on the **secp256k1 elliptic curve** (defined in SEC 2, also used by Bitcoin) for all cryptographic identity operations. A key pair consists of:
199
+
200
+ - **Private key:** A 256-bit random scalar `k` (32 bytes).
201
+ - **Public key:** The corresponding point `K = k × G` on the secp256k1 curve (64 bytes uncompressed, 33 bytes compressed).
202
+ - **Ethereum address:** The rightmost 20 bytes of `keccak256(publicKey)`, prefixed with `0x`.
203
+
204
+ In the Object Layer Protocol, this single key pair serves as the **universal identity primitive** across all system layers:
205
+
206
+ | Layer | Function | How the Key Is Used |
207
+ |-------|----------|---------------------|
208
+ | **On-chain** | Token ownership | The Ethereum address holds ERC-1155 balances |
209
+ | **Authentication** | Server login | EIP-712 signed claim replaces username/password |
210
+ | **Authorization** | Action signing | Off-chain crafting, trading, staking requests carry a signature |
211
+ | **Cross-domain** | Unified identity | Same key authenticates across cryptokoyn.net, itemledger.com, cyberiaonline.com |
212
+
213
+ This eliminates the key management fragmentation described in the problem statement. Players generate one key, store it in a standard Ethereum wallet (MetaMask, hardware wallet, or the game's built-in key manager), and use it everywhere.
214
+
215
+ <a name="header-3.2"></a>
216
+
217
+ #### 3.2 EIP-712 Signed Claims and Gasless Authentication
218
+
219
+ **EIP-712** (Ethereum typed structured data hashing and signing) defines a standard for signing structured data that is both human-readable (wallets display the typed fields before signing) and machine-verifiable (the structured hash prevents cross-domain replay attacks).
220
+
221
+ The Object Layer Protocol uses EIP-712 for **gasless authentication and authorization**. The player's wallet signs a typed claim; the game server verifies the signature; a trusted relayer submits the on-chain transaction.
222
+
223
+ **EIP-712 Domain Separator:**
224
+
225
+ ```json
226
+ {
227
+ "name": "CyberiaObjectLayer",
228
+ "version": "1",
229
+ "chainId": 777771,
230
+ "verifyingContract": "0x<ObjectLayerToken address>"
231
+ }
232
+ ```
233
+
234
+ **Example: Authentication Claim**
235
+
236
+ ```json
237
+ {
238
+ "types": {
239
+ "EIP712Domain": [
240
+ { "name": "name", "type": "string" },
241
+ { "name": "version", "type": "string" },
242
+ { "name": "chainId", "type": "uint256" },
243
+ { "name": "verifyingContract", "type": "address" }
244
+ ],
245
+ "AuthClaim": [
246
+ { "name": "player", "type": "address" },
247
+ { "name": "nonce", "type": "uint256" },
248
+ { "name": "timestamp", "type": "uint256" },
249
+ { "name": "action", "type": "string" }
250
+ ]
251
+ },
252
+ "primaryType": "AuthClaim",
253
+ "message": {
254
+ "player": "0xABCD...1234",
255
+ "nonce": 42,
256
+ "timestamp": 1719500000,
257
+ "action": "login"
258
+ }
259
+ }
260
+ ```
261
+
262
+ The wallet signs this structured data, producing a 65-byte `(v, r, s)` ECDSA signature. The server recovers the signer address via `ecrecover` and matches it against the player's registered Ethereum address.
263
+
264
+ **Why EIP-712 instead of plain `personal_sign`:**
265
+
266
+ - **Human-readable.** The wallet displays "AuthClaim → player: 0x…, action: login" instead of an opaque hex blob.
267
+ - **Replay-proof.** The domain separator binds the signature to a specific contract, chain, and protocol version.
268
+ - **Typed.** The structured hash prevents ambiguity in how the signed data is encoded.
269
+
270
+ <a name="header-3.3"></a>
271
+
272
+ #### 3.3 Authentication Flow: Key → Claim → Verify → Mint → Own
273
+
274
+ The complete authentication and token minting flow using Ethereum secp256k1 keys and EIP-712 signed claims:
275
+
276
+ ```mermaid
277
+ sequenceDiagram
278
+ participant W as Wallet (secp256k1)
279
+ participant S as Game Server (relayer)
280
+ participant C as ObjectLayerToken (ERC-1155)
281
+
282
+ Note over W: 1. Player holds ETH key pair<br/>Private key k · 32 bytes<br/>Address 0xABCD…1234
283
+
284
+ Note over W: 2. Sign EIP-712 typed claim<br/>{ player, nonce, timestamp, action }
285
+
286
+ W->>S: 3. Send signed claim + signature (v, r, s)
287
+
288
+ Note over S: 4. ecrecover(structHash, v, r, s)<br/>Assert recovered addr == claimed addr<br/>Assert nonce fresh · timestamp in window
289
+
290
+ Note over S: 5. Authenticate session<br/>Identity = Ethereum address (no passwords)
291
+
292
+ Note over S: 6. Qualifying game event<br/>(quest complete, craft, drop)
293
+
294
+ S->>C: 7. registerObjectLayer(playerAddr, itemId,<br/>metadataCid, supply, data)<br/>— or mint(playerAddr, tokenId, amount, data)
295
+
296
+ Note over C: 8. balanceOf(playerAddr, tokenId) updated<br/>Emit ObjectLayerRegistered / TransferSingle
297
+
298
+ C-->>W: 9. Ownership verifiable by any Ethereum-compatible tool
299
+ ```
300
+
301
+ **Summary of the flow:**
302
+
303
+ ```mermaid
304
+ flowchart LR
305
+ A["ETH key<br/>(secp256k1)"] --> B["Signed claim<br/>(EIP-712)"]
306
+ B --> C["Server verifies<br/>identity"]
307
+ C --> D["Relayer submits<br/>transaction"]
308
+ D --> E["Contract mints<br/>token"]
309
+ E --> F["Blockchain records<br/>ownership"]
310
+ ```
311
+
312
+ This architecture means:
313
+
314
+ - **Players never pay gas.** The Besu network runs with gas price zero; the server relays transactions.
315
+ - **Players never expose private keys to the server.** Authentication is purely signature-based.
316
+ - **Players own their assets cryptographically.** The private key is the sole proof of ownership, not a database row.
317
+ - **Sessions are stateless.** Each request carries a fresh EIP-712 signature; no session cookies or JWTs required (though the server may cache sessions for performance).
318
+
319
+ ---
320
+
321
+ ### 4. The Object Layer Protocol
322
+
323
+ <a name="header-4.1"></a>
324
+
325
+ #### 4.1 Semantic Interoperability Through Stackable Layers
326
+
327
+ The core innovation of the Object Layer Protocol is the recognition that a digital entity is not a single atomic thing — it is a **stack of semantically complete layers**.
328
+
329
+ Consider a player character in an MMORPG. It is not one object. It is:
330
+
331
+ ```mermaid
332
+ block-beta
333
+ columns 1
334
+ A["🧑 Skin Layer (base character) — z-order: 1"]
335
+ B["🛡️ Armor Layer (cyber-vest) — z-order: 2"]
336
+ C["⚔️ Weapon Layer (hatchet) — z-order: 3"]
337
+ D["🔮 Effect Layer (glow, particles) — z-order: 4"]
338
+
339
+ style A fill:#4169e1,color:#fff
340
+ style B fill:#2e8b57,color:#fff
341
+ style C fill:#b22222,color:#fff
342
+ style D fill:#6a0dad,color:#fff
343
+ ```
344
+
345
+ Each layer in this stack is an **independently complete semantic unit**. The weapon layer has its own stats (damage, range), its own sprite sheet (render), its own human-readable identity (item), and its own on-chain token (ledger). It can be:
346
+
347
+ - **Rendered independently** — draw just the weapon on a trading screen.
348
+ - **Owned independently** — transfer the weapon to another player without affecting the skin.
349
+ - **Simulated independently** — apply the weapon's stats in a combat calculation.
350
+ - **Understood independently** — display the weapon's name, type, and description in a tooltip.
351
+
352
+ This is what we mean by **semantic interoperability**: any system that understands the Object Layer schema can fully render, simulate, display, and trade any layer from any source. The interoperability is not at the token level (any ERC-1155 reader can see balances) — it is at the **semantic level** (any Object Layer reader can understand the complete four-dimensional meaning of the asset).
353
+
354
+ **Stackability is literal.** The client renderer composes layers by drawing lower layers first (skin) then higher layers (weapon), respecting transparency and z-order. This makes layering developer-friendly (simple stack semantics) and operable (many layers per entity). An entity with 10 layers simply has 10 independently addressable, independently ownable, independently renderable semantic units stacked in z-order.
355
+
356
+ <a name="header-4.2"></a>
357
+
358
+ #### 4.2 Four Realities of an Object Layer
359
+
360
+ Every Object Layer binds four semantic realities into a single atomic unit:
361
+
362
+ | Reality | Schema Path | Role | Example |
363
+ |---------|-------------|------|---------|
364
+ | **Mechanical** | `data.stats` | Governs behavior in the runtime simulation | `{ effect: 7, resistance: 8, agility: 0, range: 4, intelligence: 8, utility: 2 }` |
365
+ | **Presentational** | `data.render` | Governs visual appearance via IPFS-addressed atlas sprite sheets | `{ cid: "bafkrei...atlas.png", metadataCid: "bafkreia...meta" }` |
366
+ | **Experiential (UX)** | `data.item` | Governs human comprehension — names, types, descriptions, activation | `{ id: "hatchet", type: "weapon", description: "A rusted hatchet", activable: true }` |
367
+ | **Economic** | `data.ledger` | Governs ownership and value via on-chain token binding | `{ type: "ERC1155", address: "0x...", tokenId: "uint256" }` |
368
+
369
+ These four realities are **constitutive**, not decorative. They define what the layer *is*:
370
+
371
+ - **Without mechanics**, a layer is decorative — it has no effect on the simulation.
372
+ - **Without presentation**, a layer is invisible — it cannot be rendered.
373
+ - **Without UX**, a layer is incomprehensible — no human can identify or interact with it.
374
+ - **Without economics**, a layer is unownable — it exists only as ephemeral server state.
375
+
376
+ The protocol requires all four realities to be present for an Object Layer to be considered complete and interoperable.
377
+
378
+ <a name="header-4.3"></a>
379
+
380
+ #### 4.3 AtomicPrefab and Layer-First Rendering
381
+
382
+ An **AtomicPrefab** is the protocol's atomic unit — a self-contained Object Layer with all four realities, content-addressed on IPFS:
383
+
384
+ ```
385
+ AtomicPrefab = {
386
+ data: {
387
+ stats: { effect, resistance, agility, range, intelligence, utility },
388
+ item: { id, type, description, activable },
389
+ ledger: { type, address, tokenId },
390
+ render: { cid, metadataCid }
391
+ },
392
+ cid: "bafk...json", // IPFS CID of the stable JSON
393
+ sha256: "a1b2c3..." // Content hash for integrity verification
394
+ }
395
+ ```
396
+
397
+ **Layer = Render.** A layer exists because it has a renderable presentation. The `data.render.cid` points to the atlas sprite sheet PNG; `data.render.metadataCid` points to the atlas metadata JSON (frame coordinates, dimensions, animation sequences).
398
+
399
+ **The client runtime operates as follows:**
400
+
401
+ 1. **Receive** Object Layer references from the server or on-chain events (`tokenId` → `metadataCid`).
402
+ 2. **Fetch** atlas metadata from IPFS (resolved via itemledger.com's caching layer or directly).
403
+ 3. **Compose** layers in z-order for each entity — lower layers drawn first, respecting transparency.
404
+ 4. **Simulate** using `data.stats` for game mechanics.
405
+ 5. **Display** using `data.item` for UX tooltips, inventory screens, and interaction prompts.
406
+
407
+ <a name="header-4.4"></a>
408
+
409
+ #### 4.4 Canonical Object Layer Schema
410
+
411
+ **Stable JSON representation (AtomicPrefab):**
412
+
413
+ ```json
414
+ {
415
+ "data": {
416
+ "stats": {
417
+ "effect": 7,
418
+ "resistance": 8,
419
+ "agility": 0,
420
+ "range": 4,
421
+ "intelligence": 8,
422
+ "utility": 2
423
+ },
424
+ "item": {
425
+ "id": "hatchet",
426
+ "type": "weapon",
427
+ "description": "A rusted hatchet found in the cyberpunk wastes",
428
+ "activable": true
429
+ },
430
+ "ledger": {
431
+ "type": "ERC1155",
432
+ "address": "0x...",
433
+ "tokenId": "uint256"
434
+ },
435
+ "render": {
436
+ "cid": "bafkrei...atlas.png",
437
+ "metadataCid": "bafkreia...meta"
438
+ }
439
+ },
440
+ "cid": "bafk...json",
441
+ "sha256": "a1b2c3..."
442
+ }
443
+ ```
444
+
445
+ **Off-chain ↔ On-chain Mapping:**
446
+
447
+ | Off-chain (Object Layer) | On-chain (ERC-1155) |
448
+ |--------------------------|---------------------|
449
+ | `data.item.id` (e.g., "hatchet") | Token ID = `uint256(keccak256("cyberia.object-layer:hatchet"))` |
450
+ | `data.render.metadataCid` | `_tokenCIDs[tokenId]` → URI resolves to `ipfs://{metadataCid}` |
451
+ | `data.stats` | Off-chain only (MongoDB); referenced by token metadata |
452
+ | `data.ledger.type` | `"ERC1155"` |
453
+ | `data.ledger.address` | ObjectLayerToken contract address |
454
+ | `data.ledger.tokenId` | The deterministic uint256 token ID |
455
+
456
+ **Token classification by `data.ledger`:**
457
+
458
+ | `ledger.type` | Managed By | Domain | Example |
459
+ |---------------|------------|--------|---------|
460
+ | `"ERC1155"` (tokenId = 0) | cryptokoyn.net | Fungible CKY currency | In-game gold |
461
+ | `"ERC1155"` (supply > 1) | itemledger.com | Semi-fungible resource | Wood, stone, gold ore |
462
+ | `"ERC1155"` (supply = 1) | itemledger.com | Non-fungible unique item | Legendary weapon |
463
+ | `"OFF_CHAIN"` | cyberiaonline.com | Pre-incubation item | Newly dropped loot |
464
+
465
+ <a name="header-4.5"></a>
466
+
467
+ #### 4.5 Composability: Entities as Layer Stacks
468
+
469
+ The protocol's composability model is defined by a simple principle: **an entity is an ordered stack of Object Layers**.
470
+
471
+ ```
472
+ Entity(player_42) = [
473
+ ObjectLayer("cyber-punk-skin-001"), // z: 0 — base skin
474
+ ObjectLayer("cyber-vest-armor"), // z: 1 — armor
475
+ ObjectLayer("hatchet"), // z: 2 — weapon
476
+ ObjectLayer("neon-glow-effect"), // z: 3 — visual effect
477
+ ]
478
+ ```
479
+
480
+ Each layer in the stack is independently:
481
+
482
+ - **Ownable:** Each has its own ERC-1155 token ID. Transferring the weapon does not affect the skin.
483
+ - **Renderable:** The renderer draws layers in z-order. Removing a layer removes its visual contribution.
484
+ - **Simulatable:** The runtime composes stats from all layers for the entity's aggregate mechanical identity.
485
+ - **Tradeable:** Players can trade individual layers or use `safeBatchTransferFrom` for atomic multi-layer trades.
486
+
487
+ This composability is what makes the Object Layer Protocol a **semantic interoperability standard** rather than just a token scheme. Any system that understands the schema can:
488
+
489
+ 1. Parse any Object Layer JSON.
490
+ 2. Render its sprite sheet.
491
+ 3. Apply its stats.
492
+ 4. Display its UX identity.
493
+ 5. Verify its on-chain ownership.
494
+ 6. Compose it into entity stacks with other layers from other sources.
495
+
496
+ ---
497
+
498
+ ### 5. Service Architecture
499
+
500
+ <a name="header-5.1"></a>
501
+
502
+ #### 5.1 Three-Domain Topology
503
+
504
+ The Object Layer Protocol's service layer is organized across three dedicated domains, each serving a distinct concern while sharing the same underlying Besu blockchain, MongoDB instance, and Ethereum-based identity system:
505
+
506
+ ```mermaid
507
+ graph TD
508
+ subgraph INFRA["SHARED INFRASTRUCTURE"]
509
+ BESU["Besu Network<br/>(IBFT2/QBFT)"]
510
+ MONGO["MongoDB<br/>(off-chain)"]
511
+ IPFS_NODE["IPFS<br/>(assets)"]
512
+ VALKEY["Valkey<br/>(cache)"]
513
+ end
514
+
515
+ subgraph IDENTITY["ETHEREUM IDENTITY (secp256k1)<br/>One key pair → all three domains"]
516
+ ID[ ]
517
+ end
518
+
519
+ BESU --- ID
520
+ MONGO --- ID
521
+ IPFS_NODE --- ID
522
+ VALKEY --- ID
523
+
524
+ ID --> CK
525
+ ID --> IL
526
+ ID --> CO
527
+
528
+ subgraph CK["cryptokoyn.net"]
529
+ CK1["CKY currency"]
530
+ CK2["Staking"]
531
+ CK3["Governance"]
532
+ CK4["Analytics"]
533
+ CK5["Fiat bridge"]
534
+ end
535
+
536
+ subgraph IL["itemledger.com"]
537
+ IL1["Item registry"]
538
+ IL2["Metadata"]
539
+ IL3["IPFS index"]
540
+ IL4["Marketplace"]
541
+ end
542
+
543
+ subgraph CO["cyberiaonline.com"]
544
+ CO1["Game runtime"]
545
+ CO2["Multiplayer"]
546
+ CO3["Inventory"]
547
+ CO4["Crafting"]
548
+ CO5["Combat"]
549
+ end
550
+
551
+ style INFRA fill:#1a1a2e,color:#eee,stroke:#555
552
+ style IDENTITY fill:#2a2a4e,color:#eee,stroke:#888
553
+ style ID fill:none,stroke:none
554
+ style CK fill:#767202,color:#fff
555
+ style IL fill:#0d3b66,color:#fff
556
+ style CO fill:#6b1d1d,color:#fff
557
+ ```
558
+
559
+ All three services are configured in the Underpost deployment manifest (`conf.dd-cyberia.js`) and share the same API service modules: `core`, `file`, `user`, `crypto`, `document`, `instance`, `object-layer`, `object-layer-render-frames`, `atlas-sprite-sheet`, and `ipfs`.
560
+
561
+ <a name="header-5.2"></a>
562
+
563
+ #### 5.2 cryptokoyn.net — Financial Portal and CKY Token Hub
564
+
565
+ **cryptokoyn.net** is the dedicated financial portal for the **CryptoKoyn (CKY)** fungible currency — token ID 0 in the `ObjectLayerToken` ERC-1155 contract. It provides all currency-related services: balance queries, staking, governance voting, issuance analytics, and (optionally) fiat on-ramps/off-ramps.
566
+
567
+ **Scope:** Exclusively manages the **unique fungible Object Layer** — CKY. All operations on token ID 0 route through this domain.
568
+
569
+ **Client application:** The `cryptokoyn` client module includes components for wallet management, CKY-specific UI, and financial dashboards:
570
+
571
+ - `MenuCryptokoyn` — Navigation and layout
572
+ - `RoutesCryptokoyn` — Client-side routing (`/`, `/wallet`, `/settings`, `/account`)
573
+ - `ElementsCryptokoyn` — CKY-specific UI elements (balance displays, staking forms)
574
+ - `SocketIoCryptokoyn` — Real-time CKY balance and event updates
575
+ - `SettingsCryptokoyn` — User preferences and key management
576
+
577
+ **API Services:**
578
+
579
+ | Endpoint | Method | Description |
580
+ |----------|--------|-------------|
581
+ | `/api/balance/{address}` | GET | Returns CKY balance and staking summary for a player address |
582
+ | `/api/stake` | POST | Stakes CKY tokens (interacts with staking contract or governance escrow) |
583
+ | `/api/unstake` | POST | Initiates CKY unstaking with cooldown period |
584
+ | `/api/transfer` | POST | Transfers CKY between player addresses (relayed to Besu) |
585
+ | `/api/explorer/transactions` | GET | Paginated CKY transaction history |
586
+ | `/api/analytics/supply` | GET | Circulating supply, burn rate, staking ratio analytics |
587
+ | `/api/analytics/governance` | GET | Active proposals, voting weight distribution |
588
+
589
+ **Staking and governance** are core to the CKY tokenomics. Vote weight is proportional to staked amount and duration:
590
+
591
+ ```
592
+ Vote Weight = 0.5 × (Amount Staked / Total Staked) + 0.5 × (Staking Duration / Max Duration)
593
+ ```
594
+
595
+ **Server configuration** (`conf.dd-cyberia.js`):
596
+
597
+ ```javascript
598
+ 'cryptokoyn.net': {
599
+ '/': {
600
+ client: 'cryptokoyn',
601
+ runtime: 'nodejs',
602
+ apis: ['core', 'file', 'user', 'crypto', 'document',
603
+ 'instance', 'object-layer', 'object-layer-render-frames',
604
+ 'atlas-sprite-sheet', 'ipfs'],
605
+ ws: 'core',
606
+ peer: true,
607
+ proxy: [80, 443],
608
+ db: { provider: 'mongoose', host: 'mongodb://127.0.0.1:27017', name: 'default' },
609
+ valkey: { port: 6379, host: '127.0.0.1' },
610
+ }
611
+ }
612
+ ```
613
+
614
+ <a name="header-5.3"></a>
615
+
616
+ #### 5.3 itemledger.com — Object Layer Registry and Metadata Indexer
617
+
618
+ **itemledger.com** is the canonical registry, metadata resolver, and IPFS indexer for all **semi-fungible and non-fungible Object Layer items** — token IDs ≥ 1 in the `ObjectLayerToken` contract. It serves as the authoritative source for mapping `itemId` → `tokenId`, resolving AtomicPrefab metadata from IPFS, and providing a search and marketplace interface for all game items.
619
+
620
+ **Scope:** Manages all non-currency Object Layers — semi-fungible resources (wood, stone, potions) and non-fungible unique items (legendary weapons, skins).
621
+
622
+ **Client application:** The `itemledger` client module includes components for item browsing, metadata inspection, and marketplace interactions:
623
+
624
+ - `MenuItemledger` — Navigation with item category filters
625
+ - `RoutesItemledger` — Client-side routing (`/`, `/wallet`, `/settings`, `/account`)
626
+ - `ElementsItemledger` — Item card renders, provenance views, atlas sprite preview
627
+ - `SocketIoItemledger` — Real-time `ObjectLayerRegistered` event feed
628
+ - `TranslateItemledger` — Internationalization for item descriptions and UI
629
+
630
+ **API Services:**
631
+
632
+ | Endpoint | Method | Description |
633
+ |----------|--------|-------------|
634
+ | `/api/token/{tokenId}` | GET | Returns the full AtomicPrefab JSON (Object Layer data) for a token ID |
635
+ | `/api/item/{itemId}` | GET | Resolves `itemId` → `tokenId` and returns the AtomicPrefab |
636
+ | `/api/metadata/{tokenId}` | GET | Returns IPFS-resolved metadata (atlas sprite sheet coordinates, dimensions) |
637
+ | `/api/search` | GET | Full-text search across item names, types, descriptions |
638
+ | `/api/registry/events` | GET | Paginated `ObjectLayerRegistered` event log |
639
+ | `/api/ipfs/pin` | POST | Pins an Object Layer's atlas PNG and metadata JSON to IPFS |
640
+ | `/api/ipfs/resolve/{cid}` | GET | IPFS CID resolver with local cache (avoids gateway latency) |
641
+ | `/api/marketplace/listings` | GET | Active item listings for peer-to-peer trading |
642
+ | `/api/marketplace/buy` | POST | Executes a `safeTransferFrom` via server relayer |
643
+ | `/api/marketplace/provenance/{tokenId}` | GET | Full ownership history (transfer events) for an item |
644
+
645
+ **Webhook subscriptions** for on-chain events allow external services to react to item registration and transfers:
646
+
647
+ - `ObjectLayerRegistered(tokenId, itemId, metadataCid, initialSupply)` — New item type on-chain.
648
+ - `TransferSingle(operator, from, to, id, value)` — Item ownership change.
649
+ - `MetadataUpdated(tokenId, metadataCid)` — Item metadata updated.
650
+
651
+ **Server configuration** (`conf.dd-cyberia.js`):
652
+
653
+ ```javascript
654
+ 'itemledger.com': {
655
+ '/': {
656
+ client: 'itemledger',
657
+ runtime: 'nodejs',
658
+ apis: ['core', 'file', 'user', 'crypto', 'document',
659
+ 'instance', 'object-layer', 'object-layer-render-frames',
660
+ 'atlas-sprite-sheet', 'ipfs'],
661
+ ws: 'core',
662
+ peer: true,
663
+ proxy: [80, 443],
664
+ iconsBuild: false,
665
+ db: { provider: 'mongoose', host: 'mongodb://127.0.0.1:27017', name: 'default' },
666
+ valkey: { port: 6379, host: '127.0.0.1' },
667
+ }
668
+ }
669
+ ```
670
+
671
+ <a name="header-5.4"></a>
672
+
673
+ #### 5.4 cyberiaonline.com — Game Runtime and Player Portal
674
+
675
+ **cyberiaonline.com** is the live game client and server — the runtime where Object Layers are rendered, stacked, simulated, and interacted with in real time. It consumes data from both cryptokoyn.net (CKY balances) and itemledger.com (item metadata) while managing the real-time multiplayer game state.
676
+
677
+ **Scope:** Game runtime, player sessions, real-time multiplayer, inventory management, crafting, combat, and the Object Layer rendering engine.
678
+
679
+ **Key runtime operations:**
680
+
681
+ 1. **Authentication:** Player signs EIP-712 claim → server verifies → session established.
682
+ 2. **Inventory loading:** Server queries `balanceOf` for the player's address across all registered token IDs, then resolves each token's AtomicPrefab via itemledger.com's API.
683
+ 3. **Layer rendering:** The `ObjectLayerEngine` (`src/server/object-layer.js`) processes atlas sprite sheets, frame matrices, and direction codes into renderable layer stacks.
684
+ 4. **Crafting:** Player combines resources → server burns consumed tokens + mints crafted item → itemledger.com indexes the new Object Layer.
685
+ 5. **Trading:** Player-to-player `safeBatchTransferFrom` via the server relayer.
686
+
687
+ **Server configuration** (`conf.dd-cyberia.js`):
688
+
689
+ ```javascript
690
+ 'www.cyberiaonline.com': {
691
+ '/': {
692
+ client: 'cyberia-portal',
693
+ runtime: 'nodejs',
694
+ apis: ['core', 'file', 'user', 'crypto', 'document',
695
+ 'instance', 'object-layer', 'object-layer-render-frames',
696
+ 'atlas-sprite-sheet', 'ipfs'],
697
+ ws: 'core',
698
+ peer: true,
699
+ proxy: [80, 443],
700
+ db: { provider: 'mongoose', host: 'mongodb://127.0.0.1:27017', name: 'default' },
701
+ valkey: { port: 6379, host: '127.0.0.1' },
702
+ }
703
+ }
704
+ ```
705
+
706
+ ---
707
+
708
+ ### 6. Technology Stack
709
+
710
+ <a name="header-6.1"></a>
711
+
712
+ #### 6.1 Hyperledger Besu
713
+
714
+ - **Overview:** Hyperledger Besu is an enterprise-grade Ethereum client that provides a robust and secure platform for executing smart contracts. It supports IBFT2 and QBFT consensus algorithms, ensuring deterministic finality with low latency — ideal for a game economy requiring fast, reliable transactions with zero gas fees.
715
+ - **Key Benefits:**
716
+ - **Privacy and Security:** Offers advanced privacy features and security protocols for permissioned networks.
717
+ - **Performance and Scalability:** Optimized for high-throughput and low-latency transactions with configurable block periods (2–5 seconds).
718
+ - **Enterprise-Grade:** Designed for production environments with robust governance, monitoring (Prometheus/Grafana), and Kubernetes-native deployment support.
719
+ - **EVM Compatibility:** Full Ethereum Virtual Machine compatibility enables standard Solidity smart contracts, OpenZeppelin libraries, and the full EIP-712 signature verification stack.
720
+ - **secp256k1 Native:** All Besu accounts use the same secp256k1 curve as mainnet Ethereum, ensuring key compatibility and standard wallet support.
721
+
722
+ <a href='https://besu.hyperledger.org/' target='_top'>See official Hyperledger Besu documentation.</a>
723
+
724
+ <a name="header-6.2"></a>
725
+
726
+ #### 6.2 Hardhat
727
+
728
+ - **Overview:** Hardhat is a development environment for Ethereum that streamlines the development, testing, and deployment of smart contracts. The project uses Hardhat to compile, test, and deploy the ObjectLayerToken contract to Besu RPC endpoints.
729
+ - **Key Benefits:**
730
+ - **Rapid Development:** Rich plugin ecosystem and built-in Solidity debugging.
731
+ - **Robust Testing:** Comprehensive testing framework with snapshot-based fixtures.
732
+ - **Simplified Deployment:** Deployment scripts produce JSON artifacts consumed by the Cyberia CLI (`bin/cyberia.js`) for end-to-end lifecycle management.
733
+ - **Network Configuration:** `hardhat.config.js` defines multiple Besu targets (IBFT2, QBFT, Kubernetes) with coinbase key management from a secure private key file.
734
+
735
+ <a href='https://hardhat.org/docs' target='_top'>See official Hardhat documentation.</a>
736
+
737
+ <a name="header-6.3"></a>
738
+
739
+ #### 6.3 OpenZeppelin ERC-1155 Contracts
740
+
741
+ - **Overview:** OpenZeppelin Contracts is a library of reusable, audited smart contract code. The ObjectLayerToken contract inherits from:
742
+ - `ERC1155` — Core multi-token standard.
743
+ - `ERC1155Burnable` — Allows token holders to destroy their tokens.
744
+ - `ERC1155Pausable` — Allows the owner to freeze all transfers (emergency governance).
745
+ - `ERC1155Supply` — On-chain total supply tracking per token ID.
746
+ - `Ownable` — Access control for administrative functions (mint, pause, register).
747
+ - **Key Benefits:**
748
+ - **Security:** Rigorously audited and battle-tested code.
749
+ - **Efficiency:** Optimized for gas efficiency with batch operations.
750
+ - **Flexibility:** Modular design allows combining multiple extensions in a single contract.
751
+
752
+ <a href='https://docs.openzeppelin.com/contracts/5.x/erc1155' target='_top'>See official OpenZeppelin ERC-1155 documentation.</a>
753
+
754
+ <a name="header-6.4"></a>
755
+
756
+ #### 6.4 MongoDB Schemas
757
+
758
+ - **Overview:** MongoDB stores the canonical four-reality representation (`data.stats`, `data.item`, `data.ledger`, `data.render`) off-chain, with `data.ledger` referencing the on-chain ERC-1155 token. The `ObjectLayerEngine` (`src/server/object-layer.js`) manages document creation and updates.
759
+ - **Ledger Schema:**
760
+ ```json
761
+ {
762
+ "type": "ERC1155",
763
+ "address": "0x...",
764
+ "tokenId": "uint256 string"
765
+ }
766
+ ```
767
+ Items that have not yet completed incubation carry `"type": "OFF_CHAIN"` and are upgraded to `"ERC1155"` upon on-chain registration.
768
+ - **Key Benefits:**
769
+ - **Scalability:** Horizontal scaling for increasing data volumes.
770
+ - **Flexibility:** Schema-less design accommodates dynamic Object Layer structures.
771
+ - **High Performance:** Optimized for fast read/write operations required by real-time game state.
772
+
773
+ <a href='https://www.mongodb.com/docs/' target='_top'>See official MongoDB documentation.</a>
774
+
775
+ <a name="header-6.5"></a>
776
+
777
+ #### 6.5 IPFS Storage
778
+
779
+ - **Overview:** IPFS (InterPlanetary File System) provides content-addressed distributed storage. Object Layer assets are stored on IPFS with three CID references per item:
780
+ - `cid` (top-level) — The **canonical CID**: IPFS hash of `fast-json-stable-stringify(objectLayer.data)`. This is the CID stored on-chain as the token's `metadataCid`, enabling any party to independently reproduce the same content address from the semantic payload (stats, item, ledger, render).
781
+ - `data.render.cid` — The consolidated atlas sprite sheet PNG.
782
+ - `data.render.metadataCid` — The atlas sprite sheet metadata JSON (frame coordinates, dimensions).
783
+ - The `ObjectLayerToken` contract maps each token ID to the **canonical CID** (`objectLayer.cid`) on-chain via `_tokenCIDs[tokenId]`, enabling trustless metadata resolution. The URI resolves to `ipfs://{canonicalCid}`, which returns the full stable-JSON Object Layer data document.
784
+ - **Key Benefits:**
785
+ - **Decentralization:** Reduces reliance on centralized servers.
786
+ - **Content Addressing:** Data integrity guaranteed by hash-based CIDs.
787
+ - **Global Distribution:** Assets distributed across IPFS nodes; itemledger.com provides a caching resolver layer.
788
+
789
+ <a href='https://docs.ipfs.tech/' target='_top'>See official IPFS documentation.</a>
790
+
791
+ ---
792
+
793
+ ### 7. Tokenomics
794
+
795
+ <a name="header-7.1"></a>
796
+
797
+ #### 7.1 ObjectLayerToken: Unified Multi-Token Contract
798
+
799
+ The `ObjectLayerToken` is a single ERC-1155 contract that serves as the **economic reality binding** for the Object Layer Protocol. It manages the entire Cyberia Online token economy — not as the protocol itself, but as the on-chain ledger layer (`data.ledger`) that anchors ownership of semantically complete Object Layers.
800
+
801
+ This design adds to the standard OpenZeppelin ERC-1155 implementation:
802
+
803
+ - **On-chain item registry:** Maps token IDs to human-readable item identifiers and IPFS metadata CIDs.
804
+ - **Deterministic token IDs:** `computeTokenId(itemId) = uint256(keccak256("cyberia.object-layer:" || itemId))`.
805
+ - **Batch registration:** `batchRegisterObjectLayers` registers and mints multiple item types in one transaction.
806
+ - **Per-token metadata management:** `setBaseURI` and `setTokenMetadataCID` allow the owner to update IPFS metadata CIDs post-deployment.
807
+ - **Pause/unpause:** Emergency governance to freeze all transfers.
808
+ - **Supply tracking:** On-chain total supply per token ID via `ERC1155Supply`.
809
+
810
+ **Proposed Smart Contract**
811
+
812
+ ```solidity
813
+ // SPDX-License-Identifier: MIT
814
+ // Compatible with OpenZeppelin Contracts ^5.0.0
815
+ pragma solidity ^0.8.20;
816
+
817
+ import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
818
+ import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol';
819
+ import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';
820
+ import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol';
821
+ import '@openzeppelin/contracts/access/Ownable.sol';
822
+
823
+ /**
824
+ * @title ObjectLayerToken
825
+ * @dev Unified ERC-1155 multi-token contract for the Cyberia Online Object Layer ecosystem.
826
+ *
827
+ * Token ID 0 (CRYPTOKOYN): Fungible in-game currency — managed via cryptokoyn.net.
828
+ * Token IDs >= 1: Object Layer items — managed via itemledger.com.
829
+ * - Supply = 1: Non-fungible unique items (legendary weapons, unique skins).
830
+ * - Supply > 1: Semi-fungible stackable resources (wood, stone, potions).
831
+ *
832
+ * Authentication: Players authenticate via secp256k1 EIP-712 signed claims.
833
+ * The game server acts as a trusted relayer, submitting transactions on behalf
834
+ * of verified players (gasless for end users on the permissioned Besu network).
835
+ *
836
+ * Features: mint, batch-mint, burn, batch-burn, pause/unpause, supply tracking,
837
+ * on-chain item registry with IPFS metadata CID resolution.
838
+ */
839
+ contract ObjectLayerToken is ERC1155, ERC1155Burnable, ERC1155Pausable, ERC1155Supply, Ownable {
840
+ uint256 public constant CRYPTOKOYN = 0;
841
+ uint256 public constant INITIAL_CRYPTOKOYN_SUPPLY = 10_000_000 * 1e18;
842
+
843
+ string private _baseTokenURI;
844
+ mapping(uint256 => string) private _tokenCIDs;
845
+ mapping(uint256 => string) private _itemIds;
846
+ mapping(bytes32 => uint256) private _itemIdToTokenId;
847
+
848
+ event ObjectLayerRegistered(
849
+ uint256 indexed tokenId, string itemId, string metadataCid, uint256 initialSupply
850
+ );
851
+ event MetadataUpdated(uint256 indexed tokenId, string metadataCid);
852
+
853
+ constructor(address initialOwner, string memory baseURI)
854
+ ERC1155(baseURI)
855
+ Ownable(initialOwner)
856
+ {
857
+ _baseTokenURI = baseURI;
858
+ _itemIds[CRYPTOKOYN] = 'cryptokoyn';
859
+ _itemIdToTokenId[keccak256(abi.encodePacked('cryptokoyn'))] = CRYPTOKOYN;
860
+ _mint(initialOwner, CRYPTOKOYN, INITIAL_CRYPTOKOYN_SUPPLY, '');
861
+ emit ObjectLayerRegistered(CRYPTOKOYN, 'cryptokoyn', '', INITIAL_CRYPTOKOYN_SUPPLY);
862
+ }
863
+
864
+ function uri(uint256 tokenId) public view override returns (string memory) {
865
+ string memory tokenCid = _tokenCIDs[tokenId];
866
+ if (bytes(tokenCid).length > 0) {
867
+ return string(abi.encodePacked(_baseTokenURI, tokenCid));
868
+ }
869
+ return super.uri(tokenId);
870
+ }
871
+
872
+ function setBaseURI(string calldata newBaseURI) external onlyOwner {
873
+ _baseTokenURI = newBaseURI;
874
+ _setURI(newBaseURI);
875
+ }
876
+
877
+ function setTokenMetadataCID(uint256 tokenId, string calldata metadataCid) external onlyOwner {
878
+ _tokenCIDs[tokenId] = metadataCid;
879
+ emit MetadataUpdated(tokenId, metadataCid);
880
+ emit URI(uri(tokenId), tokenId);
881
+ }
882
+
883
+ function computeTokenId(string calldata itemId) public pure returns (uint256) {
884
+ return uint256(keccak256(abi.encodePacked('cyberia.object-layer:', itemId)));
885
+ }
886
+
887
+ function registerObjectLayer(
888
+ address to,
889
+ string calldata itemId,
890
+ string calldata metadataCid,
891
+ uint256 initialSupply,
892
+ bytes calldata data
893
+ ) external onlyOwner returns (uint256 tokenId) {
894
+ bytes32 itemHash = keccak256(abi.encodePacked(itemId));
895
+ require(
896
+ (_itemIdToTokenId[itemHash] == 0 && bytes(_itemIds[0]).length > 0) || _itemIdToTokenId[itemHash] == 0,
897
+ 'ObjectLayerToken: item already registered'
898
+ );
899
+ tokenId = computeTokenId(itemId);
900
+ require(bytes(_itemIds[tokenId]).length == 0, 'ObjectLayerToken: token ID collision');
901
+ _itemIds[tokenId] = itemId;
902
+ _itemIdToTokenId[itemHash] = tokenId;
903
+ if (bytes(metadataCid).length > 0) _tokenCIDs[tokenId] = metadataCid;
904
+ if (initialSupply > 0) _mint(to, tokenId, initialSupply, data);
905
+ emit ObjectLayerRegistered(tokenId, itemId, metadataCid, initialSupply);
906
+ }
907
+
908
+ function batchRegisterObjectLayers(
909
+ address to,
910
+ string[] calldata itemIds,
911
+ string[] calldata metadataCids,
912
+ uint256[] calldata supplies,
913
+ bytes calldata data
914
+ ) external onlyOwner returns (uint256[] memory tokenIds) {
915
+ require(
916
+ itemIds.length == metadataCids.length && itemIds.length == supplies.length,
917
+ 'ObjectLayerToken: array length mismatch'
918
+ );
919
+ tokenIds = new uint256[](itemIds.length);
920
+ uint256[] memory mintIds = new uint256[](itemIds.length);
921
+ uint256[] memory mintAmounts = new uint256[](itemIds.length);
922
+ for (uint256 i = 0; i < itemIds.length; i++) {
923
+ uint256 tokenId = computeTokenId(itemIds[i]);
924
+ require(bytes(_itemIds[tokenId]).length == 0, 'ObjectLayerToken: item already registered or token ID collision');
925
+ bytes32 itemHash = keccak256(abi.encodePacked(itemIds[i]));
926
+ _itemIds[tokenId] = itemIds[i];
927
+ _itemIdToTokenId[itemHash] = tokenId;
928
+ if (bytes(metadataCids[i]).length > 0) _tokenCIDs[tokenId] = metadataCids[i];
929
+ tokenIds[i] = tokenId;
930
+ mintIds[i] = tokenId;
931
+ mintAmounts[i] = supplies[i];
932
+ emit ObjectLayerRegistered(tokenId, itemIds[i], metadataCids[i], supplies[i]);
933
+ }
934
+ _mintBatch(to, mintIds, mintAmounts, data);
935
+ }
936
+
937
+ function mint(address to, uint256 tokenId, uint256 amount, bytes calldata data)
938
+ external onlyOwner
939
+ {
940
+ _mint(to, tokenId, amount, data);
941
+ }
942
+
943
+ function mintBatch(address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data)
944
+ external onlyOwner
945
+ {
946
+ _mintBatch(to, ids, amounts, data);
947
+ }
948
+
949
+ function pause() external onlyOwner { _pause(); }
950
+ function unpause() external onlyOwner { _unpause(); }
951
+
952
+ function getItemId(uint256 tokenId) external view returns (string memory) { return _itemIds[tokenId]; }
953
+ function getTokenIdByItemId(string calldata itemId) external view returns (uint256) {
954
+ return _itemIdToTokenId[keccak256(abi.encodePacked(itemId))];
955
+ }
956
+ function getMetadataCID(uint256 tokenId) external view returns (string memory) { return _tokenCIDs[tokenId]; }
957
+
958
+ function _update(address from, address to, uint256[] memory ids, uint256[] memory values)
959
+ internal override(ERC1155, ERC1155Pausable, ERC1155Supply)
960
+ {
961
+ super._update(from, to, ids, values);
962
+ }
963
+ }
964
+ ```
965
+
966
+ **Understanding the ObjectLayerToken Smart Contract**
967
+
968
+ This Solidity smart contract implements the ERC-1155 multi-token standard as the **economic reality layer** of the Object Layer Protocol:
969
+
970
+ **Inherited Contracts:**
971
+ - **ERC1155:** Core multi-token standard for fungible and non-fungible tokens.
972
+ - **ERC1155Burnable:** Allows token holders to burn (destroy) their tokens.
973
+ - **ERC1155Pausable:** Allows the owner to pause all token transfers for emergency governance.
974
+ - **ERC1155Supply:** Tracks on-chain total supply per token ID.
975
+ - **Ownable:** Access control ensuring only the contract owner (server relayer) can mint, register, and pause.
976
+
977
+ **Constructor:**
978
+ - Mints 10 million CryptoKoyn (token ID 0) to the deployer with 18-decimal precision.
979
+ - Registers "cryptokoyn" as the item identifier for token ID 0.
980
+ - Sets the base IPFS URI prefix for metadata resolution.
981
+
982
+ **Key Functions:**
983
+ - `registerObjectLayer(to, itemId, metadataCid, initialSupply, data)` — Registers a new Object Layer item on-chain, assigns a deterministic token ID via `computeTokenId`, guards against duplicate item IDs and token ID collisions, stores the IPFS metadata CID, and mints the initial supply.
984
+ - `batchRegisterObjectLayers(to, itemIds, metadataCids, supplies, data)` — Registers and mints multiple Object Layer items in a single transaction, reducing gas overhead for bulk operations.
985
+ - `computeTokenId(itemId)` — Pure function returning the deterministic `uint256` token ID for any item identifier.
986
+ - `setBaseURI(newBaseURI)` — Updates the IPFS base URI prefix for all token metadata resolution.
987
+ - `setTokenMetadataCID(tokenId, metadataCid)` — Updates the per-token IPFS metadata CID; emits `MetadataUpdated` and `URI` events.
988
+ - `mint(to, tokenId, amount, data)` — Mints additional supply for an existing token.
989
+ - `mintBatch(to, ids, amounts, data)` — Batch-mints multiple token types in one transaction.
990
+ - `burn(account, tokenId, amount)` — Holders destroy their own tokens (inherited from ERC1155Burnable).
991
+ - `pause()` / `unpause()` — Emergency freeze/unfreeze of all transfers.
992
+ - `uri(tokenId)` — Resolves metadata URI: `ipfs://{per-token-CID}` or falls back to the base URI.
993
+
994
+ **Key Advantages:**
995
+ - **Single deployment** manages the entire game economy (CKY currency via cryptokoyn.net + all item types via itemledger.com).
996
+ - **Batch operations** reduce gas costs for multi-asset registration, transfers, and minting via `batchRegisterObjectLayers` and `mintBatch`.
997
+ - **Deterministic token IDs** from `keccak256` enable off-chain → on-chain mapping without a registry lookup.
998
+ - **IPFS metadata integration** via per-token CIDs links each on-chain token to its Object Layer atlas sprite sheet (resolved by itemledger.com). Metadata CIDs can be updated post-deployment via `setTokenMetadataCID`.
999
+
1000
+ <a name="header-7.2"></a>
1001
+
1002
+ #### 7.2 Token Classification: Fungible, Semi-Fungible, and Non-Fungible
1003
+
1004
+ | Token Type | Token ID | Supply | Managed By | Example |
1005
+ |------------|----------|--------|------------|---------|
1006
+ | Fungible currency | 0 (CRYPTOKOYN) | 10,000,000 × 10^18 | cryptokoyn.net | In-game gold / CKY |
1007
+ | Semi-fungible resource | `computeTokenId("gold-ore")` | 1,000,000 | itemledger.com | Stackable crafting material |
1008
+ | Semi-fungible consumable | `computeTokenId("health-potion")` | 100,000 | itemledger.com | Stackable consumable |
1009
+ | Non-fungible unique gear | `computeTokenId("legendary-hatchet")` | 1 | itemledger.com | Unique weapon |
1010
+ | Non-fungible skin | `computeTokenId("cyber-punk-skin-001")` | 1 | itemledger.com | Unique character skin |
1011
+
1012
+ The ERC-1155 standard treats all token IDs uniformly. The distinction between fungible, semi-fungible, and non-fungible is purely semantic based on the minted supply:
1013
+ - **Fungible:** Large supply, divisible via balance transfers. Managed by **cryptokoyn.net**.
1014
+ - **Semi-fungible:** Moderate supply, stackable but each unit is interchangeable (e.g., wood, stone). Managed by **itemledger.com**.
1015
+ - **Non-fungible:** Supply of exactly 1, making it unique and non-interchangeable (e.g., legendary weapons). Managed by **itemledger.com**.
1016
+
1017
+ <a name="header-7.3"></a>
1018
+
1019
+ #### 7.3 Token Distribution and Allocation
1020
+
1021
+ **CryptoKoyn (CKY) — Token ID 0 — cryptokoyn.net**
1022
+
1023
+ - **Total Supply:** 10,000,000 CKY (with 18-decimal precision)
1024
+ - **Initial Allocation:**
1025
+ - **90% Airdrop and Mint Pool:** Allocated to an airdrop pool and a minting pool to distribute tokens to players through gameplay activities, events, and rewards.
1026
+ - **10% Direct Investor Wallets:** Distributed to investor wallets proportionally to their financial participation.
1027
+
1028
+ **Object Layer Items — Token IDs ≥ 1 — itemledger.com**
1029
+
1030
+ - **Total Supply:** Variable per item type, based on game design requirements.
1031
+ - **Distribution:**
1032
+ - **In-Game Activities:** Players earn items by completing quests, achievements, or participating in events. Items are minted on-chain via `registerObjectLayer` or `mint`.
1033
+ - **Crafting:** Players craft items in-game; the server calls `mint` to issue the corresponding ERC-1155 token.
1034
+ - **Marketplace Trading:** ERC-1155 tokens can be freely traded via `safeTransferFrom` and `safeBatchTransferFrom`, enabling peer-to-peer item trading through itemledger.com's marketplace.
1035
+
1036
+ **Token Mechanics:**
1037
+
1038
+ - **Token Burning:** Players or the governance address can burn tokens via `burn` or `burnBatch`. Burning CryptoKoyn reduces circulating supply. Burning item tokens destroys the corresponding in-game item.
1039
+ - **Staking (via cryptokoyn.net):**
1040
+ - **Asset Freezing:** Staked tokens are frozen (held in a staking contract or governance address), removing them from circulation.
1041
+ - **Voting Rights:** Vote weight is proportional to staked amount and staking duration:
1042
+
1043
+ ```
1044
+ Vote Weight = 0.5 × (Amount Staked / Total Staked Amount) + 0.5 × (Staking Duration / Max Staking Duration)
1045
+ ```
1046
+
1047
+ **Item Incubation Time**
1048
+
1049
+ - **Variable Incubation:** The incubation time for items earned in-game varies based on item characteristics. Rarer or more powerful items have longer incubation periods before they can be minted as on-chain tokens.
1050
+ - **Active Time:** The incubation period reflects active in-game usage, ensuring players have genuinely engaged with the item.
1051
+
1052
+ **Minting and On-Chain Conversion**
1053
+
1054
+ - **Earned In-Game Items:** Must undergo an incubation period before the server registers them on-chain via `registerObjectLayer`. During incubation, items carry `ledger.type: "OFF_CHAIN"` in MongoDB.
1055
+ - **Crafted Items:** Farm, dropped, craft, and default items must undergo an incubation period and a CryptoKoyn minting fee before on-chain registration. Upon registration, itemledger.com indexes the new Object Layer.
1056
+
1057
+ <a name="header-7.4"></a>
1058
+
1059
+ #### 7.4 Governance and Circulation
1060
+
1061
+ ```mermaid
1062
+ flowchart LR
1063
+
1064
+ subgraph Circulation["Circulation"]
1065
+ Transformation["Transformation:<br> batch transfers<br> between players"]
1066
+ subgraph Players["Cyberia Online<br>players"]
1067
+ end
1068
+ end
1069
+
1070
+ subgraph Governance-Runtime["Governance<br> Runtime Node <br> Server"]
1071
+ subgraph Sync["<br> <br> <br> <br> <br> <br> <br> <br> <br>Sync drain <br> burning protocol"]
1072
+ Stacking["Voting power<br>(cryptokoyn.net)"]
1073
+ Unlock-Features["Unlock Features"]
1074
+ subgraph Withdrawal["**Withdrawal Protocol** <br> Token to Fiat"]
1075
+ end
1076
+ end
1077
+
1078
+ subgraph Faucet["<br><br><br><br><br><br><br>Faucet <br>validation <br> emitter protocol"]
1079
+ ERC-1155["**Token emitter** <br> ERC-1155 ObjectLayerToken <br> (CKY via cryptokoyn.net<br>+ Items via itemledger.com)"]
1080
+ Airdrop-Mint["Airdrop Mint <br> pool"]
1081
+ end
1082
+ subgraph Coinbase["Coinbase <br> address"]
1083
+ end
1084
+ end
1085
+
1086
+ Black-Market-Sales["External Markets <br>Sales"]
1087
+ Burn["Burn"]
1088
+
1089
+ subgraph Legends["<span style='color: yellow'>&rarr; Virtual Currency/Items </span> <br> <span style='color: green'>&rarr; Fiat</span>"]
1090
+ end
1091
+
1092
+ Investors ==> Coinbase
1093
+ ERC-1155 ==> Airdrop-Mint
1094
+ Players ==> |Stacking|Stacking
1095
+ Players ==> |Buy <br> Consumption|Unlock-Features
1096
+ Players <==> Black-Market-Sales
1097
+ Players <==> Transformation
1098
+ Sync ==> Burn
1099
+ Coinbase==>|ICO|ERC-1155
1100
+ Withdrawal==>|Sell<br>withdrawal<br>|Players
1101
+ Players==>Withdrawal
1102
+ Coinbase=======>|Liquidity Pool|Withdrawal
1103
+ Sync==>|Supply renewal|Airdrop-Mint
1104
+ Players==>Unlock-Features
1105
+ ERC-1155==>Airdrop-Mint
1106
+ Airdrop-Mint<==>Players
1107
+ Airdrop-Mint==>|ICO|Investors
1108
+ Investors==>Players
1109
+
1110
+ linkStyle 0 font-size: 25px, color: black, back: white,stroke: green;
1111
+ linkStyle 1 font-size: 25px, color: black, back: white,stroke: yellow;
1112
+ linkStyle 2 font-size: 25px, color: black, back: white,stroke: yellow;
1113
+ linkStyle 3 font-size: 25px, color: black, back: white,stroke: yellow;
1114
+ linkStyle 4 font-size: 25px, color: black, back: white,stroke: green;
1115
+ linkStyle 5 font-size: 25px, color: black, back: white,stroke: yellow;
1116
+ linkStyle 6 font-size: 25px, color: black, back: white,stroke: yellow;
1117
+ linkStyle 7 font-size: 25px, color: black, back: white,stroke: yellow;
1118
+ linkStyle 8 font-size: 25px, color: black, back: white,stroke: green;
1119
+ linkStyle 9 font-size: 25px, color: black, back: white,stroke: yellow;
1120
+ linkStyle 10 font-size: 25px, color: black, back: white,stroke: green;
1121
+ linkStyle 11 font-size: 25px, color: black, back: white,stroke: yellow;
1122
+ linkStyle 12 font-size: 25px, color: black, back: white,stroke: yellow;
1123
+ linkStyle 13 font-size: 25px, color: black, back: white,stroke: yellow;
1124
+ linkStyle 14 font-size: 25px, color: black, back: white,stroke: yellow;
1125
+
1126
+ classDef H1 font-size: 40px, pxline-height:10px;
1127
+ classDef H2 font-size: 30px;
1128
+ classDef H3 font-size: 25px;
1129
+
1130
+ classDef SR fill: gray, color: black;
1131
+ classDef SR0 fill:#222222;
1132
+ classDef SR1 height: 500px;
1133
+
1134
+ class Players H1;
1135
+ class Players SR;
1136
+
1137
+ class Withdrawal H3;
1138
+ class Legends H3;
1139
+ class Governance-Runtime H2;
1140
+ class Circulation H2;
1141
+ class Circulation SR0;
1142
+ class Coinbase H1;
1143
+ class Faucet H2;
1144
+ class Faucet SR1;
1145
+ class ERC-1155 H3;
1146
+ class Sync H2;
1147
+ class Sync SR1;
1148
+ class Stacking H3;
1149
+ class Burn H3;
1150
+ class Unlock-Features H3;
1151
+ class Black-Market-Sales H3;
1152
+ class Transformation H3;
1153
+ class Investors H2;
1154
+ class Airdrop-Mint H1;
1155
+ ```
1156
+
1157
+ ---
1158
+
1159
+ ### 8. Blockchain Network and Deployment
1160
+
1161
+ <a name="header-8.1"></a>
1162
+
1163
+ #### 8.1 Hyperledger Besu IBFT2/QBFT Consensus
1164
+
1165
+ The ObjectLayerToken is deployed on a **Hyperledger Besu** private network using **IBFT2** or **QBFT** consensus algorithms:
1166
+
1167
+ - **IBFT2 (Istanbul Byzantine Fault Tolerance 2.0):** Provides immediate finality with configurable block periods (default: 2-5 seconds). Validators propose and vote on blocks; 2/3+1 agreement is required. Suitable for permissioned networks with known validators.
1168
+ - **QBFT (Quorum Byzantine Fault Tolerance):** Evolution of IBFT2 with improved liveness guarantees and better handling of validator set changes. Recommended for production deployments.
1169
+
1170
+ **Network Configuration (genesis):**
1171
+
1172
+ ```json
1173
+ {
1174
+ "config": {
1175
+ "chainId": 777771,
1176
+ "berlinBlock": 0,
1177
+ "londonBlock": 0,
1178
+ "qbft": {
1179
+ "epochLength": 30000,
1180
+ "blockPeriodSeconds": 5,
1181
+ "requestTimeoutSeconds": 10
1182
+ }
1183
+ },
1184
+ "gasLimit": "0x1fffffffffffff",
1185
+ "difficulty": "0x1",
1186
+ "coinbase": "0x44e298766B94B53AdA033FE920748a398CC7cE63"
1187
+ }
1188
+ ```
1189
+
1190
+ **Key Design Decisions:**
1191
+ - **Gas price = 0:** On a private permissioned network, gas fees are not required for economic scarcity — the permissioning layer handles access control. This enables the gasless relayer model where the server submits transactions on behalf of EIP-712-authenticated players.
1192
+ - **Deterministic finality:** IBFT2/QBFT guarantee that once a block is committed, it will never be reverted — critical for game item ownership.
1193
+ - **Fast block times:** 2-5 second block periods provide near-real-time transaction confirmation for game interactions.
1194
+ - **secp256k1 compatibility:** All Besu accounts use the same elliptic curve as mainnet Ethereum, so player key pairs work identically on both networks (enabling future bridging).
1195
+
1196
+ <a name="header-8.2"></a>
1197
+
1198
+ #### 8.2 Kubernetes Deployment Architecture (kubeadm)
1199
+
1200
+ The Besu network runs as a Kubernetes deployment orchestrated via **kubeadm** clusters managed through the **Underpost CI/CD CLI** (`underpost cluster`). The Underpost CLI (`src/cli/index.js`) provides comprehensive cluster lifecycle management including initialization, configuration, component deployment, and teardown.
1201
+
1202
+ | Component | K8s Resource | Count | Description |
1203
+ |-----------|--------------|-------|-------------|
1204
+ | Validators | StatefulSet | 4 | Consensus-participating Besu nodes with persistent keys. |
1205
+ | Members | StatefulSet | 3 | Transaction-submitting nodes (RPC endpoints). |
1206
+ | Prometheus | Deployment | 1 | Metrics collection from all Besu nodes. |
1207
+ | Grafana | Deployment | 1 | Dashboard for network monitoring. |
1208
+
1209
+ **Port Mapping:**
1210
+ - `8545` — JSON-RPC (HTTP) — Hardhat connects here.
1211
+ - `8546` — WebSocket — Real-time event subscriptions (used by cryptokoyn.net and itemledger.com for on-chain event indexing).
1212
+ - `8547` — GraphQL.
1213
+ - `30303` — P2P discovery (TCP + UDP).
1214
+
1215
+ **Cluster Initialization with Underpost CLI:**
1216
+
1217
+ The Underpost CLI wraps `kubeadm` initialization with automated host configuration, Calico CNI installation, and local-path provisioner setup:
1218
+
1219
+ ```bash
1220
+ # Install host prerequisites (Docker, Podman, kubeadm, kubelet, kubectl, Helm)
1221
+ underpost cluster --init-host
1222
+
1223
+ # Apply base host configuration (SELinux, containerd, sysctl, firewall)
1224
+ underpost cluster --config
1225
+
1226
+ # Initialize a kubeadm control plane with Calico CNI
1227
+ underpost cluster --kubeadm --pod-network-cidr 192.168.0.0/16
1228
+
1229
+ # Set kubectl ownership for current user
1230
+ underpost cluster --chown
1231
+
1232
+ # Deploy IPFS cluster for Object Layer asset storage
1233
+ underpost cluster --ipfs --kubeadm
1234
+
1235
+ # Deploy MongoDB for off-chain Object Layer storage
1236
+ underpost cluster --mongodb --kubeadm
1237
+
1238
+ # Deploy Prometheus monitoring
1239
+ underpost cluster --prom node1:9100,node2:9100
1240
+
1241
+ # Deploy Grafana dashboards
1242
+ underpost cluster --grafana --hosts besu-monitor.cyberia.online
1243
+
1244
+ # Switch namespace context
1245
+ underpost cluster --ns-use cyberia
1246
+
1247
+ # Deploy the Besu IBFT2/QBFT network
1248
+ cd quorum-kubernetes/playground/kubectl/quorum-besu/ibft2
1249
+ ./deploy.sh
1250
+
1251
+ # Verify nodes are communicating
1252
+ kubectl exec -it besu-validator-0 -- curl -X POST \
1253
+ --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' \
1254
+ localhost:8545
1255
+ ```
1256
+
1257
+ **Deployment Management:**
1258
+
1259
+ ```bash
1260
+ # Build and deploy application pods
1261
+ underpost deploy default-cyberia production --kubeadm --build-manifest
1262
+
1263
+ # Synchronize deployment environment
1264
+ underpost deploy default-cyberia --sync --kubeadm
1265
+
1266
+ # View deployment status and network traffic
1267
+ underpost deploy --status --kubeadm
1268
+
1269
+ # Port-forward Besu RPC for local Hardhat access
1270
+ underpost deploy besu-validator-0 --port 8545:8545 --kubeadm
1271
+ ```
1272
+
1273
+ **Cluster Reset and Teardown:**
1274
+
1275
+ ```bash
1276
+ # Full cluster reset (kubeadm reset + filesystem cleanup)
1277
+ underpost cluster --reset --kubeadm --remove-volume-host-paths
1278
+
1279
+ # Uninstall all host components
1280
+ underpost cluster --uninstall-host
1281
+ ```
1282
+
1283
+ The `UnderpostCluster` module (`src/cli/cluster.js`) handles the complete lifecycle:
1284
+ - **`--init-host`**: Installs Docker, Podman, Kind, kubeadm, kubelet, kubectl, and Helm on Rocky Linux hosts.
1285
+ - **`--config`**: Configures SELinux (permissive), containerd (SystemdCgroup), swap (disabled), sysctl (bridge-nf-call-iptables), and firewalld (disabled).
1286
+ - **`--kubeadm`**: Runs `kubeadm init`, installs Calico CNI, untaints control plane, installs local-path-provisioner.
1287
+ - **`--reset`**: Executes `kubeadm reset --force`, cleans filesystem artifacts, restores SELinux contexts, purges container storage.
1288
+
1289
+ <a name="header-8.3"></a>
1290
+
1291
+ #### 8.3 Hardhat Deployment Workflow
1292
+
1293
+ The `hardhat.config.js` (ESM) defines multiple Besu network targets, with coinbase private key read from a secure file (`engine-private/eth-networks/besu/coinbase`):
1294
+
1295
+ | Network Name | RPC URL | Description |
1296
+ |--------------|---------|-------------|
1297
+ | `besu-ibft2` | `http://127.0.0.1:8545` | Local IBFT2 (kubeadm port-forward or docker-compose). |
1298
+ | `besu-qbft` | `http://127.0.0.1:8545` | Local QBFT network. |
1299
+ | `besu-k8s` | `http://127.0.0.1:30545` | Kubernetes NodePort exposure. |
1300
+
1301
+ **Deploy the contract:**
1302
+
1303
+ ```bash
1304
+ cd hardhat
1305
+ npx hardhat run scripts/deployObjectLayerToken.js --network besu-ibft2
1306
+ ```
1307
+
1308
+ The deployment script (`scripts/deployObjectLayerToken.js`):
1309
+ 1. Connects to the Besu RPC endpoint using the coinbase private key (secp256k1).
1310
+ 2. Deploys the `ObjectLayerToken` contract.
1311
+ 3. Mints 10M CryptoKoyn to the deployer.
1312
+ 4. Verifies initial state (total supply, deployer balance).
1313
+ 5. Writes a JSON deployment artifact to `hardhat/deployments/` for consumption by the Cyberia CLI and server.
1314
+
1315
+ **CLI Integration (`bin/cyberia.js`):**
1316
+
1317
+ The Cyberia CLI provides Besu chain lifecycle commands covering all three token types (fungible CKY, semi-fungible resources, non-fungible unique items):
1318
+
1319
+ ```bash
1320
+ # ── Key Management ──────────────────────────────────────────────────────
1321
+ # Generate a new Ethereum secp256k1 key pair (console only)
1322
+ cyberia chain key-gen
1323
+ # Generate and save to default paths:
1324
+ # private → ./engine-private/eth-networks/besu/<address>.key.json
1325
+ # public → ./hardhat/deployments/<address>.pub.json
1326
+ cyberia chain key-gen --save
1327
+ # Custom output paths (implies --save)
1328
+ cyberia chain key-gen --private-path ./my-secrets/deployer.key.json --public-path ./keys/deployer.pub.json
1329
+ # Set the coinbase deployer key from a raw hex private key
1330
+ cyberia chain set-coinbase --private-key 0xYOUR_PRIVATE_KEY_HEX
1331
+ # Set the coinbase deployer key from a .key.json file generated by key-gen --save
1332
+ cyberia chain set-coinbase --from-file ./engine-private/eth-networks/besu/<address>.key.json
1333
+ # Custom coinbase file path
1334
+ cyberia chain set-coinbase --private-key 0xYOUR_KEY --coinbase-path ./my-custom/path/coinbase
1335
+
1336
+ # ── Network Deployment ──────────────────────────────────────────────────
1337
+ # Deploy the Besu IBFT2/QBFT network to Kubernetes
1338
+ cyberia chain deploy
1339
+ cyberia chain deploy --consensus qbft
1340
+ # Remove the Besu network
1341
+ cyberia chain remove
1342
+
1343
+ # ── Contract Deployment ─────────────────────────────────────────────────
1344
+ # Compile Solidity contracts
1345
+ cyberia chain compile
1346
+ # Deploy ObjectLayerToken (ERC-1155) — mints 10M CKY to deployer
1347
+ cyberia chain deploy-contract --network besu-ibft2
1348
+ # Run contract tests
1349
+ cyberia chain test
1350
+
1351
+ # ── Token Registration (semi-fungible & non-fungible) ───────────────────
1352
+ # Register a non-fungible unique item using the canonical CID from MongoDB (RECOMMENDED)
1353
+ # The canonical CID is the IPFS hash of fast-json-stable-stringify(objectLayer.data),
1354
+ # guaranteeing any party can independently reproduce the same content address.
1355
+ cyberia chain register --item-id legendary-hatchet --from-db --supply 1
1356
+ # Register a semi-fungible stackable resource with canonical CID from DB
1357
+ cyberia chain register --item-id gold-ore --from-db --supply 1000000
1358
+ # Manual CID override (use only when DB is unavailable)
1359
+ cyberia chain register --item-id legendary-hatchet --metadata-cid bafkrei... --supply 1
1360
+ # Batch-register multiple items with canonical CIDs resolved from MongoDB
1361
+ cyberia chain batch-register --from-db --items '[{"itemId":"wood","supply":500000},{"itemId":"stone","supply":500000}]'
1362
+ # Batch-register with manual CIDs (--from-db overrides any "cid" values in the JSON)
1363
+ cyberia chain batch-register --items '[{"itemId":"wood","cid":"bafk...","supply":500000},{"itemId":"stone","cid":"bafk...","supply":500000}]'
1364
+
1365
+ # ── Minting (additional supply for existing tokens) ─────────────────────
1366
+ # Mint additional CKY (fungible, token ID 0)
1367
+ cyberia chain mint --token-id 0 --to 0xABCD...1234 --amount 1000000000000000000000
1368
+ # Mint additional semi-fungible resources
1369
+ cyberia chain mint --token-id <uint256> --to 0x... --amount 500
1370
+
1371
+ # ── Balance Queries ─────────────────────────────────────────────────────
1372
+ # Query CKY balance for an address
1373
+ cyberia chain balance --address 0xABCD...1234 --token-id 0
1374
+ # Query item balance
1375
+ cyberia chain balance --address 0xABCD...1234 --token-id <uint256>
1376
+
1377
+ # ── Transfers ───────────────────────────────────────────────────────────
1378
+ # Transfer CKY between addresses
1379
+ cyberia chain transfer --from 0x... --to 0x... --token-id 0 --amount 1000
1380
+ # Transfer a non-fungible item
1381
+ cyberia chain transfer --from 0x... --to 0x... --token-id <uint256> --amount 1
1382
+
1383
+ # ── Burning ─────────────────────────────────────────────────────────────
1384
+ # Burn CKY (reduces circulating supply)
1385
+ cyberia chain burn --token-id 0 --amount 500 --address 0x...
1386
+ # Burn a crafting resource (semi-fungible)
1387
+ cyberia chain burn --token-id <uint256> --amount 25 --address 0x...
1388
+
1389
+ # ── Status & Governance ─────────────────────────────────────────────────
1390
+ # Query chain and contract status
1391
+ cyberia chain status
1392
+ # Emergency pause (freeze all transfers)
1393
+ cyberia chain pause
1394
+ # Resume transfers
1395
+ cyberia chain unpause
1396
+ ```
1397
+
1398
+ ---
1399
+
1400
+ ### 9. On-Chain Lifecycle and Game Mechanics
1401
+
1402
+ <a name="header-9.1"></a>
1403
+
1404
+ #### 9.1 On-Chain Lifecycle: Register → Mint → Transfer → Burn
1405
+
1406
+ The full lifecycle of an Object Layer item through the ERC-1155 system, showing the interaction between all three service domains:
1407
+
1408
+ ```mermaid
1409
+ sequenceDiagram
1410
+ participant P as Player
1411
+ participant S as Server Relayer
1412
+ participant C as ObjectLayerToken
1413
+ participant IL as itemledger.com
1414
+ participant CK as cryptokoyn.net
1415
+
1416
+ P->>S: 1. Authenticate via EIP-712 signed claim
1417
+
1418
+ Note over S: 2. buildObjectLayerDataFromDirectory()<br/>→ { stats, item, render }
1419
+ Note over S: 3. computeSha256(data) → sha256
1420
+ Note over S: 4. Pin atlas PNG + metadata JSON to IPFS<br/>→ { cid, metadataCid }
1421
+ Note over S: 5. Store ObjectLayer in MongoDB<br/>(ledger.type: OFF_CHAIN)
1422
+
1423
+ Note over S: ⏳ INCUBATION PERIOD
1424
+
1425
+ S->>C: 6. registerObjectLayer(playerAddr, itemId,<br/>metadataCid, supply, data)
1426
+
1427
+ Note over C: ERC-1155 tokenId assigned
1428
+
1429
+ Note over S: 7. Update MongoDB: ledger =<br/>{ type: ERC1155, address, tokenId }
1430
+
1431
+ C-->>IL: 8. ObjectLayerRegistered event → index
1432
+ C-->>CK: 9. CKY minting fee deduction reflected
1433
+
1434
+ rect rgba(200, 230, 200, 0.15)
1435
+ Note over P,CK: GAMEPLAY
1436
+ S->>C: safeTransferFrom — quest reward
1437
+ P->>C: safeBatchTransferFrom — player trade
1438
+ S->>C: mint(resourceId, 500) — enemy loot
1439
+ P->>C: burn(resourceId, 25) — crafting cost
1440
+ end
1441
+
1442
+ rect rgba(230, 200, 200, 0.15)
1443
+ Note over P,CK: GOVERNANCE (via cryptokoyn.net)
1444
+ CK->>C: pause() — emergency
1445
+ CK->>C: setTokenMetadataCID(tokenId, newCid) — content update
1446
+ CK->>C: unpause() — resume
1447
+ end
1448
+ ```
1449
+
1450
+ **Events emitted for indexing (consumed by itemledger.com and cryptokoyn.net):**
1451
+ - `ObjectLayerRegistered(tokenId, itemId, metadataCid, initialSupply)` — New item type registered.
1452
+ - `TransferSingle(operator, from, to, id, value)` — Single token transfer.
1453
+ - `TransferBatch(operator, from, to, ids, values)` — Batch token transfer.
1454
+ - `MetadataUpdated(tokenId, metadataCid)` — Item metadata updated.
1455
+
1456
+ <a name="header-9.2"></a>
1457
+
1458
+ #### 9.2 Decentralized Player Progression
1459
+
1460
+ A player's complete game state can be reconstructed from their Ethereum address (secp256k1 public key):
1461
+
1462
+ 1. **CryptoKoyn balance (via cryptokoyn.net):** `balanceOf(playerAddress, 0)` → in-game currency.
1463
+ 2. **Item ownership (via itemledger.com):** For each registered Object Layer token ID, `balanceOf(playerAddress, tokenId)` → inventory.
1464
+ 3. **Off-chain metadata:** Each token ID resolves via itemledger.com to an IPFS metadata CID containing atlas sprite sheet coordinates, stats, and item descriptions.
1465
+
1466
+ This means a player's character — including all equipped layers (skin, weapon, armor, effects) and their economic standing — is verifiably anchored on-chain without requiring a centralized database for ownership records. The **semantic completeness** of each Object Layer ensures that the player's inventory is not just a list of token balances, but a collection of fully-defined four-reality entities that any interoperable runtime can render, simulate, and display.
1467
+
1468
+ Because identity is a single secp256k1 key pair, a player can verify their inventory from any Ethereum-compatible tool, wallet, or block explorer — even if the game servers are offline.
1469
+
1470
+ <a name="header-9.3"></a>
1471
+
1472
+ #### 9.3 Item Crafting, Trading, and Incubation
1473
+
1474
+ - **Crafting:** Players combine resources (semi-fungible tokens) in-game. The server burns the consumed resource tokens and mints the crafted item token. The new item is a complete Object Layer with all four realities. itemledger.com indexes the new item automatically.
1475
+ - **Trading:** Players use `safeTransferFrom` for single-layer trades or `safeBatchTransferFrom` for multi-layer trades (e.g., weapon layer + 100 gold ore for a rare shield layer). itemledger.com's marketplace provides the trading UI.
1476
+ - **Incubation:** Items earned in-game undergo a variable incubation period based on rarity before the server mints them on-chain. This prevents instant sell-off and rewards sustained gameplay. During incubation, items exist off-chain with `ledger.type: "OFF_CHAIN"`.
1477
+ - **Minting Fee:** Converting off-chain items to on-chain ERC-1155 tokens requires a CryptoKoyn (token ID 0) fee, creating a CKY sink that supports token value. The fee is paid via cryptokoyn.net's staking/wallet infrastructure.
1478
+
1479
+ ---
1480
+
1481
+ ### 10. Security and Transparency
1482
+
1483
+ <a name="header-10.1"></a>
1484
+
1485
+ #### 10.1 Blockchain Security Measures
1486
+
1487
+ - **Permissioned Network:** Hyperledger Besu with IBFT2/QBFT runs as a permissioned network where only authorized validators can produce blocks.
1488
+ - **secp256k1 Key Security:** Player identity is secured by the same elliptic curve cryptography used on Ethereum mainnet. Key compromise is the sole attack vector — no passwords, no session tokens.
1489
+ - **EIP-712 Replay Protection:** The domain separator binds signatures to a specific contract address, chain ID, and protocol version, preventing cross-chain and cross-contract replay attacks.
1490
+ - **Smart Contract Access Control:** `Ownable` restricts minting, registration, and pause functions to the governance address (server relayer).
1491
+ - **Pausability:** Emergency pause freezes all token transfers, providing a circuit breaker for security incidents.
1492
+ - **Deterministic Finality:** IBFT2/QBFT guarantees blocks are never reverted once committed.
1493
+ - **IPFS Content Addressing:** Asset integrity is guaranteed by content-addressed CIDs — any modification changes the hash.
1494
+ - **Semantic Integrity:** The four-reality binding ensures that no single dimension of an Object Layer can be tampered with independently — the `sha256` hash covers the complete AtomicPrefab.
1495
+
1496
+ <a name="header-10.2"></a>
1497
+
1498
+ #### 10.2 Smart Contract Audits
1499
+
1500
+ - The ObjectLayerToken contract inherits from battle-tested OpenZeppelin implementations that have undergone extensive security audits.
1501
+ - The contract follows the principle of minimal custom logic — most functionality is inherited from audited OpenZeppelin modules.
1502
+ - Automated testing via Hardhat covers the full lifecycle: deployment, registration, minting, transfers, burning, pausing, batch operations, and access control.
1503
+ - EIP-712 signature verification follows the canonical implementation specified in the Ethereum Improvement Proposal.
1504
+
1505
+ ---
1506
+
1507
+ ### 11. Future Directions
1508
+
1509
+ The Object Layer Protocol and its Cyberia Online reference implementation establish a foundation for semantic interoperability in decentralized digital worlds. Future development will extend the protocol along several axes:
1510
+
1511
+ - **EIP-712 permit patterns:** Implement `ERC20Permit`-style gasless approvals for the ERC-1155 contract, enabling players to approve transfers via signed messages without on-chain approval transactions.
1512
+ - **Staking contract:** A companion contract for CryptoKoyn staking with governance voting weight, deployed alongside the main ObjectLayerToken and managed via cryptokoyn.net.
1513
+ - **Marketplace contract:** An on-chain order book for ERC-1155 peer-to-peer trading with escrow, enabling atomic multi-layer trades through itemledger.com.
1514
+ - **Cross-network bridges:** Enable Object Layer tokens to be bridged to public Ethereum L1 or L2 networks, allowing external wallets and marketplaces to consume the semantic layer format. The shared secp256k1 key model makes bridging seamless — the same key owns assets on both networks.
1515
+ - **Layer 2 scaling:** Explore rollup solutions for high-frequency game transactions while anchoring state to the Besu chain.
1516
+ - **Account abstraction (ERC-4337):** Enable smart contract wallets for players who prefer social recovery, multi-sig, or session keys instead of raw secp256k1 private key management.
1517
+ - **DAO governance:** Transition ownership from a single relayer address to a decentralized autonomous organization controlled by CKY stakers via cryptokoyn.net.
1518
+ - **Protocol extensions:** Define additional semantic realities (e.g., audio, physics, narrative) as optional protocol extensions that maintain backward compatibility.
1519
+ - **Cross-game interoperability:** Publish the Object Layer schema as an open standard that other games and virtual worlds can adopt, enabling true cross-platform asset portability based on shared semantic structure rather than shared token balances.
1520
+
1521
+ ---
1522
+
1523
+ ### 12. References
1524
+
1525
+ - <a href='https://eips.ethereum.org/EIPS/eip-1155' target='_top'>EIP-1155: Multi Token Standard</a>
1526
+ - <a href='https://eips.ethereum.org/EIPS/eip-712' target='_top'>EIP-712: Typed Structured Data Hashing and Signing</a>
1527
+ - <a href='https://www.secg.org/sec2-v2.pdf' target='_top'>SEC 2: Recommended Elliptic Curve Domain Parameters (secp256k1)</a>
1528
+ - <a href='https://eips.ethereum.org/EIPS/eip-4337' target='_top'>EIP-4337: Account Abstraction Using Alt Mempool</a>
1529
+ - <a href='https://docs.openzeppelin.com/contracts/5.x/erc1155' target='_top'>OpenZeppelin ERC-1155 Documentation</a>
1530
+ - <a href='https://docs.openzeppelin.com/contracts/5.x/api/utils#EIP712' target='_top'>OpenZeppelin EIP-712 Utilities</a>
1531
+ - <a href='https://besu.hyperledger.org/' target='_top'>Hyperledger Besu Documentation</a>
1532
+ - <a href='https://besu.hyperledger.org/private-networks/how-to/configure/consensus/qbft' target='_top'>Hyperledger Besu QBFT Consensus Documentation</a>
1533
+ - <a href='https://hardhat.org/docs' target='_top'>Hardhat Documentation</a>
1534
+ - <a href='https://docs.ipfs.tech/' target='_top'>IPFS Documentation</a>
1535
+ - <a href='https://kubernetes.io/docs/' target='_top'>Kubernetes Documentation</a>
1536
+ - <a href='https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/' target='_top'>kubeadm Documentation</a>
1537
+ - <a href='https://www.mongodb.com/docs/' target='_top'>MongoDB Documentation</a>
1538
+ - <a href='https://ethereum.org/en/developers/docs/accounts/' target='_top'>Ethereum Accounts Documentation</a>
1539
+ - <a href='https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/' target='_top'>Ethereum.org ERC-1155 Overview</a>
1540
+ - <a href='https://github.com/underpostnet/engine' target='_top'>Underpost Engine — CI/CD CLI and Infrastructure</a>