requestTimestampNs is the authentication nonce and replay check.
Direction: Client → Kraken
Every message is preceded by the standard SBE
messageHeader (blockLength, templateId, schemaId, version). See encodings.
Authentication
KrakenHmacSha512 authenticates Negotiate with the API secret that belongs to accessKey, using the same HMAC-SHA512 model as the Kraken FIX API.
Signed payload
The signed payload is the contiguous encoded SBE message from the first byte of the 8-bytemessageHeader through the last byte of accessKey. It includes the encoded compId and accessKey length prefixes and values. The SOFH, the Kraken TCP header and signature (including its length prefix) are not part of the payload.
Read blockLength from the message header you are encoding, not from a constant in your generated codec: new fixed fields extend blockLength and are therefore signed.
uint16 length prefixes of compId and accessKey. Because the SBE header, session ID, timestamp, keepalive interval, credential type, compId and accessKey are all signed, none of them can be changed without invalidating the signature.
signature must remain the last variable-length field of the message. Put the raw 64 bytes of the HMAC output in signature; do not base64 encode them.
Fields
requestTimestampNsis a UTC timestamp in nanoseconds that you generate for each attempt. It is the authentication nonce and replay check. Kraken rejects values outside its allowed clock window (seeNegotiationReject); there is no separate nonce field.sessionIdidentifies one negotiation attempt. Generate a newsessionIdfor every attempt, including when you reconnect.compIdis your registered logical client identity. It is case-sensitive, 1 to 128 printable ASCII bytes, and must be authorized for the account that ownsaccessKey. Use the samecompIdevery time you reconnect. An account can have more than one registeredcompId. EachcompIdallows one active live connection and one active snapshot connection.accessKeyis the Kraken API key whose secret signs the message.
TargetCompID. Credentials are provided during onboarding.