Mesh contract

Rendered API reference for mesh-v2.0.0-m0

Mesh is Alloy's cryptographic execution boundary. This page renders the committed proto-derived OpenAPI artifact into a browsable contract reference so engineering teams can inspect endpoints, schemas, headers, and fail-closed receipts without opening raw spec files.

Required request metadata

Every Mesh request must be supportable after the fact. Client identity, contract version, request ID, and correlation ID travel through receipts, response metadata, and logs.

HeaderPurpose
authorizationBearer token for the calling service boundary.
x-alloy-client-nameSDK or service name used in receipts and logs.
x-alloy-client-versionSDK or service version used for support triage.
x-alloy-contract-versionMust match mesh-v2.0.0-m0 for the current M0 gate.
x-request-idStable customer support handle for a single request.
x-correlation-idTrace handle across caller, VaultCore, WalletKit, and Mesh.

Copy-paste HSM signing request

This example shows the bank-grade HSM path: VaultCore authorizes the signer binding, while Mesh resolves backend profile and PKCS#11 key selectors from governed configuration.

curl -X POST https://mesh.sandbox.alloy.build/v1/signing/initiate \
  -H "Authorization: Bearer $ALLOY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-alloy-client-name: walletkit" \
  -H "x-alloy-client-version: 0.1.0-m0" \
  -H "x-alloy-contract-version: mesh-v2.0.0-m0" \
  -H "x-request-id: req_demo_001" \
  -H "x-correlation-id: corr_demo_001" \
  -d '{
    "session_id": "sig_hsm_001",
    "wallet_id": "wallet_treasury_hot",
    "message_hash": "base64url-message-hash",
    "approval_mode": "DIRECT_ALLOWED",
    "keystore_type": "KEYSTORE_TYPE_HSM_PKCS11",
    "vaultcore_signer_authorization": {
      "schema_version": "keystore-signing-reference.v1",
      "key_reference_id": "hsm_key_ref_hot_001",
      "signer_binding_id": "vc_binding_hot_001",
      "mechanism": "CKM_ECDSA",
      "key_control_evidence_hash": "key-control-evidence-001",
      "approval_expires_at_epoch_ms": "4102444800000"
    },
    "context": {
      "request_id": "req_demo_001",
      "correlation_id": "corr_demo_001",
      "contract_version": "mesh-v2.0.0-m0"
    }
  }'

Endpoints

All current Mesh REST routes are POST operations generated from the canonical protobuf service and bound with `google.api.http` annotations.

POST/v1/dkg/initiate

Initiate Dkg

MpcWalletService_InitiateDkg

Request: InitiateDkgRequest
Response: InitiateDkgResponse

Request fields

session_idstring
thresholdinteger
total_nodesinteger
derivationThresholdDerivation
contextOrchestrationContext

Response fields

session_idstring
stateReceiptState
epochstring
receiptDiagnosticReceipt
checkpointSessionCheckpoint
POST/v1/dkg/shares

Exchange Dkg Shares

MpcWalletService_ExchangeDkgShares

Request: DkgShareExchangeRequest
Response: DkgShareExchangeResponse

Request fields

session_idstring
sender_node_idinteger
recipient_node_idinteger
encrypted_sharestring

In M0 local simulation mode this can carry raw share bytes.

commitmentsarray[]

Feldman VSS commitments for the threshold ceremony.

contextOrchestrationContext

Response fields

session_idstring
verifiedboolean
error_messagestring
receiptDiagnosticReceipt
checkpointSessionCheckpoint
POST/v1/key-material/provision

Provision Key Material

MpcWalletService_ProvisionKeyMaterial

Request: ProvisionKeyMaterialRequest
Response: ProvisionKeyMaterialResponse

Request fields

contract_versionstring
org_idstring
service_identitystring
key_reference_idstring
signer_binding_intent_refstring
key_profile_idstring
capability_familystring
mechanismstring
key_algorithmstring
key_purposestring
backend_profile_idstring
backend_profile_classstring
environmentstring
idempotency_keystring
correlation_idstring
provisioning_intent_hashstring
evidence_sourcestring
requested_key_labelstring

Abstract governance label only. Mesh derives concrete provider selectors from governed backend profiles.

contextOrchestrationContext

Response fields

successboolean
reason_codestring
messagestring
receipt_idstring
public_key_pemstring
public_key_fingerprintstring
mechanismstring
key_algorithmstring
key_selector_evidence_refstring
backend_profile_idstring
backend_profile_classstring
environmentstring
provisioning_evidence_hashstring
conflicting_fieldsarray[]
receiptDiagnosticReceipt
POST/v1/sessions/resume

Resume Session

MpcWalletService_ResumeSession

Request: ResumeSessionRequest
Response: ResumeSessionResponse

Request fields

session_idstring
resume_tokenstring
contextOrchestrationContext
human_approval_witnessstring

Response fields

session_idstring
stateReceiptState
epochstring
receiptDiagnosticReceipt
checkpointSessionCheckpoint
POST/v1/signing/initiate

Initiate Signing

MpcWalletService_InitiateSigning

Request: InitiateSigningRequest
Response: InitiateSigningResponse

Request fields

transaction_intent_idstring

Upstream signing intent reference owned by VaultCore/WalletKit. Mesh uses it for idempotency, audit linkage, and signing_session_id derivation; it is not a blockchain transaction hash and is not generated by Mesh.

wallet_idstring
derivationThresholdDerivation
message_hashstring
policy_approval_tokenstring

Opaque upstream approval evidence. Mesh treats this as execution evidence when approval_mode says governance has already been applied; Mesh does not evaluate business-policy semantics from this payload.

human_approval_witnessstring
approval_modeApprovalMode

Upstream execution constraint decided by VaultCore/PolicyKit/WalletKit. Mesh enforces pause/resume behavior and receipt state from this value but does not decide whether a customer transaction needs approval.

contextOrchestrationContext
keystore_typeKeystoreType
test_directiveTestDirective

Explicit M0-only override for deterministic local testing. Must not carry business-policy semantics.

vaultcore_signer_authorizationVaultCoreSignerAuthorization

VaultCore-issued signer authorization for HSM-backed keystore signing. VaultCore authorizes signer/key use; Mesh resolves provider execution details from governed signer bindings. Required when keystore_type is KEYSTORE_TYPE_HSM_PKCS11.

Response fields

signing_session_idstring
stateReceiptState
epochstring
receiptDiagnosticReceipt
checkpointSessionCheckpoint
keystore_signaturestring

Provider-backed signature bytes when a keystore signing request completes synchronously, for example KEYSTORE_TYPE_HSM_PKCS11. Empty for denials, pending MPC ceremonies, and flows that complete via SubmitSignatureShare.

POST/v1/signing/share

Submit Signature Share

MpcWalletService_SubmitSignatureShare

Request: SignatureShareRequest
Response: SignatureShareResponse

Request fields

signing_session_idstring
node_idinteger
partial_signaturestring
ephemeral_public_keystring
contextOrchestrationContext

Response fields

signing_session_idstring
is_completeboolean
full_signaturestring
recovery_idstring
receiptDiagnosticReceipt
checkpointSessionCheckpoint