Contact Sales

Connect Your App to Braiins ID

Braiins Hashpower is currently the only product that supports third-party OAuth apps through Braiins ID. For example, a portfolio app can ask to read a user's Hashpower balances, while a trading app can also ask to place orders. The user signs in with Braiins ID and chooses which accounts to share.

Request an OAuth client from Braiins Support. Braiins registers your app once and gives you a client ID to use across installations.

To automate only your own account, you do not need an OAuth client: an account owner can create an API key instead.

What to Send Support

  • App name and purpose. Give the name users should see when they approve access, what the app does with Hashpower, and where it runs (for example, a website, a mobile app, or a self-hosted hub).
  • Sign-in method. For browser sign-in, list each exact callback URL, including its scheme and path, for each environment you want to use. For a hub without a fixed callback, ask for device authorization. You can request both if your app supports both.
  • Permissions. Say whether the app needs to view balances and orders (hashpower:read), place or change orders (hashpower:write), or both. The two are independent: hashpower:write does not include reading, and an app with write alone cannot call GET /v2/accounts to find the account its own bid calls need, so an app that trades should ask for both. Trading permission does not grant withdrawals. If the app should stay connected between visits, ask for refresh tokens (offline_access).
  • Accounts per connection. Say whether each connection needs one Hashpower account or whether your app can work with several accounts together.
  • Referral code (optional). If you have a Hashpower referral code, include it and ask to have it suggested during first-time Hashpower setup. Users can change or clear it. An existing referral choice takes precedence.

Choose a Sign-In Method

Website or mobile app with a callback

Use the OAuth 2.0 authorization code grant (RFC 6749) with PKCE (RFC 7636).

Discover the endpoints at https://identity.braiins.com/.well-known/openid-configuration, and request the audience hashpower with your scopes. Braiins ID refuses consent for any other audience.

  1. Your app opens Braiins ID in the user's browser, sending its registered callback URL and an S256 code challenge.
  2. The user signs in and approves access. Braiins ID returns the browser to the callback with an authorization code.
  3. Your app exchanges the code and its original PKCE verifier for tokens.

Self-hosted hub without a fixed callback

Ask Support about the OAuth 2.0 device authorization grant (RFC 8628) if users run your app on their own hardware. A hub can use this flow even when its local IP address changes.

  1. The hub requests a device code from Braiins ID. It keeps that code private and shows the user a separate short code and a verification link.
  2. The user opens the link on a phone or computer, checks that the displayed code matches the hub, and approves access.
  3. The hub polls Braiins ID at the returned interval until it receives tokens, the request ends, or the code expires. Each installation uses the same public client ID and keeps its own user's tokens.

Choose Which Accounts to Request

  • One account (default). The user selects one eligible Hashpower account. This works well for a trading app that places orders on a single account.
  • Several accounts. Ask Support to enable this if, for example, a portfolio app needs to show balances across accounts. With browser sign-in, your app can send the Braiins ID parameter braiins_account_selection=multiple to offer a choice of several accounts, or omit it to request just one. The user chooses which accounts to approve. If your hub needs this option with device authorization, confirm it with Support.
  • Additional accounts later. If a user joins another account, ask them to authorize a new connection to include it.

Users can review or revoke a connection in Braiins ID.


Was this helpful?