Skip to content

Commit 11fd7ac

Browse files
add Solana payment types (#34)
* add Solana payment types
1 parent 8689588 commit 11fd7ac

2 files changed

Lines changed: 246 additions & 86 deletions

File tree

mkdocs/docs/credentials/0.1/payment-request.md

Lines changed: 179 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ General request format for payment from user.
2727

2828
Payment Request itself defines fields: _agent_, _payments_, _description_, _type_, _credentials_ and _data_. </br>
2929
Payment Data itself is also typed.
30-
The possible types for data are: _Iden3PaymentRequestCryptoV1_, _Iden3PaymentRailsRequestV1_, _Iden3PaymentRailsERC20RequestV1_; </br>
30+
The possible types for data are: _Iden3PaymentRequestCryptoV1_, _Iden3PaymentRailsRequestV1_, _Iden3PaymentRailsERC20RequestV1_, _Iden3PaymentRailsSolanaRequestV1_, _Iden3PaymentRailsSolanaSPLRequestV1_; </br>
3131
Corresponding ld context for such types: [https://schema.iden3.io/core/jsonld/payment.jsonld](https://schema.iden3.io/core/jsonld/payment.jsonld)
3232

3333

@@ -194,6 +194,45 @@ EIP712 domains for proof creation are defined [here](https://github.com/iden3/cl
194194
]
195195
}
196196
```
197+
198+
_Iden3PaymentRailsSolanaRequestV1_ is a representation of payment data that can be used for setting request to Solana chain to pay only in native currency.
199+
Type field specification:
200+
201+
| Field | Description | Type | Required |
202+
|----------------|----------------------------------------|-----------------------------------|----------|
203+
| nonce | Payment unique nonce for the issuer | string (non negative integer) ||
204+
| type | Payment Type | "Iden3PaymentRailsSolanaRequestV1"||
205+
| @context | context for ld type | string ||
206+
| recipient | withdrawal address of the issuer | string ||
207+
| amount | amounts in lamports. | string (non negative integer) ||
208+
| expirationDate | expiration of specific payment request | string (ISO format) ||
209+
| proof | w3c security proof | object[] or object ||
210+
| metadata | any additional request metadata | string (hex) ||
211+
212+
213+
For now only support proof type is [SolanaEd25519Signature2025](https://schema.iden3.io/core/jsonld/solanaEd25519.jsonld). <br />
214+
215+
216+
_Iden3PaymentRailsSolanaSPLRequestV1_ is a representation of payment data that can be used for setting request to Solana chain to pay only in SPL tokens.
217+
It has the same ideology with _Iden3PaymentRailsSolanaRequestV1_, but also it defines two additional fields: `tokenAddress` and `features`.
218+
Token address can be the address of any SPL token. Currently, no feature is supported at the client level.
219+
220+
Type field specification:
221+
222+
| Field | Description | Type | Required |
223+
|----------------|----------------------------------------------------------------------|---------------------------------|----------|
224+
| nonce | Payment unique nonce for the issuer | string (non negative integer) ||
225+
| type | Payment Type | "Iden3PaymentRailsSolanaSPLRequestV1" ||
226+
| @context | context for ld type | string ||
227+
| recipient | withdrawal address of the issuer | string ||
228+
| tokenAddress | address of the token contract | string ||
229+
| features | list of features supported by token contract | string[] ||
230+
| amount | smallest decimal for SPL tokens. | string (non negative integer) ||
231+
| expirationDate | expiration of specific payment request | string (ISO format) ||
232+
| proof | w3c security proof | object[] or object ||
233+
| metadata | any additional request metadata | string (hex) ||
234+
235+
For now only support proof type is [SolanaEd25519Signature2025](https://schema.iden3.io/core/jsonld/solanaEd25519.jsonld). <br />
197236

198237
**Examples of Iden3PaymentRequest with different data**
199238

@@ -413,6 +452,119 @@ EIP712 domains for proof creation are defined [here](https://github.com/iden3/cl
413452
}
414453
```
415454

455+
??? solana native
456+
```json
457+
{
458+
"id": "84523aa3-1b1b-4cde-9b18-6662d796a020",
459+
"thid": "84523aa3-1b1b-4cde-9b18-6662d796a020",
460+
"from": "did:iden3:polygon:amoy:x6x5sor7zpyZX9yNpm8h1rPBDSN9idaEhDj1Qm8Q9",
461+
"to": "did:iden3:polygon:amoy:x7Z95VkUuyo6mqraJw2VGwCfqTzdqhM1RVjRHzcpK",
462+
"typ": "application/iden3comm-plain-json",
463+
"type": "https://iden3-communication.io/credentials/0.1/payment-request",
464+
"body": {
465+
"agent": "https://agent-url.com",
466+
"payments": [
467+
{
468+
"data": [
469+
{
470+
"type": "Iden3PaymentRailsSolanaRequestV1",
471+
"@context": [
472+
"https://schema.iden3.io/core/jsonld/payment.jsonld#Iden3PaymentRailsSolanaRequestV1",
473+
"https://schema.iden3.io/core/jsonld/solanaEd25519.jsonld"
474+
],
475+
"recipient": "HcCoHQFPjU2brBFW1hAZvEtZx7nSrYCBJVq4vKsjo6jf",
476+
"amount": "44000000",
477+
"expirationDate": "2025-08-12T14:03:26.728Z",
478+
"nonce": "31231231233",
479+
"metadata": "0x",
480+
"proof": [
481+
{
482+
"type": "SolanaEd25519Signature2025",
483+
"proofPurpose": "assertionMethod",
484+
"proofValue": "024e6579f78669c7d456ea4b286d5c33ee85b2def2ee77a9287e1c79f0b757422df86ae5df5b9d892c9a97484fa9587349cd13ca9c8ff39f8a6e6042ca7e6107",
485+
"created": "2025-08-12T13:03:26.762Z",
486+
"verificationMethod": "did:pkh:solana:103:CTZbbbcSpZy4pxpFwhQGdf8u3hxPWKRh5ywRHuNzn2Aa",
487+
"domain": {
488+
"version": "SolanaEd25519NativeV1",
489+
"chainId": "103",
490+
"verifyingContract": "Hys6CpX8McHbPBaPKbRYGVdXVxor1M5pSZUDMMwakGmM"
491+
}
492+
}
493+
]
494+
}
495+
],
496+
"credentials": [
497+
{
498+
"type": "AML",
499+
"context": "http://test.com"
500+
}
501+
],
502+
"description": "Iden3PaymentRailsRequestSolanaV1 payment-request"
503+
}
504+
]
505+
},
506+
"created_time": 1755003806
507+
}
508+
```
509+
510+
??? solana SPL
511+
```json
512+
{
513+
"id": "70574bc1-2472-4fa0-b7b1-b79a84376fab",
514+
"thid": "70574bc1-2472-4fa0-b7b1-b79a84376fab",
515+
"from": "did:iden3:polygon:amoy:x6x5sor7zpyZX9yNpm8h1rPBDSN9idaEhDj1Qm8Q9",
516+
"to": "did:iden3:polygon:amoy:x7Z95VkUuyo6mqraJw2VGwCfqTzdqhM1RVjRHzcpK",
517+
"typ": "application/iden3comm-plain-json",
518+
"type": "https://iden3-communication.io/credentials/0.1/payment-request",
519+
"body": {
520+
"agent": "https://agent-url.com",
521+
"payments": [
522+
{
523+
"data": [
524+
{
525+
"type": "Iden3PaymentRailsSolanaSPLRequestV1",
526+
"@context": [
527+
"https://schema.iden3.io/core/jsonld/payment.jsonld#Iden3PaymentRailsSolanaSPLRequestV1",
528+
"https://schema.iden3.io/core/jsonld/solanaEd25519.jsonld"
529+
],
530+
"recipient": "HcCoHQFPjU2brBFW1hAZvEtZx7nSrYCBJVq4vKsjo6jf",
531+
"amount": "500000000",
532+
"expirationDate": "2025-08-12T14:14:54.421Z",
533+
"nonce": "11212312003",
534+
"metadata": "0x",
535+
"proof": [
536+
{
537+
"type": "SolanaEd25519Signature2025",
538+
"proofPurpose": "assertionMethod",
539+
"proofValue": "378f2941ef5f87b85445b803405620f8e300a05b627e07f51edbf886610cddc4f1dbdbaf6fa1693d975953d1783cbf5dbe0f9e0b5708978eef1fec1e7964a90a",
540+
"created": "2025-08-12T13:14:54.453Z",
541+
"verificationMethod": "did:pkh:solana:103:CTZbbbcSpZy4pxpFwhQGdf8u3hxPWKRh5ywRHuNzn2Aa",
542+
"domain": {
543+
"version": "SolanaEd25519SPLV1",
544+
"chainId": "103",
545+
"verifyingContract": "Hys6CpX8McHbPBaPKbRYGVdXVxor1M5pSZUDMMwakGmM"
546+
}
547+
}
548+
],
549+
"tokenAddress": "4MjRhSkDaXmgdAL9d9UM7kmgJrWYGJH66oocUN2f3VUp"
550+
}
551+
],
552+
"credentials": [
553+
{
554+
"type": "AML",
555+
"context": "http://test.com"
556+
}
557+
],
558+
"description": "Iden3PaymentRailsRequestSolanaSPLV1 payment-request integration test"
559+
}
560+
]
561+
},
562+
"created_time": 1755004494
563+
}
564+
```
565+
566+
567+
416568
??? multiple
417569

418570
```json
@@ -530,6 +682,32 @@ EIP712 domains for proof creation are defined [here](https://github.com/iden3/cl
530682
}
531683
}
532684
]
685+
},
686+
{
687+
"type": "Iden3PaymentRailsSolanaRequestV1",
688+
"@context": [
689+
"https://schema.iden3.io/core/jsonld/payment.jsonld#Iden3PaymentRailsSolanaRequestV1",
690+
"https://schema.iden3.io/core/jsonld/solanaEd25519.jsonld"
691+
],
692+
"recipient": "HcCoHQFPjU2brBFW1hAZvEtZx7nSrYCBJVq4vKsjo6jf",
693+
"amount": "44000000",
694+
"expirationDate": "2025-08-12T14:03:26.728Z",
695+
"nonce": "31231231233",
696+
"metadata": "0x",
697+
"proof": [
698+
{
699+
"type": "SolanaEd25519Signature2025",
700+
"proofPurpose": "assertionMethod",
701+
"proofValue": "024e6579f78669c7d456ea4b286d5c33ee85b2def2ee77a9287e1c79f0b757422df86ae5df5b9d892c9a97484fa9587349cd13ca9c8ff39f8a6e6042ca7e6107",
702+
"created": "2025-08-12T13:03:26.762Z",
703+
"verificationMethod": "did:pkh:solana:103:CTZbbbcSpZy4pxpFwhQGdf8u3hxPWKRh5ywRHuNzn2Aa",
704+
"domain": {
705+
"version": "SolanaEd25519NativeV1",
706+
"chainId": "103",
707+
"verifyingContract": "Hys6CpX8McHbPBaPKbRYGVdXVxor1M5pSZUDMMwakGmM"
708+
}
709+
}
710+
]
533711
}
534712
],
535713
"description": "you can pass the verification on our KYC provider by following the next link"

0 commit comments

Comments
 (0)