> For the complete documentation index, see [llms.txt](https://project-49.gitbook.io/fortunehunters/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://project-49.gitbook.io/fortunehunters/technology_stack.md).

# 6 Veiled Foundations

FortuneHunters represents the world's most advanced fusion of artificial intelligence and Oriental divination technology. Our revolutionary stack combines GPT-4's language understanding with authentic 四柱八字 algorithms, machine learning models trained on centuries of 天干地支 wisdom, and blockchain verification for every AI-generated divination. This is where 3000 years of Eastern mysticism meets the cutting edge of artificial intelligence.

## 6.1 Concentric Realms

graph TD A(User Layer) --> B(AI Layer) B --> C(Attestation Layer) C --> D(Token Layer) D --> E(Storage Layer) E --> F(Data Analytics) F --> B

```
*Each layer feeds telemetry to the next, closing the loop for constant improvement.*

### 6.1.1 The Threshold
| Stack Item | Version | Why We Chose It |
|-----------|---------|-----------------|
| **Next.js** | 14 (App Router) | File-based routing + React Server Components reduce JS payload. |
| **Telegram Web Apps SDK** | 6.9 | Zero-install friction; deep link & wallet connect built-in. |
| **shadcn/ui** | 0.8 | Accessible components, themable with Obang palette. |
| **framer-motion** | 11 | Physics-based animations for dreamlike transitions. |
| **Vercel Edge Functions** | N/A | ISR for lore blog, sub-100 ms global latency. |

*Accessibility:* full a11y score with voice-over for dreamers who dictate.

### 6.1.2 The AI Divination Engine
1. **Oriental AI Model** — GPT-4 fine-tuned on 500k+ authentic 四柱八字 calculations and 五行 elemental analyses.  
2. **Divination Neural Network** — Custom LSTM trained on 天干地支 cycles, 十神 relationships, and Eastern fortune patterns.  
3. **AI Accuracy Layer** — Machine learning validates each divination against traditional Oriental fortune-telling principles.  
4. **Real-time Oracle Processing** — AI interprets birth data through multiple Eastern divination systems in <100ms.

### 6.1.3 The Ledger of Oaths
- **EAS Schema**: `Fortune(birthHash bytes32, category uint8, timestamp uint64, foxSig bytes)`  
- **Batching**: Fortune readings aggregated into a Merkle tree per minute; root posted to EAS to cut gas by 80 %.  
- **Dispute Mechanism**: Challengers post ZK-SNARK proof of inaccuracy; slashes original validator if proven wrong.

### 6.1.4 The Rivers of Value
| Standard | Chain | Role |
|----------|-------|------|
| **SPL** | Solana | Genesis supply, censorship resistance. |
| **ERC-20** | Optimism & Polygon | DeFi, staking, cheap governance calls. |
| **ERC-721A** | Polygon | Fortune NFTs with batch minting (gas-efficient). |
| **ERC-1155** | Klaytn | Festival collectible items, low mint cost for quests. |

Bridging uses **LayerZero** with `uln 2.0` for OFT-style fungible tokens, guarded by Chainlink Proof-of-Reserve.

### 6.1.5 The Echo Vaults
- **Encrypted Birth Data**: AES-256 client-side → CID stored off-chain in user's MetaMask Snaps vault.  
- **Metadata & Fortune Art**: IPFS via Pinata + Filecoin backup.  
- **Dynamic Traits**: Ceramic IDX stores mutable streak counters referenced by NFT.

### 6.1.6 The Scrying Glass
- Real-time dashboards on **Supabase**; Postgres row-level security based on wallet auth.  
- Privacy mode: users can opt-out; data summarised into non-identifiable embeddings.

### 6.1.7 Guardians at the Gate
1. **Static Analysis** — `slither` and `mythx` on every PR.  
2. **Bug Bounty** — ImmuneFi tiered rewards up to 250 k USD.  
3. **PGP Signed Releases** — Front-end bundle hashed and notarised.

### 6.1.8 Keys for the Adept
- **GraphQL Fortune Query** — Fetch readings, categories, ownership in one endpoint.  
- **Webhook Triggers** — Receive event when a user mints or sacrifices a fortune NFT.  
- **SDK** — Typescript client auto-generated from OpenAPI.

---

## 6.2 Growing Horizons
| Phase | Bottleneck | Solution |
|-------|-----------|----------|
| v1 | Vector DB read spikes at 50 rps | Redis bloom filter pre-check. |
| v2 | SPL mint congestion | Batch inscriptions via Ordinals Crawl service. |
| v3 | Cross-chain voting gas | Switch to zkSync Validium calldata compression. |

Through this modular stack, FortuneHunters ensures that **no destiny is too grand, no reading too small**, turning birth-date whispers into globally verifiable assets.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://project-49.gitbook.io/fortunehunters/technology_stack.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
