
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
@sigma-auth/server-plugin
Advanced tools
Better Auth server plugin for Bitcoin signature-based authentication with Sigma Identity
Better Auth server plugin for Bitcoin signature-based authentication with Sigma Identity.
npm install @sigma-auth/server-plugin
# or
bun add @sigma-auth/server-plugin
Sigma Identity (auth.sigmaidentity.com) is a centralized OAuth provider for Bitcoin-based authentication. This server plugin handles Bitcoin signature verification and OAuth token exchange for platforms integrating with Sigma.
bitcoin-authimport { betterAuth } from "better-auth";
import { sigma } from "@sigma-auth/server-plugin";
export const auth = betterAuth({
database: {
// your database configuration
},
plugins: [
sigma(), // Basic setup with no optional features
],
});
import { betterAuth } from "better-auth";
import { sigma } from "@sigma-auth/server-plugin";
import { Pool } from "@neondatabase/serverless";
import { kv } from "@vercel/kv";
import { resolvePubkeyAndRegisterBAPId } from "./lib/bap/resolver";
export const auth = betterAuth({
database: {
// your database configuration
},
plugins: [
sigma({
// Enable subscription tier tracking
enableSubscription: true,
// Provide BAP ID resolver
resolveBAPId: resolvePubkeyAndRegisterBAPId,
// Provide database pool getter
getPool: () => new Pool({
connectionString: process.env.POSTGRES_URL,
}),
// Provide cache implementation (optional)
cache: {
get: async (key) => await kv.get(key),
set: async (key, value) => await kv.set(key, value),
},
}),
],
});
sigma(options?)Creates the Sigma Auth server plugin for Better Auth.
Options:
interface SigmaPluginOptions {
/**
* Enable subscription tier support
* Adds subscriptionTier field to user and session
* @default false
*/
enableSubscription?: boolean;
/**
* Optional BAP (Bitcoin Attestation Protocol) ID resolver
* Resolves a Bitcoin pubkey to a BAP ID and registers it
*/
resolveBAPId?: (
pool: any,
userId: string,
pubkey: string,
register: boolean
) => Promise<string | null>;
/**
* Optional database pool getter
* Returns a database connection pool for BAP ID resolution
*/
getPool?: () => any;
/**
* Optional cache implementation for BAP ID caching
* Should provide get/set methods for key-value storage
*/
cache?: {
get: <T = any>(key: string) => Promise<T | null>;
set: (key: string, value: any) => Promise<void>;
};
}
The plugin provides these endpoints:
POST /api/auth/sign-in/sigmaAuthenticates a user via Bitcoin signature.
Headers:
X-Auth-Token (required) - Bitcoin authentication tokenReturns:
{
"token": "session-token",
"user": {
"id": "user-id",
"pubkey": "bitcoin-pubkey",
"name": "user-name"
}
}
The plugin handles OAuth token exchange with Bitcoin-based client authentication via hooks on /oauth2/token.
Client Authentication:
X-Auth-Token signatureoauthApplication table with pubkey as clientIdSupported Grant Types:
authorization_code - Exchange authorization code for access tokenrefresh_token - Refresh an existing access tokenThe plugin extends Better Auth schema:
user: {
pubkey: string (required, unique)
subscriptionTier?: string (optional, if enableSubscription: true)
}
session: {
subscriptionTier?: string (optional, if enableSubscription: true)
}
Run migrations after adding the plugin:
npx @better-auth/cli migrate
Use with @sigma-auth/client-plugin:
import { createAuthClient } from "better-auth/react";
import { sigmaClient } from "@sigma-auth/client-plugin";
export const authClient = createAuthClient({
plugins: [sigmaClient()],
});
// Usage
authClient.signIn.sigma(); // Redirects to Sigma Identity OAuth flow
# Optional: Database connection for BAP ID resolution
POSTGRES_URL=postgresql://...
# Optional: Your environment-specific config
bitcoin-authMIT
FAQs
Better Auth server plugin for Bitcoin signature-based authentication with Sigma Identity
We found that @sigma-auth/server-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.