Security Overview
MEMEH enforces identity, integrity, replay protection, and operational governance at each integration boundary. Fintech requests are authenticated with HMAC. Participant adapter callbacks are authenticated with Ed25519 signatures.
Every message is signed. Any change to method, path, timestamp, nonce, or body invalidates verification.
Timestamp + nonce are mandatory. Nonces are single-use (multi-node safe via Redis in production).
Idempotency keys prevent duplicate processing and enable safe retries. Conflicts are rejected.
Credentials and keys are issued/rotated via controlled workflows with audit logs (actor, IP, before/after).
Security Boundary Matrix
The primitive used depends on the boundary. Bank/IPS outcomes are higher impact, therefore adapter callbacks use public-key signatures.
| Boundary | Primitive | Why | Required headers |
|---|---|---|---|
| Fintech → MEMEH Core | HMAC-SHA256 | Broad compatibility for fintechs; secure when combined with strict replay protection, idempotency, and key rotation. |
X-Client-ID
X-Key-Id
X-Signature
X-Timestamp
X-Nonce
X-Idempotency-Key
|
| MEMEH Core → Participant Adapter | HMAC-SHA256 | Service-to-service control; deterministic signing for instruction dispatch; rotation via key-id. |
X-Client-ID
X-Key-Id
X-Signature
X-Timestamp
X-Nonce
X-Idempotency-Key
|
| Participant Adapter → MEMEH Core (Callbacks) | Ed25519 (public-key signatures) | Bank/IPS outcomes are authoritative; avoids shared secrets in Core; scales cleanly across many participants/adapters. |
X-Adapter-ID
X-Key-Id
X-Signature
X-Timestamp
X-Nonce
|
Canonical Signing String
Both HMAC and Ed25519 use the same canonical structure. The signature is computed over this string.
METHOD
PATH
TIMESTAMP
NONCE
BODY
Requests outside the accepted skew window are rejected (401).
Reused nonces are rejected (401). Nonces should be random and unique.
Same idempotency key with a different payload is rejected (409).
Sign the raw request body exactly as sent; avoid reformatting differences across systems.
Callbacks (pain.014) Integrity
Participant adapters send authoritative RTP lifecycle outcomes into MEMEH Core. Callbacks are verified using Ed25519 public keys from the Control Plane bundle.
{
"Document": {
"CdtrPmtActvtnReqStsRpt": {
"GrpHdr": {
"MsgId": "MSG-001",
"CreDtTm": "2026-03-30T10:00:00Z"
},
"OrgnlPmtInfAndSts": {
"TxInfAndSts": {
"OrgnlEndToEndId": "TXN-123",
"TxSts": "ACSP"
}
}
}
}
}
Callback status changes (PAID/REJECTED/CANCELLED) are high-impact outcomes. Public-key verification avoids shared secrets in Core and scales across many IPS participants.
| TxSts | Partner status | Meaning |
|---|---|---|
| RCVD | RECEIVED | Request received/acknowledged; awaiting decision. |
| ACSP | PAID | Paid/completed outcome (terminal). |
| RJCT | REJECTED | Rejected outcome (terminal). |
| CANC | CANCELLED | Cancelled outcome (terminal). |
Lifecycle Integrity
MEMEH enforces a strict lifecycle. Terminal states cannot be downgraded. Invalid transitions return 409 while still recording events for audit.
| Current | Allowed next | Notes |
|---|---|---|
| RCVD | RCVD, ACSP, RJCT, CANC | Normal progression to terminal states. |
| ACSP | ACSP | Terminal; no downgrades allowed. |
| RJCT | RJCT | Terminal; no downgrades allowed. |
| CANC | CANC | Terminal; no downgrades allowed. |
Key Rotation
Rotation is mandatory for enterprise operations. Always use an overlap window to avoid downtime.
HMAC rotation (Fintech / Core → Adapter)
1) Add new key_id + secret in Control Plane and mark Active (keep old key active).
2) Roll client/service to sign with the new key_id.
3) Monitor signature failures and 401 rates.
4) Deactivate old key after the rollout window.
Ed25519 rotation (Adapter callbacks)
1) Generate new Ed25519 keypair in adapter environment (private key never leaves adapter).
2) Register the public key in Control Plane as Active + Primary (keep old key active).
3) Deploy adapter to sign callbacks with new key_id.
4) Deactivate old key after rollout window.
Operational Security
Never email secrets. Store in KMS/Vault where possible. Rotate on personnel/vendor change.
Alert on spikes in 401, 409, 422; callback verification failures; DLQ growth; bundle refresh failures.
All sensitive changes must be auditable (actor + IP + before/after + reason).
Sandbox and production-path keys are distinct. Never reuse keys across environments.