Signatures
Algorithm
All signatures use secp256k1 ECDSA over SHA-256.Public Key Format
128-character hex string representing the uncompressed secp256k1 public key (64 bytes), without the 04 prefix:Signature Format
130-character hex string:HTTP API
Request Headers
All authenticated requests MUST include:| Header | Description | Example |
|---|---|---|
X-OC-ID | Sender’s OCID | 200 |
X-OC-Timestamp | Unix timestamp (seconds) | 1706500000 |
X-OC-Nonce | Unique request identifier | req_abc123 |
X-OC-Signature | Request signature | a1b2c3...1b |
Request Signature
Canonical format:ocid: Sender’s OCID as decimal stringtimestamp: Unix seconds as decimal stringnonce: Unique request ID (for replay protection)method: HTTP method, uppercasepath: Full path including query stringbody_hash: SHA-256 of request body (hex), or SHA-256 of empty string if no body
secp256k1_sign(privateKey, SHA256(canonical))
Response Headers
Responses SHOULD include authentication:| Header | Description |
|---|---|
X-OC-ID | Responder’s OCID |
X-OC-Timestamp | Response timestamp |
X-OC-Signature | Response signature |