MPCKitMPCKit

Configuration

Every environment variable the backend reads, what it's for, and what's required.

The full schema lives in apps/backend/src/config/env.ts. This page groups it by concern.

Required for any deploy

VariableDescription
IKA_NETWORKtestnet or mainnet. Pins the process to one network.
HOT_WALLET_SUI_SECRET_HEX32-byte ed25519 secret hex for the protocol signer (when HOT_WALLET_PROVIDER=env).
DATABASE_URLPostgres connection string.
REDIS_URLRedis connection string.
SUI_GAS_STATION_URLHTTP URL of the gas-station.
SUI_GAS_STATION_AUTHBearer token the backend sends to the gas-station.
ADMIN_API_KEYBootstrap admin key. The first request to /v1/admin/users requires this.

Per-network protocol IDs

After bun run apps/backend/scripts/deploy.ts <network> the script emits the IDs the backend needs:

VariableDescription
MPCKITCORE_<NETWORK>_PACKAGE_IDMove package id.
MPCKITCORE_<NETWORK>_ADMIN_CAP_IDAdminCap object id.
MPCKITCORE_<NETWORK>_OPERATOR_CAP_IDOperatorCap object id. The backend uses this to authorize protocol-paying entries.
MPCKITCORE_<NETWORK>_TREASURY_IDShared Treasury object id. Holds the IKA + SUI the protocol entries consume.

Both networks may be set; the backend selects the right block based on its IKA_NETWORK.

Hot wallet

VariableDescription
HOT_WALLET_PROVIDERenv (dev) or aws-kms (prod).
HOT_WALLET_SUI_SECRET_HEXRequired when provider=env.
HOT_WALLET_SUI_SECRET_KMS_CIPHERTEXT_B64Required when provider=aws-kms.
HOT_WALLET_KMS_KEY_IDPinned KMS key id; defends against ciphertext substitution.
HOT_WALLET_KMS_REGIONAWS region for KMS client. Falls back to AWS_REGION.

Gas station

The sui-gas-station daemon must be reachable from the backend. The sponsor keypair is separate from the protocol hot wallet — never reuse keys between roles.

VariableDescription
SUI_GAS_STATION_URLDefault http://gas-station:9527 in compose.
SUI_GAS_STATION_AUTHLong random string. The gas-station validates this on every request.
SUI_GAS_STATION_SPONSOR_KEYPAIR_B64Base64-encoded `flag
SUI_GAS_STATION_FULLNODE_URLSui RPC. Match the network.
SUI_GAS_STATION_REDIS_URLRedis connection. Shares the cluster's Redis but uses its own keyspace.
SUI_GAS_STATION_BUDGET_MISTPer-PTB gas budget reservation. Default 500_000_000 (0.5 SUI).
SUI_GAS_STATION_RESERVE_SECSReservation TTL on the station. Default 30s.

Billing

VariableDescription
BILLING_DEPOSIT_MASTER_SEED_HEX32-byte HKDF seed for deriving per-user deposit addresses. Long-lived secret; rotating orphans existing addresses.
BILLING_SWEEP_DESTINATION_ADDRESSWhere consolidated deposits land.
BILLING_SWEEP_MIN_MICROSkip sweeps below this USD-equivalent. Default $0.10.
BILLING_MIN_DEPOSIT_MICROReject deposits below this. Default $1.
BILLING_ACCEPTED_COIN_TYPESComma-separated coin types. Default 0x2::sui::SUI.
BILLING_USD_PRICESFallback USD prices when CoinGecko is unreachable. Format: 0x2::sui::SUI=1.20,0x...::ika::IKA=0.05.
BILLING_COINGECKO_IDSPolled price feeds. Format: 0x2::sui::SUI=sui.
BILLING_PRICE_DKG_MICRODefault 50_000 (= $0.05).
BILLING_PRICE_SIGN_MICRODefault 10_000 (= $0.01).
BILLING_PRICE_ENCRYPTION_KEY_MICRODefault 1_000 (= $0.001).

Presign pool

VariableDescription
PRESIGN_POOL_LOW_WATERBoot warmup fills any bucket below this. Default 20.
PRESIGN_POOL_HIGH_WATERMaximum target bucket size. Default 100.
PRESIGN_BATCH_SIZESingle PTB mints this many caps. Default 10.
PRESIGN_RESERVATION_TTL_SECAllocated rows past this age get swept back to ready. Default 300.

Dashboard auth

VariableDescription
BETTER_AUTH_SECRET32-byte random secret for session cookies.
BETTER_AUTH_URLPublic backend origin, e.g. https://api.mpckit.xyz.
DASHBOARD_TRUSTED_ORIGINSComma-separated dashboard origins allowed to send cookies.
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETOptional GitHub OAuth.

Process role

VariableDescription
PROCESS_TYPEapi (HTTP only), worker (pg-boss handlers only), both (default; ok for single-pod).
PORTHTTP listener port. Default 3000.
LOG_LEVELfatal, error, warn, info (default), debug, trace.
NODE_ENVdevelopment, test, production.

Self-host opt-in

VariableDescription
ALLOW_SHARED_DWALLETStrue to expose the shared-dWallet DKG path. Default false. Hosted MPCKit is non-custodial; only operators taking custody should turn this on.

On this page