# Architecture

General flow diagram of 4Mica

<figure><img src="https://1945048287-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqwQzYDQSbGeudICjMddT%2Fuploads%2FkAnwZDr0fOWl8pF7W2yj%2F4mica_protocol_v4_condensed.svg?alt=media&amp;token=3870abe4-9e4a-45b9-bf22-11721f82b7ea" alt=""><figcaption></figcaption></figure>

## 4Mica MVP Call Flow

### Participants

* **Client (C)**
* **Server (S)**
* **Facilitator (4Mica Core Service) (F)**
* **Vault (4Mica Core Contract) (B)**

***

### 1. Deposit

1. Client deposits `val` to Vault (`B`).
2. Vault emits `"deposit"` event to Facilitator (`F`).
3. The facilitator adds collateral for the client.

Vault at the alpha release is the core contract of 4Mica, and in later releases, would be a capital-efficient vault.&#x20;

***

### 2. Transaction Phase

#### 0th Request

* Client requests service from Server.
* Server responds with `402 Payment Required` and a `tab_id`.
* Client records `start_ts`.

#### ith Request

1. Client sends service request with a signed promise.
2. Server verifies promise via Facilitator.
   * If promise is invalid → decline.
   * If insufficient funds → decline.
   * Else:
     * Facilitator aggregates and locks promise.
     * Server executes the service request.
     * Client receives answer.

***

### 3. Settlement (Client Pays Server)

1. Client pays server on-chain (`val`, `tid`, `req_id`).
2. Facilitator monitors blockchain for transactions.
3. If transaction matches promise:
   * Record payment, update collateral lock.
   * Notify Vault to register payment.
4. Vault updates status.

***

### 4. Remuneration (If Client Fails to Pay)

1. Server triggers timeout and requests remuneration from Vault.
2. Vault verifies request:
   * Invalid → error.
   * Valid → pays server from client deposit.
3. Facilitator unlocks the locked collateral that was used to back the line of credit for the tab.
4. Vault emits `"remunerated"` event.

***

### 5. Withdrawal

1. Client requests withdrawal from Vault.
   * If `val > deposit` → error.
   * Otherwise, Facilitator reserves funds.
2. After `WITHDRAWAL_LATENCY`:
   * Client executes withdrawal:
     * If valid → transfer funds and update deposit/collateral.
     * If invalid → error.
   * Client may cancel withdrawal request:
     * Vault and Facilitator remove reservation.


# X402 Adaption

Adaption to 4Mica from X402 Standard


# 4mica Services JSON-RPC API

## POST /core/getPublicParams

