### Establish Secure gRPC Connection in Go Source: https://docs.mpcvault.com/api/getting-started Provides an example of setting up a secure gRPC connection in GoLang using TLS credentials. This code snippet includes error handling for credential creation and server connection. ```go package main import ( "log" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) func main() { creds, err := credentials.NewClientTLSFromCert(nil, "") if err != nil { log.Fatalf("Failed to create TLS credentials: %v", err) } conn, err := grpc.Dial("api.mpcvault.com:443", grpc.WithTransportCredentials(creds)) if err != nil { log.Fatalf("Failed to connect to server: %v", err) } defer conn.Close() // Use the "conn" variable for further grpc calls } ``` -------------------------------- ### gRPC Endpoint and Connection Source: https://docs.mpcvault.com/api/getting-started Details on how to connect to the MPCVault gRPC API endpoint, including necessary security configurations. ```APIDOC ## gRPC Endpoint and Connection ### Description This section details how to establish a secure connection to the MPCVault gRPC API endpoint. ### Endpoint `api.mpcvault.com:443` ### Method gRPC ### Authentication Attach `x-mtoken: {Your API Token}` to all gRPC requests. ### TLS Enforcement All API requests must use gRPC transport credentials with TLS >= 1.2. ### Request Example (Python) ```python import grpc channel = grpc.secure_channel('api.mpcvault.com:443', grpc.ssl_channel_credentials()) # Use the 'channel' variable for further gRPC calls ``` ### Request Example (GoLang) ```go package main import ( "log" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) func main() { creds, err := credentials.NewClientTLSFromCert(nil, "") if err != nil { log.Fatalf("Failed to create TLS credentials: %v", err) } conn, err := grpc.Dial("api.mpcvault.com:443", grpc.WithTransportCredentials(creds)) if err != nil { log.Fatalf("Failed to connect to server: %v", err) } defer conn.Close() // Use the "conn" variable for further grpc calls } ``` ``` -------------------------------- ### Idempotency Header Source: https://docs.mpcvault.com/api/getting-started To make a request idempotent, include the `idempotency-key` header with a unique value (e.g., a V4 UUID). ```APIDOC ## Idempotency Header ### Description Include the `idempotency-key` header to ensure that repeated requests for the same operation have the same effect as a single request. ### Method Any method that supports idempotency (will be labeled as such). ### Endpoint Any applicable endpoint. ### Parameters #### Request Headers - **idempotency-key** (string) - Required - A unique value generated by the client (e.g., V4 UUID) to identify the request. Maximum 255 characters. ### Request Example ``` { "headers": { "idempotency-key": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } } ``` ### Response #### Success Response (200 or other success code) - The response will reflect the result of the first successful execution of the request associated with the given `idempotency-key`. #### Response Example ``` { "status": "success", "message": "Operation completed successfully." } ``` ``` -------------------------------- ### MPCVault API Overview Source: https://docs.mpcvault.com/api/getting-started The MPCVault Platform API is built on gRPC for high performance and efficiency, with an optional REST API for conventional integration. It supports secure communication via TLS and token-based authentication. ```APIDOC ## MPCVault API Overview ### Description The MPCVault Platform API offers both gRPC and REST interfaces. The gRPC API provides high-performance, efficient communication, while the REST API offers a conventional integration method. ### Supported Protocols - gRPC - REST ### Authentication - gRPC Header Authentication: `x-mtoken: {Your API Token}` ### Security - TLS enforcement (>= 1.2) is mandatory for all API requests. - IP Restriction: Configure allowed IP origins via CIDR notation for enhanced security. ### Key Features - Wallet generation and management. - Transaction signing using ECDSA and EdDSA. - Public key retrieval for specific transaction construction. - Sanity testing encouraged via outgoing transactions or message signing. ``` -------------------------------- ### Establish Secure gRPC Connection in Python Source: https://docs.mpcvault.com/api/getting-started Demonstrates how to establish a secure gRPC connection using TLS credentials in Python. This is essential for making authenticated API requests to the MPCVault server. ```python channel = grpc.secure_channel('api.mpcvault.com:443', grpc.ssl_channel_credentials()) ``` -------------------------------- ### POST /v1/getSigningRequestList Response Example Source: https://docs.mpcvault.com/api/api-reference/REST/getSigningRequestList An example JSON response from the POST /v1/getSigningRequestList endpoint, showing the structure for signing requests and potential errors. ```json { "signingRequests": [], "error": null } ``` -------------------------------- ### Get Wallet List Response Example (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/getWalletList An example JSON response from the POST /v1/getWalletList endpoint. It contains a list of wallet details (address, name, status) and an error field. ```json { "detailsList": [ { "address": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "name": "test wallet", "status": "STATUS_ACTIVE" } ], "error": null } ``` -------------------------------- ### Example Public Key Format Source: https://docs.mpcvault.com/api/client-signer Illustrates the expected format of the generated ed25519 public key. This public key content will be used when configuring the client signer in MPCVault. ```text ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q [key_name] ``` -------------------------------- ### Get Wallet List Request Example (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/getWalletList An example JSON payload for the POST /v1/getWalletList request. It specifies the vault UUID, page number, and the number of wallets to retrieve. ```json { "vaultUuid": "12789f5ee5fb-07f5-470c-a2ff-081e2d6d107a", "page": 1, "limit": 100 } ``` -------------------------------- ### Resimulation API Response Example Source: https://docs.mpcvault.com/api/api-reference/REST/resimulation This example demonstrates a successful response from the POST /v1/resimulation endpoint. It includes the `simulation` data as a base64 encoded string and an optional `error` field. ```json { "simulation": "eyJtZXNzYWdlcyI6W3siYWRkcmVzcyI6IkVRRC1IR09CYlh4dzNQWWQ4SzM5TXN3SlZYN1lvb19oM1FTRWl1cFdFUXA2dWlOVSIsImFtb3VudCI6IjE5MDAwMDAwMCIsInBheWxvYWQiOiJ0ZTZjY2tFQkFnRUFwZ0FCckErS2ZxVUFBQUJUVVpIL0ZpQStpQUR2TzVrQ29uR3lvQnlKT0tVanorSk9jWVI2cnJhbUlBQWUxRXAzckE1d25RQWhCUlhOT04yMUFHa1NqN0hVaUJ5N0F2UHBwYmVialh2NWl0Z1h3VnpzSE1nTzVyS0JBUUNWSlpPRllZQUNLaGFqRmt4TldxTVRQekVRL3hCSmJnREtpc2lyNy94UUorQWswelNBdytZRWllc0FJUVVWelRqZHRRQnBFbyt4MUlnY3V3THo2YVczbTQxNytZcllGOEZjN0J6UUZKNjVtZz09In1dLCJ2YWxpZF91bnRpbCI6MTcyMjQ3NzQ3MDU4MiwiZnJvbSI6IjA6eDg0MTQ1NzM0RTM3NkQ0MDFBNDRBM0VDNzUyMjA3MkVDMEJDRkE2OTZERTZFMzVFRkU2MkI2MDVGMDU3M0IwNzMiLCJuZXR3b3JrIjoiLTIzOSJ9", "error": null } ``` -------------------------------- ### Create Wallet Response Example (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/createWallet This example shows a typical response from the createWallet endpoint, indicating either the successful creation of a wallet with its details or an error message if the creation failed. ```json { "details": {}, "error": {} } ``` -------------------------------- ### Create Wallet Request Example (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/createWallet This example demonstrates the JSON payload required to create a new wallet using the createWallet endpoint. It includes essential fields like vaultUuid, callbackClientSignerPublicKey, networkType, and optional fields like ref and name. ```json { "vaultUuid": "12789f5ee5fb-07f5-470c-a2ff-081e2d6d107a", "callbackClientSignerPublicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL3OzFAKNGHsMtBpTemiAI3V1AxRsdeghjcmkidagdk test", "networkType": 1, "ref": "0x4321567890abcdef4321567890abcdef123456", "name": "test wallet" } ``` -------------------------------- ### POST /v1/getSigningRequestList Request Example Source: https://docs.mpcvault.com/api/api-reference/REST/getSigningRequestList An example JSON payload for the POST /v1/getSigningRequestList request. This includes vault UUID, page number, limit, and sort order. ```json { "vaultUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a", "page": 1, "limit": 10, "sortOrder": 0 } ``` -------------------------------- ### Create Batch Payment Response (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/createBatchPayment Example JSON response structure for the createBatchPayment API call, indicating either a successful batch payment creation or an error. ```json { "batchPayment": { "name": "Monthly payroll", "notes": "Monthly payroll", "evmBatchSendNative": { "chainId": 137, "from": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "recipients": [{"address": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "amount": 0.001, "notes": "Monthly payroll"}] } }, "error": null } ``` ```json { "batchPayment": null, "error": { "code": "INVALID_ADDRESS", "message": "The provided sender address is invalid." } } ``` -------------------------------- ### Ethereum zk-Rollups Example: Batching Transactions Source: https://docs.mpcvault.com/blog/tags/layer-2 zk-Rollups bundle multiple transactions off-chain and submit a single proof to the main blockchain. This dramatically reduces gas fees and ensures swift transactions by verifying correctness without revealing private data. Examples include zkSync and Hermez. ```plaintext Off-chain Transactions: Tx1, Tx2, Tx3, ..., TxN Batching: Group N transactions into one batch. Proof Generation: Create a validity proof (e.g., SNARK) for the batch. On-chain Submission: Submit the proof and compressed transaction data to Layer 1. ``` -------------------------------- ### Get Signing Request Details (PlatformAPI) Source: https://docs.mpcvault.com/api/api-reference/REST/getSigningRequestDetails Retrieves the details of a signing request, including its status and transaction hash upon completion. Requires a UUID as input. ```http POST /v1/getSigningRequestDetails { "uuid": "bb6f129f-bbe3-4d95-9f33-c32812e3e1c4" } ``` -------------------------------- ### Create Batch Payment Request (JSON) Source: https://docs.mpcvault.com/api/api-reference/REST/createBatchPayment Example JSON payload for creating a batch payment using the PlatformAPI. This includes details like the batch payment name, notes, transaction type (EVM native send), chain ID, sender address, and a list of recipients with their addresses, amounts, and notes. ```json { "name": "Monthly payroll", "notes": "Monthly payroll", "evmBatchSendNative": { "chainId": 137, "from": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "recipients": [{"address": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "amount": 0.001, "notes": "Monthly payroll"}] } } ``` -------------------------------- ### POST /v1/getSigningRequestDetails Source: https://docs.mpcvault.com/api/api-reference/REST/getSigningRequestDetails Retrieves the details of a signing request, including its status and transaction hash if completed. ```APIDOC ## POST /v1/getSigningRequestDetails ### Description GetSigningRequestDetails returns the details of a signing request. It will contain the signing request status and the transaction hash if the signing request was completed. ### Method POST ### Endpoint /v1/getSigningRequestDetails ### Parameters #### Request Body - **uuid** (string) - Required - The unique identifier of the signing request. ### Request Example ```json { "uuid": "bb6f129f-bbe3-4d95-9f33-c32812e3e1c4" } ``` ### Response #### Success Response (200) - **signingRequest** (object) - Contains signing request details. - **error** (object) - Contains error information if the request failed. #### Response Example ```json { "signingRequest": {}, "error": {} } ``` ``` -------------------------------- ### Generate ed25519 Key Pair using ssh-keygen Source: https://docs.mpcvault.com/api/client-signer Generates an ed25519 key pair locally using the ssh-keygen command. This is the first step in setting up a client signer for MPCVault. Ensure to replace '[key_name]' with your desired key name and do not set a password. ```bash ssh-keygen -t ed25519 -C "[key_name]" ``` -------------------------------- ### Bitcoin State Channels Example: Lightning Network Source: https://docs.mpcvault.com/blog/tags/layer-2 State Channels, like Bitcoin's Lightning Network, enable multiple transactions off-chain between participants. Only the opening and closing of the channel are recorded on the main blockchain, facilitating near-instant, low-fee transactions. ```plaintext Open Channel: Participants lock funds on Layer 1 to establish a multi-signature address. Off-chain Transactions: Participants exchange signed commitment transactions updating the channel state. Close Channel: The final channel state is broadcast to Layer 1 for settlement. ``` -------------------------------- ### Ethereum Plasma Chains Example: OMG Network Source: https://docs.mpcvault.com/blog/tags/layer-2 Plasma chains are child blockchains on Ethereum that execute transactions off-chain and submit condensed proofs back to the main Ethereum network. This enhances scalability for payment processing, as seen with the OMG Network. ```plaintext Parent Chain (L1): Ethereum. Child Chain (Plasma): A separate blockchain for transactions. Transaction Execution: Process transactions on the Plasma chain. Proof Submission: Submit Merkle roots or proofs of transaction batches to the parent chain. ``` -------------------------------- ### Secret Sharing: Collective Computation of Sum Source: https://docs.mpcvault.com/blog/secure-multiparty-computation Demonstrates the Secret Sharing method where inputs are split among multiple parties. It shows how parties can compute a sum locally and then collectively combine these local computations to get the final result without any party knowing the original inputs. ```mathematics Let x and y be private inputs. Distribute x into x_1, x_2, ..., x_n such that x = x_1 + x_2 + ... + x_n Distribute y into y_1, y_2, ..., y_n such that y = y_1 + y_2 + ... + y_n Party i computes z_i = x_i + y_i locally. Collectively, they compute z = z_1 + z_2 + ... + z_n. Therefore, z = (x_1 + y_1) + (x_2 + y_2) + ... + (x_n + y_n) = (x_1 + ... + x_n) + (y_1 + ... + y_n) = x + y. ``` -------------------------------- ### Homomorphic Encryption Example: RSA Product Calculation Source: https://docs.mpcvault.com/blog/tags/mpc Illustrates a secure multiparty computation scenario using unpadded RSA homomorphic encryption. Three parties (Alice, Bob, Charlie) collectively compute the product of their secret numbers without revealing them. This involves encryption, multiplication, and decryption steps handled by designated parties (Sarah, Nancy). ```pseudocode 1. Sarah generates RSA key pair (private, public) and shares the encryption function (enc) with Alice, Bob, Charlie. 2. Alice computes a' = enc(a), Bob computes b' = enc(b), Charlie computes c' = enc(c). They send a', b', c' to Nancy. 3. Nancy computes d' = a' * b' * c' and sends d' to Sarah. 4. Sarah computes d = dec(d') and sends d to Alice, Bob, Charlie. ``` -------------------------------- ### POST /v1/resimulation Source: https://docs.mpcvault.com/api/api-reference/REST/resimulation Simulates a transaction for a given signing request and returns the transaction simulation details. ```APIDOC ## POST /v1/resimulation ### Description Resimulation returns the transaction simulation for a given signing request. ### Method POST ### Endpoint /v1/resimulation ### Parameters #### Request Body - **signingRequestUuid** (string) - Required - The UUID of the signing request to be simulated. ### Request Example ```json { "signingRequestUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a" } ``` ### Response #### Success Response (200) - **simulation** (bytes) - The simulation of the signing request. - **error** (Error) - An error object if the simulation fails. #### Response Example ```json { "simulation": "eyJtZXNzYWdlcyI6W3siYWRkcmVzcyI6IkVRRC1IR09CYlh4dzNQWWQ4SzM5TXN3SlZYN1lvb19oM1FTRWl1cFdFUXA2dWlOVSIsImFtb3VudCI6IjE5MDAwMDAwMCIsInBheWxvYWQiOiJ0ZTZjY2tFQkFnRUFwZ0FCckErS2ZxVUFBQUJUVVpIL0ZpQStpQUR2TzVrQ29uR3lvQnlKT0tVanorSk9jWVI2cnJhbUlBQWUxRXAzckE1d25RQWhCUlhOT04yMUFHa1NqN0hVaUJ5N0F2UHBwYmVialh2NWl0Z1h3VnpzSE1nTzVyS0JBUUNWSlpPRllZQUNLaGFqRmt4TldxTVRQekVRL3hCSmJnREtpc2lyNy94UUorQWswelNBdytZRWllc0FJUVVWelRqZHRRQnBFbyt4MUlnY3V3THo2YVczbTQxNytZcllGOEZjN0J6UUZKNjVtZz09In1dLCJ2YWxpZF91bnRpbCI6MTcyMjQ3NzQ3MDU4MiwiZnJvbSI6IjA6eDg0MTQ1NzM0RTM3NkQ0MDFBNDRBM0VDNzUyMjA3MkVDMEJDRkE2OTZERTZFMzVFRkU2MkI2MDVGMDU3M0IwNzMiLCJuZXR3b3JrIjoiLTIzOSJ9", "error": null } ``` ``` -------------------------------- ### AptosSendNative Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send native Aptos tokens (APT) with specified gas parameters. ```APIDOC ## POST /websites/mpcvault/AptosSendNative ### Description Sends native Aptos tokens (APT) from a specified sender address to a recipient address. Supports custom gas fee configuration. ### Method POST ### Endpoint /websites/mpcvault/AptosSendNative ### Parameters #### Request Body - **chain_id** (uint64) - Required - Use 1 for mainnet. MPCVault does not support Aptos testnet at the moment. - **from** (string) - Required - The sender wallet address. It must be within the vault. - **to** (string) - Required - The recipient address. - **value** (string) - Required - The amount of the native token to send, denominated in octa. - **gas_fee** (mpcvault.platform.v1.AptosGas) - Optional - Specifies the gas fee for the transaction. ``` -------------------------------- ### POST /websites/mpcvault/GetSigningRequestList Source: https://docs.mpcvault.com/api/api-reference/gRPC/GetSigningRequestList Retrieves signing requests, including their status and transaction hash if completed. Supports pagination and sorting. ```APIDOC ## POST /websites/mpcvault/GetSigningRequestList ### Description GetSigningRequestList returns the signing requests details. It will contain the signing request status and the transaction hash if the signing request was completed. ### Method POST ### Endpoint /websites/mpcvault/GetSigningRequestList ### Parameters #### Request Body - **vault_uuid** (string) - Required - The UUID of the vault. - **page** (uint64) - Optional - The page number to retrieve. Defaults to 0. - **page_size** (uint64) - Optional - The number of items per page. Defaults to 10, max to 100. - **sort_order** (mpcvault.platform.v1.GetSigningRequestListRequest.SortOrder) - Optional - The order in which to sort the results. ### Request Example ```json { "vault_uuid": "your-vault-uuid", "page": 0, "page_size": 10, "sort_order": "SORT_ORDER_DESC" } ``` ### Response #### Success Response (200) - **signing_request** (mpcvault.platform.v1.GetSigningRequestListResponse.SigningRequest) - A list of signing requests. #### Error Response - **error** (mpcvault.platform.v1.Error) - Details about the error. ### Enum: mpcvault.platform.v1.GetSigningRequestListRequest.SortOrder - **0** (SORT_ORDER_DESC) - Sort in descending order. - **1** (SORT_ORDER_ASC) - Sort in ascending order. ``` -------------------------------- ### AptosSendCustom Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send custom transactions on Aptos with optional gas fee configuration. ```APIDOC ## POST /websites/mpcvault/AptosSendCustom ### Description Sends custom transactions on the Aptos blockchain, which can include JSON payloads or BCS-serialized bytes. Supports custom gas fee configuration. ### Method POST ### Endpoint /websites/mpcvault/AptosSendCustom ### Parameters #### Request Body - **chain_id** (uint64) - Required - Use 1 for mainnet. MPCVault does not support Aptos testnet at the moment. - **from** (string) - Required - The sender wallet address. It must be within the vault. - **payload** (bytes) - Required - The transaction payload, which can be JSON or BCS-serialized bytes. - **gas_fee** (mpcvault.platform.v1.AptosGas) - Optional - Specifies the gas fee for the transaction. ``` -------------------------------- ### Homomorphic Multiplication Example Source: https://docs.mpcvault.com/blog/homomorphic-encryption Shows how the multiplication operation is preserved under encryption and decryption for the partially homomorphic scheme described. ```text f(enc(x1),enc(x2),enc(x3)) = f(x1^e mod n, x2^e mod n, x3^e mod n) = (x1^e * x2^e * x3^e) mod n = (x1*x2*x3)^e mod n = enc(f(x1,x2,x3)) ``` -------------------------------- ### BTCBatchSendNative Details Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateBatchPayment Details for creating a Bitcoin batch payment for native BTC transfers. ```APIDOC ### msg mpcvault.platform.v1.BTCBatchSendNative #### Parameters - **from** (string) - Required - The sender wallet address. Must be within the vault. - **recipients** (array of mpcvault.platform.v1.BatchPaymentRecipient) - Required - A list of recipients and amounts. ``` -------------------------------- ### POST /v1/getSigningRequestList Source: https://docs.mpcvault.com/api/api-reference/REST/getSigningRequestList Retrieves a list of signing requests for a given vault. Includes details such as status and transaction hash. ```APIDOC ## POST /v1/getSigningRequestList ### Description Retrieves a list of signing requests for a given vault. Includes details such as status and transaction hash. ### Method POST ### Endpoint /v1/getSigningRequestList ### Parameters #### Request Body - **vaultUuid** (string) - Required - The UUID of the vault that the signingRequest was created in. - **page** (integer) - Required - The page number. - **limit** (integer) - Required - The number of signingRequests to return. - **sortOrder** (integer) - Required - The order of the signing requests (0 for desc, 1 for asc). ### Request Example ```json { "vaultUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a", "page": 1, "limit": 10, "sortOrder": 0 } ``` ### Response #### Success Response (200) - **signingRequests** (array of SigningRequest) - A list of signing requests. - **error** (Error) - An error object if the request failed. #### Response Example ```json { "signingRequests": [ { "status": "completed", "transactionHash": "0xabc123..." } ], "error": null } ``` ``` -------------------------------- ### SuiSendCustom Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send custom transactions on Sui. ```APIDOC ## POST /websites/mpcvault/SuiSendCustom ### Description Sends custom transactions on the Sui blockchain, which can include JSON payloads or BCS-serialized bytes. ### Method POST ### Endpoint /websites/mpcvault/SuiSendCustom ### Parameters #### Request Body - **from** (string) - Required - The sender wallet address. It must be within the vault. - **payload** (bytes) - Required - The transaction payload, which can be JSON or BCS-serialized bytes. ``` -------------------------------- ### POST /v1/createBatchPayment Source: https://docs.mpcvault.com/api/api-reference/REST/createBatchPayment Creates a batch payment. The batch payment creation needs to be completed using the MPCVault web app. ```APIDOC ## POST /v1/createBatchPayment ### Description Creates a batch payment. You will need to complete the batch payment using the MPCVault web app. ### Method POST ### Endpoint /v1/createBatchPayment ### Parameters #### Request Body - **name** (string) - Required - The name of the batch payment. - **notes** (string) - Optional - The transaction notes for the batch payment. - **evmBatchSendNative** (object) - Required - Details for EVM native currency batch sends. - **chainId** (uint64) - Required - The chain ID of the transaction. - **from** (string) - Required - The sender wallet address. Must be within this vault. - **recipients** (array) - Required - The list of recipients. - **address** (string) - Required - The recipient's address. - **amount** (string) - Required - The amount to send. - **notes** (string) - Optional - Notes for the specific recipient. - **evmBatchSendErc20** (object) - Required - Details for EVM ERC20 token batch sends. - **btcBatchSendNative** (object) - Required - Details for BTC native currency batch sends. - **uiBatchSendNative** (object) - Required - Details for UI native currency batch sends. - **uiBatchSendCoin** (object) - Required - Details for UI coin batch sends. ### Request Example ```json { "name": "Monthly payroll", "notes": "Monthly payroll", "evmBatchSendNative": { "chainId": 137, "from": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "recipients": [ { "address": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F", "amount": "0.001", "notes": "Monthly payroll" } ] } } ``` ### Response #### Success Response (200) - **batchPayment** (object) - Details of the created batch payment. - **error** (object) - Error details if the creation failed. #### Response Example ```json { "batchPayment": {}, "error": {} } ``` ``` -------------------------------- ### Get Balance Endpoint (PlatformAPI) Source: https://docs.mpcvault.com/api/api-reference/REST/getBalance Retrieves the asset balance for a given wallet address and token. Supports various network types. The balance is returned in the smallest denomination. ```JSON { "networkType": 1, "chainId": null, "walletAddress": "8HrKVJeFNGSJ2T2wSU6MxfMvua2MYgwH1FbRsdfrgthj", "tokenAddress": "0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F" } ``` ```JSON { "balance": "0.12128", "error": null } ``` -------------------------------- ### Partially Homomorphic Encryption (Multiplication) Source: https://docs.mpcvault.com/blog/homomorphic-encryption Presents a specific example of a partially homomorphic encryption scheme that supports multiplication. It defines the encryption and decryption functions using modular exponentiation, similar to RSA. ```text enc(x) = x^e mod n dec(x) = x^d mod n ``` -------------------------------- ### Create SUI Native Batch Payment Request Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateBatchPayment Defines the structure for creating a batch payment for native SUI tokens. Requires sender address and recipient addresses with amounts. ```protobuf message CreateBatchPaymentRequest { string name = 1; google.protobuf.StringValue notes = 2; oneof type { EVMBatchSendNative evm_batch_send_native = 10; EVMBatchSendERC20 evm_batch_send_erc20 = 11; BTCBatchSendNative btc_batch_send_native = 12; SUIBatchSendNative sui_batch_send_native = 13; SUIBatchSendCoin sui_batch_send_coin = 14; } } message SUIBatchSendNative { string from = 1; repeated BatchPaymentRecipient recipients = 2; } message BatchPaymentRecipient { string address = 1; string amount = 2; google.protobuf.StringValue notes = 3; } ``` -------------------------------- ### Differential Privacy Noise Addition Example Source: https://docs.mpcvault.com/blog/tags/cryptography Illustrates how differential privacy can be applied by adding noise to inputs, parameters, or results of a function 'f'. This technique is used to protect individual data points in a collective computation. ```latex y = f_{\theta}(x_1, x_2, ..., x_n) # Adding noise to input: y = f_{\theta}(x_1+r_1, x_2+r_2, ..., x_n+r_n) # Adding noise to the parameter: y = f_{\theta+r_{\theta}}(x_1, x_2, ..., x_n) # Adding noise to the result: y = f_{\theta}(x_1, x_2, ..., x_n) + r ``` -------------------------------- ### Create EVM Native Batch Payment Request Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateBatchPayment Defines the structure for creating a batch payment for native EVM tokens (like ETH). Requires sender address, recipient addresses, and amounts, denominated in Wei. ```protobuf message CreateBatchPaymentRequest { string name = 1; google.protobuf.StringValue notes = 2; oneof type { EVMBatchSendNative evm_batch_send_native = 10; EVMBatchSendERC20 evm_batch_send_erc20 = 11; BTCBatchSendNative btc_batch_send_native = 12; SUIBatchSendNative sui_batch_send_native = 13; SUIBatchSendCoin sui_batch_send_coin = 14; } } message EVMBatchSendNative { uint64 chain_id = 1; string from = 2; repeated BatchPaymentRecipient recipients = 3; } message BatchPaymentRecipient { string address = 1; string amount = 2; google.protobuf.StringValue notes = 3; } ``` -------------------------------- ### Sidechains Example: Liquid Network Source: https://docs.mpcvault.com/blog/tags/layer-2 Sidechains are independent blockchains that run parallel to a main chain, connected via a two-way peg. They have their own consensus mechanisms and can offer different features, such as faster transactions. The Liquid Network is a sidechain for Bitcoin. ```plaintext Asset Pegging: Lock assets on the main chain to receive equivalent pegged assets on the sidechain. Sidechain Operations: Conduct transactions on the sidechain using its consensus mechanism. Asset Unpegging: Burn pegged assets on the sidechain to release original assets on the main chain. ``` -------------------------------- ### SuiSendCoin Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send specific Sui coin types with optional gas fee configuration. ```APIDOC ## POST /websites/mpcvault/SuiSendCoin ### Description Sends a specific Sui coin type from a sender address to a recipient address. Supports custom gas fee configuration. ### Method POST ### Endpoint /websites/mpcvault/SuiSendCoin ### Parameters #### Request Body - **from** (string) - Required - The sender wallet address. It must be within the vault. - **to** (string) - Required - The recipient address. - **coin_tag** (string) - Required - Identifies the coin to be sent. - **amount** (string) - Required - The amount of coins to send. Use whole integer representation [amount * 10^decimals]. - **gas_fee** (mpcvault.platform.v1.SuiGas) - Optional - Specifies the gas fee for the transaction. ``` -------------------------------- ### Unpadded RSA Homomorphic Encryption Example Source: https://docs.mpcvault.com/blog/tags/mpc This snippet illustrates a partially homomorphic encryption scheme using unpadded RSA for multiplication. It shows how the encryption and decryption functions work for a function composed solely of multiplications, demonstrating the homomorphic property. ```mathematics enc(x) = x^e mod n dec(x) = x^d mod n // For f(x1, x2, x3) = x1 * x2 * x3 f(enc(x1), enc(x2), enc(x3)) = f(x1^e mod n, x2^e mod n, x3^e mod n) = (x1^e mod n) * (x2^e mod n) * (x3^e mod n) = x1^e * x2^e * x3^e mod n = (x1 * x2 * x3)^e mod n = f(x1, x2, x3)^e mod n = enc(f(x1, x2, x3)) dec(f(enc(x1), enc(x2), enc(x3))) = dec(f(x1, x2, x3)^e mod n) = (f(x1, x2, x3)^e mod n)^d mod n = (f(x1, x2, x3)^e)^d mod n = f(x1, x2, x3) mod n ``` -------------------------------- ### EVMBatchSendERC20 Details Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateBatchPayment Details for creating an EVM batch payment for ERC20 tokens. ```APIDOC ### msg mpcvault.platform.v1.EVMBatchSendERC20 #### Parameters - **chain_id** (uint64) - Required - The ID of the EVM-compatible chain. - **from** (string) - Required - The sender wallet address. Must be within the vault. - **token_contract_address** (string) - Required - The contract address of the ERC20 token. - **recipients** (array of mpcvault.platform.v1.BatchPaymentRecipient) - Required - A list of recipients and amounts. ``` -------------------------------- ### Aptos Message Types Source: https://docs.mpcvault.com/api/api-reference/REST/createSigningRequest Enumeration of message types for Aptos. Supports unspecified and default message types. ```go package main type AptosMessage_Type int const ( AptosMessage_TYPE_UNSPECIFIED AptosMessage_Type = 0 AptosMessage_TYPE_DEFAULT AptosMessage_Type = 1 ) ``` -------------------------------- ### AptosSendCoin Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send specific Aptos coin types with optional gas fee configuration. ```APIDOC ## POST /websites/mpcvault/AptosSendCoin ### Description Sends a specific Aptos coin type from a sender address to a recipient address. Supports custom gas fee configuration. ### Method POST ### Endpoint /websites/mpcvault/AptosSendCoin ### Parameters #### Request Body - **chain_id** (uint64) - Required - Use 1 for mainnet. MPCVault does not support Aptos testnet at the moment. - **from** (string) - Required - The sender wallet address. It must be within the vault. - **to** (string) - Required - The recipient address. - **coin_tag** (string) - Required - Identifies the coin to be sent. - **amount** (string) - Required - The amount of tokens to send. Use whole integer representation [amount * 10^decimals]. - **gas_fee** (mpcvault.platform.v1.AptosGas) - Optional - Specifies the gas fee for the transaction. ``` -------------------------------- ### Ethereum Optimistic Rollups Example: Transaction Assumption Source: https://docs.mpcvault.com/blog/tags/layer-2 Optimistic Rollups assume transactions are valid by default, optimizing for speed. If a transaction is challenged as invalid, a fraud proof is submitted, and the invalid transaction is reverted. Platforms like Optimism and Arbitrum use this approach. ```plaintext Off-chain Transactions: Tx1, Tx2, ..., TxN Batching: Group N transactions. On-chain Submission: Submit the batch to Layer 1 with an assumption of validity. Challenge Period: A time window for users to submit fraud proofs. Fraud Proof Verification: If challenged, verify the proof and revert invalid state changes. ``` -------------------------------- ### SuiSendNative Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send native Sui tokens (SUI) with optional gas fee configuration. ```APIDOC ## POST /websites/mpcvault/SuiSendNative ### Description Sends native Sui tokens (SUI) from a specified sender address to a recipient address. Supports custom gas fee configuration. ### Method POST ### Endpoint /websites/mpcvault/SuiSendNative ### Parameters #### Request Body - **from** (string) - Required - The sender wallet address. It must be within the vault. - **to** (string) - Required - The recipient address. - **value** (string) - Required - The amount of the native token to send, denominated in mist. - **gas_fee** (mpcvault.platform.v1.SuiGas) - Optional - Specifies the gas fee for the transaction. ``` -------------------------------- ### POST /websites/mpcvault/CreateWallet Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateWallet Creates a new End-of-Account (EOA) wallet. The response includes the public key and the official wallet address. It's recommended to use the address from the response. ```APIDOC ## POST /websites/mpcvault/CreateWallet ### Description Creates a new End-of-Account (EOA) wallet. The response includes the public key and the official wallet address. It's recommended to use the address from the response. ### Method POST ### Endpoint /websites/mpcvault/CreateWallet ### Parameters #### Request Body - **vault_uuid** (string) - Required - The UUID of the vault where the wallet will be created. - **callback_client_signer_public_key** (string) - Required - The public key of the API client signer, used for callbacks. - **network_type** (mpcvault.platform.v1.NetworkType) - Required - The type of the network (e.g., EVM, BITCOIN). - **ref** (string) - Optional - A unique customer reference field for the wallet (max 500 characters). - **name** (string) - Optional - A name for the wallet (max 85 characters). ### Request Example ```json { "vault_uuid": "your-vault-uuid", "callback_client_signer_public_key": "your-signer-public-key", "network_type": "NETWORK_TYPE_EVM", "ref": "optional-reference", "name": "My New Wallet" } ``` ### Response #### Success Response (200) - **details** (object) - Contains details about the created wallet, including public key and address. - **error** (mpcvault.platform.v1.Error) - If an error occurred during wallet creation. #### Response Example ```json { "details": { "public_key": "0x123...", "address": "0x456..." } } ``` ### Enum: mpcvault.platform.v1.NetworkType - **NETWORK_TYPE_UNKNOWN** - **NETWORK_TYPE_EVM** - **NETWORK_TYPE_BITCOIN** - **NETWORK_TYPE_TRON** - **NETWORK_TYPE_APTOS** - **NETWORK_TYPE_SUI** - **NETWORK_TYPE_SOLANA** - **NETWORK_TYPE_TON** ``` -------------------------------- ### SolanaSendSPLToken Source: https://docs.mpcvault.com/api/api-reference/gRPC/CreateSigningRequest Send SPL tokens on the Solana blockchain. ```APIDOC ## POST /websites/mpcvault/SolanaSendSPLToken ### Description Sends SPL tokens from a specified sender address to a recipient account on the Solana blockchain. ### Method POST ### Endpoint /websites/mpcvault/SolanaSendSPLToken ### Parameters #### Request Body - **from** (string) - Required - The sender wallet address. It must be within the vault. - **to** (string) - Required - The account address of the recipient. - **mint_address** (string) - Required - The address of the SPL token mint. - **amount** (string) - Required - The amount of tokens to send. Use whole integer representation [amount * 10^decimals]. ``` -------------------------------- ### POST /websites/mpcvault/GetWalletList Source: https://docs.mpcvault.com/api/api-reference/gRPC/GetWalletList Fetches a paginated list of wallets for a given vault. Users can specify the page number and the number of wallets to retrieve per page. ```APIDOC ## POST /websites/mpcvault/GetWalletList ### Description GetWalletList returns the wallets details. ### Method POST ### Endpoint /websites/mpcvault/GetWalletList ### Parameters #### Request Body - **vault_uuid** (string) - Required - The UUID of the vault that the wallet was created in. - **page** (google.protobuf.Int64Value) - Optional - The page number. default: 1 - **limit** (google.protobuf.Int64Value) - Optional - The number of wallets to return. default: 100, max: 1000 ### Request Example { "vault_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "page": 1, "limit": 10 } ### Response #### Success Response (200) - **details_list** - List of wallet details. - **error** (mpcvault.platform.v1.Error) - Error object if any. #### Response Example { "details_list": [ { "wallet_id": "wallet-1", "balance": "100.50" }, { "wallet_id": "wallet-2", "balance": "25.75" } ], "error": null } ```