Skip to content

Register & authenticate

The SDK handles registration via DarkfibreSDK.register(). This page explains what happens under the hood.

Darkfibre uses signature-based authentication to prove wallet ownership. Here’s the flow:

  1. Create a message with the current timestamp: darkfibre:{timestamp}
  2. Sign the message with your wallet’s private key
  3. Send to API with your wallet address, message, and signature
  4. Receive API key if the signature is valid

This proves you control the private key without ever sending it to the server.

The easiest way to register is using the browser wallet interface:

https://darkfibre.dev/register

This handles all the signature steps automatically. Simply connect your Solana wallet and follow the prompts to receive your API key.

Once you have your API key, include it in the Authorization header on every REST request:

Authorization: Bearer api_your_key_here

If you need to register programmatically (for automated setups or non-browser environments), you can call the API endpoint directly.

POST /v1/auth/register
{
"walletAddress": "YOUR_SOLANA_WALLET_ADDRESS",
"message": "darkfibre:1736123456789",
"signature": "BASE58_ENCODED_SIGNATURE"
}

For complete API reference, see: POST /v1/auth/register.