> Get public parameters (BLS public key)

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/getPublicParams":{"post":{"summary":"Get public parameters (BLS public key)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"Core public parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_CorePublicParameters"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_CorePublicParameters":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/CorePublicParameters"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"CorePublicParameters":{"type":"object","properties":{"public_key":{"type":"array","items":{"type":"integer"}}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /core/registerUser

> Register a new user address

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/registerUser":{"post":{"summary":"Register a new user address","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"Success or error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_Null"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_Null":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"type":"null"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /core/getUser

> Retrieve deposit info for a user

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/getUser":{"post":{"summary":"Retrieve deposit info for a user","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"User info or null if not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_UserInfo"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_UserInfo":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"oneOf":[{"$ref":"#/components/schemas/UserInfo"},{"type":"null"}]},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"UserInfo":{"type":"object","properties":{"deposit":{"type":"number"},"available_deposit":{"type":"number"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/UserTransactionInfo"}}}},"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /core/issuePaymentCert

> Lock deposit and return a BLS payment certificate

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/issuePaymentCert":{"post":{"summary":"Lock deposit and return a BLS payment certificate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"Payment certificate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_PaymentCertificate"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_PaymentCertificate":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/PaymentCertificate"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /core/getTransactionsByHash

> Retrieve transactions by their hashes

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/getTransactionsByHash":{"post":{"summary":"Retrieve transactions by their hashes","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"List of transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_ArrayOfUserTransactionInfo"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_ArrayOfUserTransactionInfo":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"type":"array","items":{"$ref":"#/components/schemas/UserTransactionInfo"}},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /core/verifyTransaction

> Verify a transaction by hash

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/core/verifyTransaction":{"post":{"summary":"Verify a transaction by hash","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"Verification result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_TransactionVerificationResult"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_TransactionVerificationResult":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/TransactionVerificationResult"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"TransactionVerificationResult":{"type":"string","enum":["Verified","AlreadyVerified","NotFound"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## POST /recipient/verifyPaymentGuarantee

> Verify a payment certificate

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"servers":[{"url":"https://develop.4mica.xyz"}],"paths":{"/recipient/verifyPaymentGuarantee":{"post":{"summary":"Verify a payment certificate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"Verification result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse_PaymentVerificationResult"}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]},"JsonRpcResponse_PaymentVerificationResult":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/PaymentVerificationResult"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"PaymentVerificationResult":{"type":"object","oneOf":[{"type":"object","properties":{"result":{"type":"string","enum":["Verified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["AlreadyVerified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["InvalidCertificate"]}}}]},"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```


# Models

## The JsonRpcRequest object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":"array"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"required":["jsonrpc","method","id"]}}}}
```

## The JsonRpcError object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_CorePublicParameters object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_CorePublicParameters":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/CorePublicParameters"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"CorePublicParameters":{"type":"object","properties":{"public_key":{"type":"array","items":{"type":"integer"}}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_UserInfo object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_UserInfo":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"oneOf":[{"$ref":"#/components/schemas/UserInfo"},{"type":"null"}]},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"UserInfo":{"type":"object","properties":{"deposit":{"type":"number"},"available_deposit":{"type":"number"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/UserTransactionInfo"}}}},"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_PaymentCertificate object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_PaymentCertificate":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/PaymentCertificate"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_ArrayOfUserTransactionInfo object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_ArrayOfUserTransactionInfo":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"type":"array","items":{"$ref":"#/components/schemas/UserTransactionInfo"}},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_TransactionVerificationResult object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_TransactionVerificationResult":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/TransactionVerificationResult"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"TransactionVerificationResult":{"type":"string","enum":["Verified","AlreadyVerified","NotFound"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_PaymentVerificationResult object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_PaymentVerificationResult":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"$ref":"#/components/schemas/PaymentVerificationResult"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"PaymentVerificationResult":{"type":"object","oneOf":[{"type":"object","properties":{"result":{"type":"string","enum":["Verified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["AlreadyVerified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["InvalidCertificate"]}}}]},"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The JsonRpcResponse\_Null object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"JsonRpcResponse_Null":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"type":"null"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"JsonRpcError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"string"}},"required":["code","message"]}}}}
```

## The CorePublicParameters object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"CorePublicParameters":{"type":"object","properties":{"public_key":{"type":"array","items":{"type":"integer"}}}}}}}
```

## The UserTransactionInfo object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}}}}}
```

## The UserInfo object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"UserInfo":{"type":"object","properties":{"deposit":{"type":"number"},"available_deposit":{"type":"number"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/UserTransactionInfo"}}}},"UserTransactionInfo":{"type":"object","properties":{"user_addr":{"type":"string"},"recipient_addr":{"type":"string"},"tx_hash":{"type":"string"},"amount":{"type":"number"},"verified":{"type":"boolean"},"finalized":{"type":"boolean"},"failed":{"type":"boolean"},"cert":{"type":"string","nullable":true},"created_at":{"type":"integer"}}}}}}
```

## The PaymentCertificate object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]}}}}
```

## The PaymentVerificationResult object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"PaymentVerificationResult":{"type":"object","oneOf":[{"type":"object","properties":{"result":{"type":"string","enum":["Verified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["AlreadyVerified"]},"claims":{"$ref":"#/components/schemas/PaymentCertificate"}}},{"type":"object","properties":{"result":{"type":"string","enum":["InvalidCertificate"]}}}]},"PaymentCertificate":{"type":"object","properties":{"claims":{"type":"string","description":"Hex-encoded JSON claims"},"signature":{"type":"string","description":"Hex-encoded BLS signature"}},"required":["claims","signature"]}}}}
```

## The TransactionVerificationResult object

```json
{"openapi":"3.0.3","info":{"title":"4mica Services JSON-RPC API","version":"0.1.0-prealpha"},"components":{"schemas":{"TransactionVerificationResult":{"type":"string","enum":["Verified","AlreadyVerified","NotFound"]}}}}
```


