Skip to content

Commit ac477af

Browse files
FlowmemoryAIFlowMemory Bootstrap Agent
andauthored
Add local FlowMemory devnet prototype
* Build contracts v0 foundation * Add local FlowMemory devnet prototype --------- Co-authored-by: FlowMemory Bootstrap Agent <flowmemory-bootstrap-agent@users.noreply.github.com> Co-authored-by: FlowmemoryAI <283694809+FlowmemoryAI@users.noreply.github.com>
1 parent b17d86a commit ac477af

22 files changed

Lines changed: 2248 additions & 0 deletions

chain/BASE_SETTLEMENT_ANCHOR.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Base Settlement Anchor Placeholder
2+
3+
Status: prototype model, not a Base contract
4+
5+
The local devnet includes `AnchorBatchToBasePlaceholder` to model how a future FlowMemory appchain would summarize local state for Base. It does not deploy to Base, bridge assets, or make finality/security claims.
6+
7+
## Placeholder Fields
8+
9+
The local anchor model stores:
10+
11+
- `anchorId`
12+
- `appchainChainId`
13+
- `blockRangeStart`
14+
- `blockRangeEnd`
15+
- `stateRoot`
16+
- `workReceiptRoot`
17+
- `verifierReportRoot`
18+
- `rootfieldStateRoot`
19+
- `artifactCommitmentRoot`
20+
- `previousAnchorId`
21+
- `finalityStatus`
22+
23+
The `anchorId` is deterministically derived from those fields using canonical JSON and Keccak-256.
24+
25+
## Future Base Anchor Intent
26+
27+
A future Base anchor contract would store compact roots/report digests only:
28+
29+
- No raw AI memory.
30+
- No embeddings.
31+
- No model outputs.
32+
- No media.
33+
- No large evidence bundles.
34+
- No secrets.
35+
- No bridge assets by default.
36+
37+
## Required Before Real Base Anchoring
38+
39+
- Accepted work receipt schema.
40+
- Accepted verifier report schema.
41+
- Accepted artifact commitment schema.
42+
- Multi-chain indexer reconciliation.
43+
- Bridge/security review.
44+
- Data availability review.
45+
- Governance and upgrade policy.
46+
- Testnet-only no-value prototype.
47+
48+
## No Claims
49+
50+
This placeholder is not a bridge, not a rollup proof, not a fraud proof, not a validity proof, and not a production settlement layer.

