Mesh contract

Rendered API reference for mesh-v1.0.0-m2

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.

Header Purpose
authorization Bearer token for the calling service boundary.
x-alloy-client-name SDK or service name used in receipts and logs.
x-alloy-client-version SDK or service version used for support triage.
x-alloy-contract-version Must match mesh-v1.0.0-m2 for the current M0 gate.
x-request-id Stable customer support handle for a single request.
x-correlation-id Trace 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-v1.0.0-m2" \
  -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-v1.0.0-m2"
    }
  }'

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_id string
threshold integer
total_nodes integer
derivation ThresholdDerivation
context OrchestrationContext

Response fields

session_id string
state ReceiptState
epoch string
receipt DiagnosticReceipt
checkpoint SessionCheckpoint
POST /v1/dkg/shares

Exchange Dkg Shares

MpcWalletService_ExchangeDkgShares

Request: DkgShareExchangeRequest
Response: DkgShareExchangeResponse

Request fields

session_id string
sender_node_id integer
recipient_node_id integer
encrypted_share string

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

commitments array[]

Feldman VSS commitments for the threshold ceremony.

context OrchestrationContext

Response fields

session_id string
verified boolean
error_message string
receipt DiagnosticReceipt
checkpoint SessionCheckpoint
POST /v1/key-material/provision

Provision Key Material

MpcWalletService_ProvisionKeyMaterial

Request: ProvisionKeyMaterialRequest
Response: ProvisionKeyMaterialResponse

Request fields

contract_version string
org_id string
service_identity string
key_reference_id string
signer_binding_intent_ref string
key_profile_id string
capability_family string
mechanism string
key_algorithm string
key_purpose string
backend_profile_id string
backend_profile_class string
environment string
idempotency_key string
correlation_id string
provisioning_intent_hash string
evidence_source string
requested_key_label string

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

context OrchestrationContext

Response fields

success boolean
reason_code string
message string
receipt_id string
public_key_pem string
public_key_fingerprint string
mechanism string
key_algorithm string
key_selector_evidence_ref string
backend_profile_id string
backend_profile_class string
environment string
provisioning_evidence_hash string
conflicting_fields array[]
receipt DiagnosticReceipt
POST /v1/sessions/resume

Resume Session

MpcWalletService_ResumeSession

Request: ResumeSessionRequest
Response: ResumeSessionResponse

Request fields

session_id string
resume_token string
context OrchestrationContext
human_approval_witness string

Response fields

session_id string
state ReceiptState
epoch string
receipt DiagnosticReceipt
checkpoint SessionCheckpoint
POST /v1/signing/initiate

Initiate Signing

MpcWalletService_InitiateSigning

Request: InitiateSigningRequest
Response: InitiateSigningResponse

Request fields

transaction_intent_id string

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_id string
derivation ThresholdDerivation
message_hash string
policy_approval_token string

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_witness string
approval_mode ApprovalMode

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.

context OrchestrationContext
keystore_type KeystoreType
test_directive TestDirective

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

vaultcore_signer_authorization VaultCoreSignerAuthorization

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_id string
state ReceiptState
epoch string
receipt DiagnosticReceipt
checkpoint SessionCheckpoint
keystore_signature string

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_id string
node_id integer
partial_signature string
ephemeral_public_key string
context OrchestrationContext

Response fields

signing_session_id string
is_complete boolean
full_signature string
recovery_id string
receipt DiagnosticReceipt
checkpoint SessionCheckpoint