Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Frontend Only Demo

This project is for a sprint that will demonstrate visually only E2E from an invoice (existing) and added already to platformD to the point where the PT securities are created.

Highlevel components required in this demo:

  • platformD WebApp
    • Supplier
    • Investor
  • platformD server
    • CRUD states (Invoices, PTs, Users) (mock chain states)
    • orderbook
  • Gayadeed
    • SPV tenant
    • VC-API

The flow can be seen in this:

sequenceDiagram
autonumber

actor s as Supplier
actor o as Obligor
participant ws as WebApp <br /> Supplier
participant spv as SPV <br /> backend
participant g as Gayadeed
participant wi as WebApp <br /> Investor
actor i as Investor

s ->> ws: Log In
note over ws: 1. Get Invoices
s->> ws: Selects Invoice <br /> Request for CTA
ws ->> spv: request create deed
spv ->> g: deeds/create
g ->> o: invites to sign
note over g: VC issued
g ->> spv: Sends VC
note over spv: invoice status: Notarised

s ->> ws: List Invoice <br /> w/ reserve price
ws ->> spv: updateInvoice <br /> status: listed
note over spv: Create sell order in orderbook

i ->> wi: Buy order
wi ->> spv: Create buy order in orderbook

note over spv: Order matches
note over spv: 1. deduct investor account
note over spv: 2. credit supplier
note over spv: 3. create PTs
note over spv: 4. update invoice: status sold

Objects Design

User

Data Structure

  • userid
  • role (supplier, investor)
  • balance (Euros)
  • supplier VAT (if supplier)

Invoice

States

stateDiagram-v2
    [*] --> Pending_CTA
    Pending_CTA --> Notarised
    Notarised --> Listed
    Listed --> Notarised
    Listed --> Settled

Template of Verifiable credential for invoice

disclosable: disclosable in sd-jwt

  • supplier VAT
  • buyer name
  • supplier name
  • invoice number (specific to the invoice)
  • creation date (ddmmyyyy)
  • (disclosed) buyer VAT
  • (disclosed) supplier_onchain_address dchain addr
  • (disclosed) reference to calculate the DID of the notorised asset
  • (disclosed) DID (identifier of the notarised asset - did:dchain)
  • (disclosed) total_amount_due : coin (amount, denom)
  • (disclosed) payment_due_date: timestamp

Reference string for notarise asset is hash of:

  • buyer VAT
  • supplier VAT
  • invoice number
  • invoice issuance date (ddmmyyyy)
  • amount due

PT

There are 2 underlying structure here

  • PT (the actual structure representing the security with the metadata)
  • PT units (the units related to one of the PT structures)

PT Data Structure

  • ISIN;
  • Status: (Issued, Matured, Redeemed)
  • ref_id (key for PT Units)
  • Max supply

PT Units

in the db it will just be key (ref_id, user_id)

  • ref_id
  • owner (userid)
  • amount

Order

Data Structure

  • type: buy / sell
  • reserver price
  • quantity
  • filled (sell only will this be 0 / 100%)

Orderbook

AON - All or nothing on the sell side orderbook

Gayadeed Deed creation


{
    "folderName": "BUYEXXYZ",
    "folderType": "PLATFORM_D_CONTRACT",
    "kind": "INVOICE_NOTARIZATION",
    "signType": "FEQ",
    "enableChecklist": true,
    "signatoryUserId": <ENV_TENANT_USER_ID>,
    "description": "202510123",
    "participants": [
        {
            "name": "Egidio",
            "surname": "Casati",
            "email": "egidio.casati+odp_01@gmail.com",
            "phoneNumber": "+39-3459277339",
            "fiscalCode": "CSTGDE70C22F205C",
            "gender": "M",
            "birthDay": "1970-03-22",
            "cityBirthPlace": "Milano",
            "districtBirthPlace": "MI",
            "birthCountry": "IT",
            "citizenship": "IT",
            "address": {
                "street": "Viale Teodorico",
                "number": "7",
                "city": "Milano",
                "district": "MI",
                "cap": "20149",
                "region": "Lombardia",
                "country": "IT"
            },
            "metadata": {
                "BuyerName": "ACME S.p.A",
                "BuyerVatNumber": "IT12312312312",
                "BuyerAddressStreet": "C.so di P.ta Vittoria, 47",
                "BuyerAddressCity": "Milano",
                "BuyerAddressZipCode": "20122",
                "BuyerAddressCountry": "Italy",
                "BuyerLegalRepName": "Egidio Casati",
                "BuyerLegalRepTin": "CSTGDE70C22F205C",
                "SupplierName": "NYMLAB Srl",
                "SupplierVatNumber": "IT32132132132",
                "SupplierAddressStreet": "piazza del duomo, 1",
                "SupplierAddressCity": "Milano",
                "SupplierAddressZipCode": "20100",
                "SupplierAddressCountry": "Italy",
                "SupplierOnchainAddress": "dchain:0x1234567890abcdef1234567890abcdef12345678",
                "OnchainRef": "some-hash-of-the-invoice-data",
                "DID": "did:dchain:1234567890abcdef1234567890abcdef12345678",
                "InvoiceId": "2025010123",
                "InvoiceIssueDate": "2025-06-15",
                "InvoiceAmount": "25000.00",
                "InvoiceDescription": "Consultancy Q1 2025",
                "InvoicePaymentDueDate": "2025-07-15",
                "InvoiceUpdatedPaymentDueDate": "2025-07-31"
            },
            "participantType": "SUBSCRIBER",
            "personType": "NATURAL_PERSON"
        }
    ],
    "autoStartConfig": {
        "afterDocumentAutoGeneration": false,
        "afterChecklistCompletion": true
    }
}