# Technical Architecture

## 1. **Layered Architecture Diagram**

```graphql
    A[Off-Chain Data Sources] --> B[Data Lake]  
    B --> C[Preprocessing Pipeline]  
    end  

    subgraph AI Layer  
    C --> D[Federated Learning Nodes]  
    D --> E{PVE Engine}  
    E --> F[Risk Model]  
    E --> G[Valuation Model]  
    end  

    subgraph Blockchain Layer  
    H[Base Chain] --> I[Property NFTs]  
    I --> J[ERC-721R Registry]  
    H --> K[DeFi Gateway]  
    end  

    subgraph Application Layer  
    L[Portfolio Dashboard] --> M[Auto-Rebalance Module]  
    L --> N[Yield Simulator]  
    K --> O[DEX Aggregator]  
    end  

    F --> H  
    G --> H  
    M --> K  
```

## 2. Core Component Interaction Process

### Data Flow

#### 1. Offline Data Collection

**• Sources**: Satellite imagery *(eg. Sentinel-2 API)*, government open data *(eg. Census.gov)*, real estate MLS database, IoT sensor streams

• **Protocol:** Standardize data format using Chainlink external adapters

#### 2. AI Processing Layer

• **Federated Learning**: 10 geographically distributed nodes with training data privacy protected by SGX Enclave

**• Model Output:** Generate a JSON-format oracle report every hour, including:

```json
{  
  "property_id": "0x...",  
  "valuation": {"base": 500000, "bull": 550000, "bear": 480000},  
  "risk_score": 0.23,  
  "timestamp": 1717027200  
}  
```

#### 3. On-chain Integration

**Base Chain Contracts:**

• `PropertyFactory.sol:` Mints ERC-721R NFTs and binds them to legal SPV files (using IPFS CID).

• `PVEOracle.sol`: Verifies AI oracle signatures and updates token prices.

**DeFi Interaction:**

• Uses a custom AMM curve on Balancer V3 to adjust liquidity pool weights based on risk scores.

## 3. Key Protocol Descriptions

#### 1. ERC-721R Extension Standard

```solidity
// Legal Metadata Extension  
struct LegalWrapper {  
    address spvAddress;  
    string jurisdiction;  
    bytes32 insuranceHash;  
}  

mapping(uint256 => LegalWrapper) public propertyLegalInfo;  

// Revenue Distribution Logic  
function distributeYield(uint256 tokenId) external {  
    require(msg.sender == AI_Oracle, "Unauthorized");  
    uint256 yield = calculateYield(tokenId);  
    ERC20(USDC).transfer(ownerOf(tokenId), yield);  
}  
```

#### 2. AI Oracle Network

**a. Node Architecture:**

• Utilizes a Threshold Signature Scheme (TSS), requiring signatures from 5 out of 8 nodes to update the price.

• Penalty Mechanism: Nodes that make incorrect predictions more than 3 times will have their collateral slashed.

**b. Data Validation:**

• Satellite imagery is validated for building changes using TrueBit.

• Rental data is indexed for off-chain events via The Graph.

## 4.Security Architecture

<table><thead><tr><th width="222">Attack Surface</th><th>Defense Strategy</th></tr></thead><tbody><tr><td>Data Tampering</td><td>Data source SSL fingerprint verification + IPFS content addressing</td></tr><tr><td>Model Poisoning</td><td>Federated learning gradient encryption + Differential privacy</td></tr><tr><td>Oracle Manipulation</td><td>Multi-signature verification + 30-minute price update delay</td></tr><tr><td>Contract Vulnerabilities</td><td>Formal verification (Certora) + Monthly third-party audits</td></tr></tbody></table>
