diff --git a/core/json/Iden3PaymentRailsRequestV1.json b/core/json/Iden3PaymentRailsRequestV1.json new file mode 100644 index 0000000..dafac4e --- /dev/null +++ b/core/json/Iden3PaymentRailsRequestV1.json @@ -0,0 +1,42 @@ +{ + "EIP712Domain": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type:": "address" + } + ], + "Iden3PaymentRailsRequestV1": [ + { + "name": "expirationDate", + "type": "uint256" + }, + { + "name": "metadata", + "type": "string" + }, + { + "name": "nonce", + "type": "uint256" + }, + { + "name": "recipient", + "type": "string" + }, + { + "name": "value", + "type": "uint256" + } + ] +} diff --git a/core/jsonld/payment.jsonld b/core/jsonld/payment.jsonld new file mode 100644 index 0000000..7cf1eac --- /dev/null +++ b/core/jsonld/payment.jsonld @@ -0,0 +1,37 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "Iden3PaymentRailsRequestV1": { + "@id": "https://schema.iden3.io/core/jsonld/payment.jsonld#Iden3PaymentRailsRequestV1", + "@context": { + "@protected": true, + "@propagate": true, + "@vocab": "https://schema.iden3.io/core/vocab/payment.md#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "nonce": { + "@id": "nonce", + "@type": "xsd:nonNegativeInteger" + }, + "value": { + "@id": "value", + "@type": "xsd:nonNegativeInteger" + }, + "recipient": { + "@id": "value", + "@type": "xsd:string" + }, + "expirationDate": { + "@id": "expirationDate", + "@type": "xsd:dateTime" + }, + "metadata": { + "@id": "metadata", + "@type": "xsd:string" + } + } + } + } +} diff --git a/core/vocab/payment.md b/core/vocab/payment.md new file mode 100644 index 0000000..d248bc8 --- /dev/null +++ b/core/vocab/payment.md @@ -0,0 +1,79 @@ +# recipient + +recipient of the payment + +``` + "recipient": "0x1234567" +``` + +# value + +amount to pay + +``` + "value": "1" +``` + +# nonce + +unique nonce + +``` + "nonce": "1" +``` + +# metadata + +payment request metadata (optional) + +``` + "metadata": "0x" +``` + +# expirationDate + +when payment request is expired (ISO string) + +``` + "expirationDate": "ISO" +``` + +# proof + +signature proof + +# example for universal resolver field didResolutionMetadata +```json +{ + "@context": [ + "https://schema.iden3.io/core/jsonld/payment.jsonld#Iden3PaymentRailsRequestV1", + "https://w3id.org/security/suites/eip712sig-2021/v1" + ], + "type": "Iden3PaymentRailsRequestV1", + "recipient": "0xaddress", + "value": "100", + "expirationDate": "ISO string", + "nonce": "25", + "metadata": "0x", + "proof": [ + { + "type": "EthereumEip712Signature2021", + "proofPurpose": "assertionMethod", + "proofValue": "0xa05292e9874240c5c2bbdf5a8fefff870c9fc801bde823189fc013d8ce39c7e5431bf0585f01c7e191ea7bbb7110a22e018d7f3ea0ed81a5f6a3b7b828f70f2d1c", + "verificationMethod": "did:pkh:eip155:0:0x3e1cFE1b83E7C1CdB0c9558236c1f6C7B203C34e#blockchainAccountId", + "created": "2024-09-26T12:28:19.702580067Z", + "eip712": { + "types": "https://example.com/schemas/v1", + "primaryType": "IdentityState", + "domain": { + "name": "StateInfo", + "version": "1", + "chainId": "0x0", + "verifyingContract": "0x0000000000000000000000000000000000000000", + "salt": "" + } + } + } + ] +} +```