LogoLogo
SupportGithubSign InGet Access
  • Introduction
  • GETTING STARTED
    • SDK Quick Start
    • API Quick Start
  • Guides
    • Web
      • Create a wallet
      • Send tokens
      • Sign a transaction
      • Simulate a transaction
      • Back up a wallet
      • Recover a wallet
      • Cross-device sessions
      • Manage wallet lifecycle states
      • Web authentication methods
      • Perform swaps
      • Add custom signature hooks
      • MPC progress callbacks
      • Portal API methods
      • Configure a custom subdomain
      • Eject a wallet
      • Using the EIP-1193 Provider
      • Legacy documentation
        • Back up a wallet
          • Backup Options
        • Recover a wallet
    • iOS
      • Create a wallet
      • Send tokens
      • Sign a transaction
      • Simulate a transaction
      • Back up a wallet
      • Recover a wallet
      • Cross-device sessions
      • Manage wallet lifecycle states
      • Connect with WalletConnect
      • Build a WebView
      • Perform swaps
      • Add custom signature hooks
      • MPC progress callbacks
      • Portal API methods
      • Manage ERC20 tokens
      • Eject a wallet
      • Legacy documentation
        • Back up a wallet
          • Backup Options
          • Passkey + Enclave Storage
        • Recover a wallet
      • Troubleshooting Tips
      • Feature Flags
    • Android
      • Create a wallet
      • Send tokens
      • Sign a transaction
      • Simulate a transaction
      • Back up a wallet
      • Recover a wallet
      • Cross-device sessions
      • Manage wallet lifecycle states
      • Connect with WalletConnect
      • Build a WebView
      • Perform swaps
      • Add custom signature hooks
      • MPC progress callbacks
      • Portal API methods
      • Eject a wallet
      • Legacy documentation
        • Back up a wallet
          • Backup Options
        • Recover a wallet
    • React Native
      • Create a wallet
      • Send tokens
      • Sign a transaction
      • Simulate a transaction
      • Back up a wallet
      • Recover a wallet
      • Cross-device sessions
      • Manage wallet lifecycle states
      • Connect with WalletConnect
      • Build a WebView
      • Perform swaps
      • Add custom signature hooks
      • MPC progress callbacks
      • Portal API methods
      • Eject a wallet
      • Legacy documentation
        • Back up a wallet
          • Backup Options
        • Recover a wallet
    • Enclave MPC API
      • Create a client
      • Create a wallet
      • Send tokens
      • Sign Ethereum transactions
      • Sign Solana transactions
      • Sign Tron transactions
      • Sign Stellar Transaction
      • Concurrent Transactions
      • Back up a wallet
      • Eject a wallet
  • Reference
    • iOS
      • createWallet
      • backupWallet
      • recoverWallet
      • ejectPrivateKeys
      • registerBackupMethod
      • setGDriveConfiguration
      • setPasskeyConfiguration
      • setPasskeyAuthenticationAnchor
      • setPassword
      • availableRecoveryMethods
      • doesWalletExist
      • isWalletBackedUp
      • isWalletOnDevice
      • isWalletRecoverable
      • getBalances
      • getAssets
      • getNftAssets
      • getTransactions
      • sendSol
      • evaluateTransaction
      • buildEip155Transaction
      • buildSolanaTransaction
      • getWalletCapabilities
    • Android
      • Reference Documentation
    • React Native
      • @portal-hq/core
      • Storage adapters
        • Cloud storage
          • @portal-hq/gdrive-storage
          • @portal-hq/icloud-storage
        • Mobile storage
          • @portal-hq/keychain
          • @portal-hq/mobile-key-values
    • Enclave MPC API
      • V1 endpoints
    • Client API
      • V3 endpoints
      • V1 endpoints
    • Custodian API
      • V3 endpoints
      • V1 endpoints
    • Swaps API
      • V3 endpoints
      • V1 endpoints
  • Resources
    • Flutter
      • iOS
      • Android
    • Error codes
      • Overview
      • Legacy Documentation
        • MPC errors
        • Network errors
        • General errors
        • Encryption errors
        • Portal Connect errors
    • Portal's MPC architecture
    • Authentication and API Keys
    • Self-Managed Backups
    • Alert Webhooks
    • Wallet lifecycle
    • Backup options
      • Password/PIN
      • GDrive
      • iCloud
      • Passkey + Enclave
    • WalletConnect metadata
    • Advanced security scanning
    • Account abstraction
    • Security firewall
    • Eject
    • Security
    • Blockchain support
    • Chain ID formatting
    • Testnet faucets
    • Going to Production
    • Rate Limits
    • Multi-backup migration guide
    • Multi-wallet migration guides
      • Migrating from Android SDK v3.x.x to v4.x.x
      • Migrating from iOS SDK v3.0.x to v3.2.x
  • Support
    • Changelog
      • Android
      • iOS
      • React Native
      • Web
      • Past Releases
        • 2024 Releases
        • 2023 Releases
    • Celo Hackathon Hub
    • Glossary
