Skip to main content
Vela uses ECDSA (secp256k1) signatures for all authentication. There are no API keys or passwords. Your Ethereum wallet is your identity, and your signatures prove you control it.

Signature Scheme

Vela uses the same elliptic curve as Ethereum: secp256k1. Signatures follow the EIP-191 personal sign standard, which prepends a standard prefix to prevent signed messages from being mistaken for Ethereum transactions:
The resulting signature is a 65-byte (130 hex character) value: r (32 bytes) + s (32 bytes) + v (1 byte, recovery id: 27 or 28).

Order Signing

Every order submitted to Vela must be signed by the account’s private key. The signing payload is the canonical JSON serialization of the order parameters:
The field order in the JSON matters for signature verification. Always use the canonical field order shown above: market_id, side, price, quantity, order_type, time_in_force, nonce.
The signed order is submitted as:
The engine recovers the signer address from the signature and verifies it matches the address field. If verification fails, the order is rejected with INVALID_SIGNATURE.

WebSocket Authentication

WebSocket private channels use a challenge-response flow:
1

Request challenge

2

Receive challenge

3

Sign and respond

Nonce Replay Prevention

The nonce field in each order is a per-account monotonic integer. The engine tracks a nonce high-water mark per account and rejects any order with nonce ≤ high_water_mark. This prevents replay attacks: a signed order cannot be re-submitted by a third party who intercepts it, because the nonce has already been consumed. Nonce management best practices:

Implementation: ethers.js

Address Derivation

The engine derives the signer address from the signature using the standard Ethereum address derivation:
  1. Recover the public key from (hash, r, s, v)
  2. Take keccak256 of the uncompressed public key (64 bytes, without the 0x04 prefix)
  3. Take the last 20 bytes → Ethereum address
This is implemented using the k256 Rust crate in the engine.

Security Properties