Skip to main content
The Go SDK v0.2.0 models KMS resources by contract. A KMS contract groups equivalent KMS node replicas that share one root key.

ListKMSContracts

GET /kms
Parameters: ctx controls cancellation and request lifetime. Returns: *ListKMSContractsResponse, a paginated list of KMSContract values, or an error. Returns the available KMS contracts. This method always requests API version 2026-06-23.
Each KMSContract includes the contract ID, slug, contract address, chain ID, node count, K256Pubkey, and CAPubkey. For the off-chain Phala KMS, the contract address is "phala" and the chain ID is 0.

GetKMSContract

GET /kms/{slug}
Parameters: ctx controls cancellation; slug accepts a contract slug or kc_-prefixed contract ID. Returns: *KMSContract for the resolved contract, or an error. Returns one KMS contract by slug. A kc_-prefixed contract ID also resolves.

ListKMSContractNodes

GET /kms/{slug}/nodes
Parameters: ctx controls cancellation; slug accepts a contract slug or kc_-prefixed contract ID. Returns: *ListKMSContractNodesResponse with the contract’s node replicas, or an error. Returns the KMS node replicas under a contract, including each node’s RPC URL and version.

Legacy node methods

GetKMSList takes a request context. GetKMSInfo also requires a KMS node ID or slug. They return the earlier node-centric KMS shapes or an error. Both methods are deprecated and remain pinned to API version 2026-05-22. Use ListKMSContracts, GetKMSContract, and ListKMSContractNodes for new code.

GetAppEnvEncryptPubKey

GET /kms/{kmsType}/pubkey/{appId}
Parameters: ctx controls cancellation, kmsType is a KMS node ID or slug, and appID is the app ID. Returns: *AppEnvPubKeyResponse containing the public key response, or an error. Returns the public key used to encrypt environment variables for an app.

NextAppIDs

GET /kms/phala/next_app_id
Parameters: ctx controls cancellation and request lifetime. Returns: *NextAppIDsResponse with the reserved app IDs, or an error. Reserves app IDs from the Phala KMS for deterministic provisioning.

GetKMSOnChainDetail

GET /kms/on-chain/{chain}
Parameters: ctx controls cancellation; chain is the chain name, such as "base" or "ethereum". Returns: *KMSOnChainDetail with the chain and its KMS contracts, or an error. Returns the contracts, registered devices, OS images, and verification anchors for an on-chain KMS.

Compute and verify mr_config_id

Use GetMrConfigIdHex when your inputs are hex strings:
For KeyProviderKMS, set kpIDHex to the contract’s K256Pubkey, not its CAPubkey.
Use GetMrConfigId for fixed-size byte inputs and GetMrConfigIdV1 for the V1 compose-hash-only format.