LeafhavenDocs
System Architecture

Interactive Deal Room & Escrow 30/70 Architecture

Real-time Counter-Offers, Cryptographic SHA-256 HMAC Proforma Signing, Multi-Party Digital Signatures, and 30/70 Escrow Milestones

Interactive Deal Room & Escrow 30/70 Architecture

Trust & Settlement Engine: In high-value international commodity contracts ($50,000 to $200,000+ per container shipment), informal agreements over email or messaging apps expose both parties to devastating risks: payment defaults for exporters, non-delivery or sub-standard cargo for buyers, and invoice-tampering bank fraud. B2BExpo Deal Room (/deal-room/[id]) provides a secure, cryptographically verifiable negotiation space backed by a 30/70 institutional escrow vault.


1. Information Flow & Deal Lifecycle

    [ Buyer on PDP or /rfq ] ──► Submits Container RFQ
                                         │
                                         ▼
    ┌────────────────────────────────────────────────────────┐
    │             Meja Negosiasi Deal Room (/deal-room/[id])  │
    │   • Live FOB/CIF Recalculation   • Counter-Offer Engine │
    │   • SHA-256 HMAC Proforma Signer • Audit Log Stream     │
    └───────────────────────────┬────────────────────────────┘
                                │
          ┌─────────────────────┴─────────────────────┐
          ▼                                           ▼
   [ Buyer Action ]                            [ Seller Action ]
   • Submit Counter ($/MT)                     • Accept / Counter
   • Digital e-Signature                       • Digital e-Signature
          │                                           │
          └─────────────────────┬─────────────────────┘
                                ▼
    ┌────────────────────────────────────────────────────────┐
    │           Contract Execution & 30/70 Escrow            │
    │   1. Both Parties Sign ──► Stage: SIGNED               │
    │   2. Buyer Deposits DP 30% into Custody Bank Escrow    │
    │   3. Cargo Loaded & Bill of Lading (B/L) Verified      │
    │   4. Final 70% Released to Exporter ──► Stage: SETTLED │
    └───────────────────────────┬────────────────────────────┘
                                │
                                ▼
    ┌────────────────────────────────────────────────────────┐
    │             Twenty CRM Outbox Synchronization          │
    │   • Mutation: updateOpportunity (Stage, Amount, Terms)  │
    └────────────────────────────────────────────────────────┘

2. Real-Time Counter-Offer Engine

International roasters and importers often request adjustments based on purchase volume or shipping schedules:

  1. Dynamic Parameter Adjustment:
    • Unit Price ($/MT): Allows bilateral proposals (e.g. roaster offers $3,800/MT for 2 containers; exporter agrees subject to 14-day loading).
    • Volume (MT): Dynamic equipment recalculation (18 MT = 1x 20ft FCL; 36 MT = 2x 20ft FCL; 54 MT = 2x 40ft HC).
    • Incoterms 2020 Rules: Instant switching between FOB (Pelabuhan Belawan/Priok), CFR (Cost & Freight), and CIF (Cost, Insurance & Freight).
  2. Instant Financial Recalculation:
    • Ocean freight buffers ($3,200) and maritime insurance (ICC A clause, $650) update in real-time.
    • Escrow splits are calculated automatically:
      • Down Payment (30%): Total Contract Value * 0.30
      • Settlement Balance (70%): Total Contract Value * 0.70
  3. Twenty CRM Mutation:
    • Every submitted counter-offer invokes submitCounterOfferAction, updating the corresponding Twenty CRM opportunity's value and setting stage to NEGOTIATION.

3. Cryptographic Proforma Signing (@tradeos/trade-docs)

To eradicate business email compromise (BEC) fraud—where hackers hijack email threads to substitute fraudulent bank accounts—B2BExpo generates an immutable cryptographic signature on every proforma:

// Core Signing Implementation from @tradeos/trade-docs
const signaturePayload = {
  proformaNumber: 'PI-RFQ-2026-0881',
  sellerCompany: 'PT Nusantara Agro Expor',
  buyerCompany: 'Hanseatic Trade GmbH',
  totalAmount: 73150,
  currency: 'USD',
  bankDetails: {
    bankName: 'Bank Mandiri (Persero) Tbk',
    swiftBic: 'BMRIIDJA',
    accountNumber: '123-00-9876543-1',
  }
};

const digitalSignature = signProformaInvoice(signaturePayload, SECRET_KEY);
// Output: SHA-256 HMAC hash displayed on UI and embedded into verification QR Code
  • Zero-Trust Verification: If a malicious actor alters a single digit in the bank account number or total amount, serverVerifyProforma immediately flags the tampering and revokes the signature.

4. The 30/70 Escrow Custody Protocol

B2BExpo utilizes an institutional milestone structure partnered with licensed custodian banks (Bank Mandiri / Standard Chartered):

Milestone StepTrigger ConditionFund AllocationRisk Protection
Milestone 1: Contract SigningBoth Buyer and Seller complete digital e-Signature.$0 moved; Contract legally locked.Eliminates verbal ambiguity.
Milestone 2: DP 30% Escrow LockBuyer transfers 30% via Swift MT103 / wire to Escrow Custody account.30% held in custody (not released to seller yet).Protects buyer from unfulfilled orders; protects seller against cancellation.
Milestone 3: Vessel Loading & InspectionSucofindo issues COA; Carrier issues official Bill of Lading (B/L).Cargo in transit.Independent verification of quality & quantity.
Milestone 4: Final 70% SettlementBuyer validates B/L and customs documents; Escrow releases 100%.100% disbursed to Exporter's registered bank account.Guaranteed payment for exporter; guaranteed documentation for buyer.

5. Unified Audit Trail & Twenty CRM Telemetry

All timeline events—inquiries, official quotes, counter-offers, digital signatures, and escrow locks—are stored in an audit-logged ledger. Exporters can track the complete deal progression in the Seller Console (/seller) under the Twenty CRM tab, with full outbox synchronization guarantees.