x/notary DSD Verifier
The example verifier contract has the correct interface that the x/notary module calls.
Given that we are not using sylvia anymore(it is only a code generation tool), we can still use the d-foundation/protocol-contracts package for the types.
However the trait that the example contract implements will just have to be an enum in the ExecuteMsg entry point.
On the interface with AVIDA sd-jwt, we can look at the example contract in the AVIDA repo.
The verifiable presentation have to disclose the following fields.
- buyer: string
- value: coin
- maturity timestamp
- did_addr (string) expected instantiate2, code address
This has to be signed by a jwk that represents the SPV entity. Maturity timestamp > the current block time
Expected Verifiable Presentation
-
Query API / webapp logic to get odp_contract_address (instantiate2 address) with a salt for instantiate2 which is hash of:
- buyer VAT
- supplier VAT
- document type (invoice)
- progress number
- creation date (ddmmyyyy)
-
Offchain issue verifiable credential (ODP VC)
- (disclosable) buyer VAT
- supplier VAT
- document type (invoice)
- progress number
- creation date (ddmmyyyy)
- (disclosable) salt for instantiate2
- (disclosable) amount_due : coin (amount, denom)
- (disclosable) payment_due_date: timestamp
- (disclosable) odp_contract_addr: (from step 1)
-
Supplier submits ODP VP (derived from step 2 ODP VC) onchain to notarise, the ODP VP will disclose
- (disclose) salt for instantiate2
- (disclose) amount_due : coin (amount, denom)
- (disclose) payment_due_date: timestamp
- (disclose) odp_contract_addr: (from step 1)
-
notary verification passed, SPV orchestrator (recieves
postverexec: output_ver / input_verwhich is the VP) use instantiate2 to create the ODP Verified Object, SPV orchestrator checks thatodp_contract_addressis the correct one for the instantiate2 calculation. Populate with:- buyer VAT: string
- amount_due : coin (amount, denom)
- payment_due_date: timestamp
-
the ODP Verified Object will need to store in state
- (static) buyer VAT: string -(static) amount_due : coin (amount, denom)
- (static) payment_due_date: timestamp
- (Updatable) owner supplier address