Repository Discovery (Stage 0)
Date: 2026-10-29
Path: apps/carbon-blockchain-stellar/
1. Current state
| Area | Finding |
|---|---|
| Structure | The directory was empty at discovery (created 2026-10-29 19:26). Only docs/ has been added since, by Stages 0–1 |
| Git | Not a git repository (git status: "not a git repository"), and no parent repository |
| Branches / history | None |
| Languages / source code | None |
| Go modules / Node packages / Rust crates | None |
| Dockerfiles / Compose | None |
| Database migrations | None |
| Stellar integration, wallets, contracts | None |
| APIs, frontend, admin interface | None |
| Tests | None |
| CI/CD | None |
| Monitoring | None |
| Configuration / secrets handling | None. No .env files exist |
| Documentation | None before this stage |
Conclusion: this is a greenfield repository. No existing code limits the architecture. Technical debt, existing risks and existing security posture are all none, because nothing exists yet.
2. Related prior work (same workspace, outside this repository)
The same product brief has been carried through on four other chains. They were read only (no files copied) to learn which decisions were made, which pitfalls were found and what can be reused. Nothing is inherited unless the product owner decides so (Q-00 in docs/architecture/DECISIONS.md).
| Project | Chain | State (from its own docs and git log) | Latest commit |
|---|---|---|---|
../dara-blockchain/ | Arbitrum (Solidity) | DEMO READY; production NO-GO | 61c07d1 |
../carbon-blockchain-avalanche/ | Avalanche sovereign L1 | FUJI READY; 114 recorded decisions; both review passes closed | 5017772 |
../carbon-blockchain-cosmos/ | Own Cosmos SDK chain | DEMO READY; reviews 1 and 2 done; HSM/TMKMS work in progress | b3f6f82 (2026-10-15) |
../carbon-blockchain-ethereum-l1/ | Ethereum L1 | Stages 0–9 done; uncommitted changes in backend/ (engine, gate, gateway, handlers) | eefc5f2 (2026-10-18) |
../carbon-blockchain-solana/ | Solana | Stages 0–1 only (docs) | — |
2.1 Product decisions already made in the sibling projects
The product owner accepted these in the Ethereum-L1 project on 2026-10-15 (../carbon-blockchain-ethereum-l1/docs/architecture/DECISIONS.md). They are the strongest available prior. They are not assumed here; Q-00 asks whether to carry them over.
| Topic | Sibling decision |
|---|---|
| Code reuse | Port the domain, ledger, API and web modules with review; rebuild the chain layer; record provenance |
| Token unit | 1 token = 1 unit defined per asset (GOLD = 1 g of 750 gold) |
| Holders | Only KYC-allowlisted holders; per-account freeze; pause; forced transfer through a multisig only; MVP transfers only between platform users |
| Custody | Custodial, one chain address per customer; the platform pays all fees; customers hold no native coin |
| On-chain visibility | One chain transaction per BUY/SELL/TRANSFER |
| Issuance control | Reserve cap set by a 2-of-3 multisig; mint only to Treasury; backing approved off-chain under the four-eyes rule |
| Pricing and currency | Manual admin mid price per asset; buy/sell spread in bps; 30 s quote TTL; stale price blocks trading; IRR stored as integer Rials, UI shows Toman |
| Chain outage | Fail closed: no new BUY/SELL/TRANSFER; in-flight operations stay pending; reads and quotes keep working |
| Validators | Self-hosted nodes; no validators |
| Admin exposure | Private network/VPN only; password + TOTP |
| Frontends | Customer wallet PWA, admin console, public scanner, landing site (fa/en, RTL) |
| Redis | Not used; all durable state in PostgreSQL |
2.2 Reusable chain-independent code (candidate, subject to Q-00)
../carbon-blockchain-ethereum-l1/backend/internal/ (Go 1.27.1, pgx v5, goose, Prometheus, OpenTelemetry) contains modules that do not depend on the chain: money, ledger, assets, reserve, issuance, pricing, trading, cash, identity, audit, incident, reconciliation (framework), httpapi, gate, actor, apperr. The chain-specific modules (chain, gateway, rpcproxy, custody, signer, indexer, governance, devsafe) would be rebuilt for Stellar.
If code is ported, take it from a clean commit: the Ethereum-L1 working tree has uncommitted changes.
2.3 Lessons from the siblings that apply to Stellar
- A submission timeout is not a failure. Funds are released only after the chain proves the transaction failed or can no longer be included (Avalanche D-088). On Stellar, an expired time bound plus a ledger past that bound is the proof.
- An old reserve attestation must stop new issuance (Avalanche D-098/D-099).
- Verify on-chain authorities at startup and in every reconciliation run (Avalanche D-102). On Stellar this means the issuer's signers, thresholds and flags.
- Pin the chain identity at startup (Avalanche D-036). On Stellar this is the network passphrase, cross-checked with
getNetwork.
3. Local development machine
| Tool | Found | Needed for |
|---|---|---|
| Go | 1.27.1 at ~/.local/go/bin and 1.26.9 at ~/sdk/go1.26.9, both not on PATH | Backend |
| govulncheck | ~/go/bin | Dependency security |
| Rust / cargo | 1.97.1 (no wasm32v1-none target installed) | Soroban contracts, only if selected |
| Node.js / pnpm | v24.16.0 / 12.14.0 | Next.js frontends |
| Docker | Not installed; Podman 4.9.3 is | Quickstart, Compose demo |
| Stellar CLI | Not installed | Local network, asset setup, SAC deploy |
| psql | Not installed (PostgreSQL runs in a container) | — |
| Hardware | 16 vCPU, 30 GB RAM (≈6 GB free while the other stacks run), 83 GB free on /home | Enough for Quickstart local. Not enough for a Mainnet RPC node (see the baseline, §5) |
4. Missing components
All of them: backend, frontends, Stellar integration, database, tests, containers, CI, monitoring and IaC. The target structure is designed in Stage 3 and later, after the blocking product decisions.
5. Risks found in discovery
| ID | Risk | Mitigation |
|---|---|---|
| R-01 | No version control: work can be lost, and there is no provenance | git init (awaiting the product owner's OK, see §6) |
| R-02 | Porting sibling code also carries over its chain assumptions (EVM nonces, reorgs, on-chain caps) | Port only chain-independent modules; Review Pass 1 treats ported code as new |
| R-03 | Low free RAM while the sibling stacks run | Stop sibling stacks before running the local Stellar stack |
| R-04 | The Protocol 30 vote is on 2026-11-23, during our build | Pin SDKs that decode P30 ledgers from the start (baseline §0, A1) |
6. Recommended next actions
git initwith branchmain, plus a first commit ofdocs/. Not done; awaiting your OK.- Install the Stellar CLI 28.1.x, or the P30 release once published. Confirm Podman (
podman compose) as the container runtime, or install Docker Engine. - Put Go 1.27.1 on
PATHfor this project, for example through the Makefile. - Answer Q-00 to Q-04 (
docs/architecture/DECISIONS.md).