Skip to content

Commit cbc9a8c

Browse files
JOYclaude
andcommitted
docs: add on-chain write flow and entity ID normalization to design
Reference DOS Chain integration spec for DOSAttester contract, ATTESTER_ROLE requirements, and entity ID normalization conventions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1bc3282 commit cbc9a8c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

plans/2026-03-04-threat-intel-pipeline-design.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,31 @@ No changes needed — bot calls same API endpoints. Richer data flows through au
226226
| Duplicate entries | UNIQUE(entity_hash, source) — ON CONFLICT UPDATE last_seen_at |
227227
| Expired cache | WHERE expires_at IS NULL OR expires_at > now() |
228228

229+
## On-Chain Write Flow (Phase 2)
230+
231+
Reference: [DOSafe Entity Flag Integration Spec](../../integration/dosafe-entity-flag-integration.md)
232+
233+
When user reports are reviewed and confirmed, write attestation on-chain via DOSAttester:
234+
235+
```
236+
User report → DB (risk_score: 50) → Admin/LLM review → Confirmed?
237+
→ YES: Write EAS attestation on-chain (DOSAttester contract)
238+
→ NO: Mark as disputed in DB
239+
```
240+
241+
**Requirements**:
242+
- DOSAttester: `0x3939CA17770F058A01b50793Fa29f9A8a4FFA77E`
243+
- Need `ATTESTER_ROLE` on DOSAttester contract
244+
- Env: `ATTESTER_PRIVATE_KEY=0x...`
245+
- Flow: DB first, chain second — never write unverified reports on-chain
246+
247+
**Entity ID normalization (per DOS Chain spec)**:
248+
- domain: lowercase, strip `www.`
249+
- url: lowercase scheme+host, strip tracking params, strip trailing `/`
250+
- phone: E.164 format (`+84909123456`)
251+
- email: lowercase
252+
- bank_account: `BANK_CODE:ACCOUNT_NUMBER` (e.g. `VCB:1234567890`)
253+
229254
## Key Design Decisions
230255

231256
1. **Single unified table** over per-source tables — simpler queries, easier to add sources, adequate for 100k-200k rows

0 commit comments

Comments
 (0)