chain/BRIDGE_SECURITY_RESEARCH.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Bridge, DA, And Security Review Requirements
2+
3+
Status: research gate, no bridge implementation
4+
5+
The local FlowMemory devnet has no live bridge and no live Base settlement. `AnchorBatchToBasePlaceholder` only models compact anchor payloads for future review.
6+
7+
## Bridge Assumptions To Resolve Later
8+
9+
Before any appchain can carry value, FlowMemory must define:
10+
11+
- Deposit message format.
12+
- Withdrawal message format.
13+
- Message nonce and replay protection.
14+
- Source chain and destination chain binding.
15+
- Rootfield and receipt context binding.
16+
- Withdrawal finality policy.
17+
- Emergency pause authority and limits.
18+
- Upgrade path and delay.
19+
- Failed message recovery path.
20+
21+
## Data Availability Requirements
22+
23+
Before production appchain work, reviewers must be able to answer:
24+
25+
- Where is appchain transaction data posted?
26+
- Can a new node reconstruct appchain state from public data?
27+
- How long is data retained?
28+
- What happens if data is missing?
29+
- How does the indexer mark unavailable data?
30+
- How does the verifier avoid claiming `verified` when data is unavailable?
31+
32+
Missing DA should make appchain work unresolved or invalid, not silently trusted.
33+
34+
## Fraud, Validity, And Proof Boundary
35+
36+
The local devnet does not implement:
37+
38+
- Fraud proofs.
39+
- Validity proofs.
40+
- ZK proofs.
41+
- Permissionless fault challenges.
42+
- Rollup withdrawal finality.
43+
44+
If a future prototype uses OP Stack-derived or Base Appchain infrastructure, FlowMemory must document the exact inherited proof assumptions instead of making generic rollup claims.
45+
46+
## Independent Review Gate
47+
48+
Before value moves:
49+
50+
- Bridge design review.
51+
- DA review.
52+
- Anchor schema review.
53+
- Replay-protection review.
54+
- Key custody review.
55+
- Emergency pause review.
56+
- Monitoring and incident response drill.
57+
58+
## No-Go Conditions
59+
60+
Any of these blocks value-bearing appchain work:
61+
62+
- Unclear withdrawal finality.
63+
- Unclear DA source or retention.
64+
- No replay protection.
65+
- No emergency pause policy.
66+
- No independent bridge/security review.
67+
- Anchor roots cannot be reconciled by indexers.
68+
- Verifier reports can be marked verified without available evidence.
69+
- Appchain value requires moving raw memory, artifacts, or evidence on-chain.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Local Node And Hardware Observer Requirements
2+
3+
Status: prototype requirements
4+
5+
The local FlowMemory devnet can run on ordinary developer hardware. Hardware sidecars are optional observers, not validators, sequencers, or data availability providers.
6+
7+
## Local Developer Node
8+
9+
Minimum practical profile:
10+
11+
- CPU: any modern laptop/desktop CPU.
12+
- Memory: 1 GB available for the Rust CLI and JSON state files.
13+
- Storage: tens of MB for local state and handoff fixtures.
14+
- Network: none required for local demo after dependencies are fetched.
15+
- Secrets: none.
16+
17+
## Optional Hardware Observer Role
18+
19+
An optional FlowRouter or sidecar node may eventually:
20+
21+
- Cache compact state roots.
22+
- Cache block hashes.
23+
- Cache Base anchor placeholders.
24+
- Relay small status messages.
25+
- Provide local diagnostics.
26+
27+
It must not be treated as:
28+
29+
- A validator.
30+
- A sequencer.
31+
- A data availability provider.
32+
- A bridge operator.
33+
- A source of raw artifact data.
34+
35+
## Low-Bandwidth Boundary
36+
37+
Meshtastic and LoRa can carry compact status only:
38+
39+
- Current local block height.
40+
- Current state root.
41+
- Latest anchor id.
42+
- Health or liveness flags.
43+
44+
They must not carry:
45+
46+
- Raw memory.
47+
- Artifacts.
48+
- Model output.
49+
- Media.
50+
- Full blocks.
51+
- Data availability payloads.
52+
53+
## Future Production Questions
54+
55+
- How does a hardware observer prove freshness?
56+
- How does it detect stale state?
57+
- How does it authenticate compact status?
58+
- What happens when local cached state conflicts with an online indexer?
59+
- What is the operator response path?

chain/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# FlowMemory Local Chain Prototype
2+
3+
Status: no-value local prototype
4+
5+
This directory documents the local FlowMemory execution environment built by `crates/flowmemory-devnet`.
6+
7+
The prototype models:
8+
9+
- Rootfields.
10+
- Latest roots.
11+
- Artifact commitments.
12+
- Work receipts.
13+
- Verifier reports.
14+
- Imported FlowPulse observations.
15+
- Imported verifier reports.
16+
- Deterministic blocks.
17+
- Deterministic state roots and block hashes.
18+
- Base settlement anchor placeholders.
19+
20+
It does not implement production consensus, validator economics, tokenomics, mainnet deployment, bridge security, or full trustlessness.
21+
22+
## Runnable CLI
23+
24+
```powershell
25+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- demo
26+
```
27+
28+
Useful commands:
29+
30+
```powershell
31+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- init
32+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- reset-local
33+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- submit-fixture --fixture fixtures/handoff/sample-txs.json
34+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- run-block
35+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- inspect-state --summary
36+
cargo run --manifest-path crates/flowmemory-devnet/Cargo.toml -- export-fixtures --out-dir fixtures/handoff/generated
37+
```
38+
39+
## Docs
40+
41+
- [BASE_SETTLEMENT_ANCHOR.md](BASE_SETTLEMENT_ANCHOR.md): future Base anchor model.
42+
- [BRIDGE_SECURITY_RESEARCH.md](BRIDGE_SECURITY_RESEARCH.md): bridge, DA, proof, and review gates.
43+
- [HARDWARE_NODE_REQUIREMENTS.md](HARDWARE_NODE_REQUIREMENTS.md): local node and hardware observer requirements.
44+
45+
## Acceptance Coverage
46+
47+
This local prototype advances GitHub issues #18, #35, #36, #37, #41, #49, #50, and #51 by providing an executable no-value model and concrete fixture handoff path.

0 commit comments

Comments
 (0)