Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add payment files #41

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions core/json/Iden3PaymentRailsRequestV1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type:": "address"
}
],

volodymyr-basiuk marked this conversation as resolved.
Show resolved Hide resolved
"Iden3PaymentRailsRequestV1": [
{
"name": "expirationDate",
"type": "uint256"
},
{
"name": "metadata",
"type": "string"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "recipient",
"type": "string"
},
{
"name": "value",
"type": "uint256"
}
]
}
37 changes: 37 additions & 0 deletions core/jsonld/payment.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
79 changes: 79 additions & 0 deletions core/vocab/payment.md
Original file line number Diff line number Diff line change
@@ -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": ""
}
}
}
]
}
```