Powered by GitBook
On this page
  • Clients
  • Create the client's wallet
  • Send the client's assets
  • Sign a transaction or message by chain
  • Sign a transaction or message by curve
  • Back up the client's wallet
  • Recover the client's wallet

Was this helpful?

Edit on GitHub
  1. Reference
  2. Enclave MPC API

V1 endpoints

These endpoints require a Client API Key or Client Session Token (CST) as a bearer token.

PreviousEnclave MPC APINextClient API

Last updated 21 days ago

Was this helpful?

Clients

Create the client's wallet

POST https://mpc-client.portalhq.io/v1/generate

This endpoint generates MPC shares for both SECP256K1 (EVM, etc) and ED25519 (Solana, XRP, etc) curves (a Portal wallet).

After receiving MPC shares from this endpoint, be sure to verify the shares with before attempting to sign.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Body Parameters

You can leave the request body empty.

{}

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/generate \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{}'

Example Response

{
  "SECP256K1": {
    "share": "eyJjbG...",
    "id": "cm0r6nkek00ej10dwwx8wdjmf"
  },
  "ED25519": {
    "share": "eyJjbG...",
    "id": "cm0r6nk7c00hbzefaq9s93s0x"
  }
}
{
  "id": "DKG_FAILED",        // Short error identificator
  "message": "Some message"  // Optional: Details of the error
}
"Incorrect API key format"

Send the client's assets

POST https://mpc-client.portalhq.io/v1/assets/send

This endpoint allows you to easily send a token the client holds to another address.

The Send Assets endpoint builds, signs, and submits a transaction to an RPC gateway.

Important: A 200 response only confirms that the transaction was received by the RPC gateway — it does not mean the transaction is confirmed on-chain. The transaction must first be placed in the mempool of the RPC gateway nodes, submitted to miner/validator nodes, and then validated and finalized by the network. This process can take seconds to minutes, depending on the blockchain.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Body Parameters

Name
Type
Description

share*

String

chain*

String

"base"

"base-sepolia"

"ethereum"

"bitcoin-segwit"

"bitcoin-segwit-testnet"

"bitcoin-p2wpkh"

"bitcoin-p2wpkh-testnet"

"polygon"

"polygon-amoy"

"celo"

"celo-alfajores"

"sepolia"

"solana"

"solana-devnet"

"stellar"

"stellar-testnet"

"tron"

"tron-nile"

"tron-shasta"

The blockchain network.

to*

String

The recipient's address.

token*

String

The token contract address (for ERC20 tokens on EVM chains) or the mint address (for Solana SPL tokens). You can also use "USDC" or "USDT" for the respective tokens. For native token transfers, use "NATIVE".

amount*

String

The amount of tokens to send ("0.1" is 0.1 USDC)

rpcUrl

String

The node provider RPC URL. Not required for Solana or Solana Devnet.

nonce

String

The hex string of the nonce to set on the transaction ("0x01" sets the nonce of the transaction to 1). Note that the hex string needs to include the "0x" and for single digits to include a leading zero like "0x0".

metadataStr

String

Optional metadata string for the transaction.

When submitting multiple transactions for a single client in quick succession (or in parallel), each transaction may initially have the same nonce if the blockchain hasn’t processed the earlier ones yet. This can cause errors, as the RPC gateway interprets identical nonces as attempts to overwrite transactions in the mempool.

To prevent this, track the nonce in your application and increment it manually for each transaction sent to the Send Assets endpoint, ensuring unique nonces for concurrent requests.

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/assets/send \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{
	"share": "share",
	"chain": "ethereum",
	"to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
	"token": "NATIVE",
	"amount": "0.0001"
}'

Example Response

{
  "transactionHash": "0x02073df9ba08895d681f80ae45440ba57e766602c97ee6321df5ac81bca900cc",
  "metadata": {
    "amount": "0.01",
    "rawAmount": "10000000000000000",
    "tokenAddress": "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
    "tokenDecimals": 18
  }
}
{
  "id": "RPC_OP_FAILED", // Short error identificator
  "message": "Failed to send transaction: details" // Optional details
}
"Incorrect API key format"

