Skip to main content
Loading navigation

Build an Empty Container Repatriation TradeTrust Proof Generator — implementation

Prompt source

implementation78 lines11 sectionsNo variables1 code block
## Build
Reconcile empty shipping container return receipts against carrier leasing ledgers. Wrap verified depot drop-off logs with OpenAttestation to generate immutable cryptographic proofs, preventing erroneous equipment non-return penalties and defending leasing disputes.

## User
Depot Operations and Equipment Logistics Manager

## Workflow
1. Extract empty container yard drop-off timestamps and equipment condition logs from depot feeds.
2. Reconcile return events against original ocean carrier leasing agreements and free-time deadlines.
3. Wrap the empty container return receipt using the OpenAttestation schema to produce an immutable cryptographic proof.
4. Generate a structured penalty defense dossier if carriers erroneously invoice for unreturned or late equipment.

## Interface
Depot reconciliation dashboard displaying empty container return deadlines, OpenAttestation drop-off proofs, and automated leasing dispute dossiers.

## Data
Mocked ocean carrier leasing ledger datasets paired with simulated container yard drop-off logs in JSON format.
Starter examples below are synthetic. They are not downloaded records.

## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Uses signDocument and verifySignature from @govtechsg/open-attestation to wrap empty container return events into verifiable records.

## Tools
mastra-ai, ethers, typescript.
Mastra AI orchestrates the multi-step verification between carrier leasing deadlines, depot drop-off data extraction, and OpenAttestation signing.
Local or hosted LLM API capable of comparing datetime objects and drafting formal commercial leasing defense summaries based on timestamp proofs.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parse and extract depot drop-off timestamps and container IDs from incoming yard logs.
- Sign and verify wrapped empty container receipts using OpenAttestation Secp256k1VerificationKey2018 utilities.
- Detect discrepancies between carrier return deadlines and actual depot drop-off timestamps to validate or invalidate leasing penalties.
- Generate an itemized dispute response citing the OpenAttestation receipt hash when erroneous late fees are detected.

## Starter Examples
```json
[
  {
    "input": {
      "container_number": "MEDU9876543",
      "carrier_name": "Med Freight Empty Dept",
      "return_deadline": "2025-04-05T18:00:00Z",
      "depot_dropoff": {
        "yard_id": "TUAS-DEPOT-3",
        "dropoff_time": "2025-04-05T15:00:00Z",
        "condition": "SOUND"
      },
      "late_fee_per_hour_sgd": 50
    },
    "expected_output": {
      "_note": "These are simplified synthetic app records, not complete official schema files.",
      "return_verified": true,
      "hours_early": 3,
      "late_fee_owed_sgd": 0,
      "oa_receipt_hash": "0x44a19b882fe",
      "defense_action": "RETURN_VERIFIED: Container dropped at TUAS-DEPOT-3 3 hours before deadline. Receipt wrapped."
    }
  },
  {
    "input": {
      "container_number": "MSKU1122334",
      "carrier_name": "Maersk Equipment",
      "return_deadline": "2025-04-02T12:00:00Z",
      "depot_dropoff": {
        "yard_id": "JURONG-DEPOT-1",
        "dropoff_time": "2025-04-02T16:00:00Z",
        "condition": "SOUND"
      },
      "late_fee_per_hour_sgd": 50
    },
    "expected_output": {
      "_note": "These are simplified synthetic app records, not complete official schema files.",
      "return_verified": true,
      "hours_late": 4,
      "late_fee_owed_sgd": 200,
      "oa_receipt_hash": "0x99a22e811c",
      "defense_action": "LATE_RETURN: Container dropped 4 hours late. Liability confirmed for SGD 200, no defense generated."
    }
  }
]
```

## Safety
Dispute packets and leasing defenses are advisory documents; no actual funds or legal arbitration notices are transmitted.
Use mock external writes. Require human review before any real deployment.