Sign a transaction or message by chain

POST https://mpc-client.portalhq.io/v1/sign

This endpoint allows you to sign a transaction or message by chain.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Body Parameters

Name
Type
Description

method*

String

The signer RPC method (e.g. "personal_sign", "eth_sendTransaction", "sol_signAndSendTransaction", etc).

params*

String

A JSON stringified array of the parameters for the RPC method (e.g. "[\"test\"]").

share*

String

chainId*

String

The blockchain network (a CAIP-2 chain ID like "eip155:11155111" for Sepolia).

to*

String

The recipient's address.

rpcUrl*

String

The node provider RPC URL.

metadataStr

String

Optional metadata string for the transaction.

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/sign \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{
	"share": "share",
	"method": "eth_sendTransaction",
	"params": "{\"value\": \"0x01\",\"from\": \"\",\"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\"data\": \"\"}",
	"rpcUrl": "https://api.portalhq.io/rpc/v1/eip155/1",
	"chainId": "eip155:1"
}'

Example Response

{
  "data": "0xf7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b"
}
{
  "id": "RPC_OP_FAILED", // Short error identificator
  "message": "Failed to send transaction: details" // Optional details
}
"Incorrect API key format"

Sign a transaction or message by curve

POST https://mpc-client.portalhq.io/v1/raw/sign/:curve

This endpoint allows you to sign a raw message by curve.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Path Parameters

Name
Type
Description

curve*

String

The curve you want to use (e.g. SECP256K1 for EVM chains and ED25519 for Solana).

Body Parameters

Name
Type
Description

param*

String

A hex string of the digest to sign without the leading 0x (e.g. "param": "7369676e2074686973").

share*

String

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/raw/sign/SECP256K1 \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{
	"params": "0x123",
	"share": "share"
}'

Example Response

{
  "data": "0xf7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b"
}
{
  "id": "BAD_REQUEST", // Short error identificator
  "message": "Can't parse the request body" // Optional details
}
"Incorrect API key format"

Back up the client's wallet

POST https://mpc-client.portalhq.io/v1/backup

This endpoint allows you to create backup shares for your wallet.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Body Parameters

Name
Type
Description

generateResponse*

JSON

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/backup \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{
  "generateResponse": "{\"SECP256K1\":{\"share\":\"share\",\"id\":\"shareId\"},\"ED25519\":{\"share\":\"share\",\"id\":\"shareId\"}}"
}'

Example Response

{
  "SECP256K1": {
    "share": "eyJjbGl...",
    "id": "clu32l6c8008wuvz52jokyo3r"
  },
  "ED25519": {
    "share": "eyJjbGl...",
    "id": "clu32l9310087evz5u5v9k1ao"
  }
}
{
  "id": "BAD_REQUEST", // Short error identificator
  "message": "Can't parse the request body" // Optional details
}
"Authorization header is missing"

Recover the client's wallet

POST https://mpc-client.portalhq.io/v1/recover

This endpoint allows you to recover shares for your wallet using your backup shares.

Headers

Name
Type
Description

Authorization*

String

Bearer <Client API Key>

Content-Type*

String

application/json

Body Parameters

Name
Type
Description

backupResponse*

JSON

Example Request

Be sure to replace the [token] with either a Client API Key or a Client Session Token.

curl --request POST \
  --url https://mpc-client.portalhq.io/v1/recover \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{
  "backupResponse": "{\"SECP256K1\":{\"share\":\"share\",\"id\":\"shareId\"},\"ED25519\":{\"share\":\"share\",\"id\":\"shareId\"}}"
}'

Example Response

{
  "SECP256K1": {
    "share": "eyJjbGl...",
    "id": "clu32l6c8008wuvz52jokyo3r"
  },
  "ED25519": {
    "share": "eyJjbGl...",
    "id": "clu32l9310087evz5u5v9k1ao"
  }
}
{
  "id": "BAD_REQUEST", // Short error identificator
  "message": "Can't parse the request body" // Optional details
}
"Authorization header is missing"

The MPC share generated from for a specific curve.

or one of:

If your client is using , then transactionHash is actually a User Operation hash. You can manually look up the user operation hash .

The MPC share generated from for a specific curve.

The MPC share generated from for a specific curve.

The response body from .

The response body from .

this endpoint
Account Abstraction
here
CAIP-2 Chain ID
"Create Wallets"
"Create Wallets"
"Create Wallets"
"Create Wallets"
"Back Up Wallets"