Contact Sales

Connection Security

A plain Stratum V1 connection (stratum+tcp://) is neither encrypted nor authenticated. Anyone on the network path between your miner and the pool can read it, and can answer in the pool's place. Use Stratum V2 or Stratum V1 over TLS so that your miner only works for Braiins Pool.

What is happening

Plain Stratum V1 connections can be intercepted and the hashrate stolen. This is a weakness of the protocol, not of a particular pool: an attacker who hijacks the internet route to a pool's address can send the miners' traffic to their own server instead of the pool, for minutes to hours. The miner's connection is reset, it reconnects to the same address, and the attacker's server answers on behalf of the pool. The miner keeps hashing, but the work goes to someone else and is not credited to the miner's account.

Braiins Pool is not the only target. Public routing data shows the same technique aimed at the address ranges of several other large mining pools, in some cases repeatedly. Any pool that accepts plain Stratum V1 is exposed, so protect your miners whichever pool you use.

We describe the attack, the data behind it and what the mining industry should do in our blog post Bitcoin Hashrate Hijacking Detected on Stratum V1.

Your Braiins Pool account, balance and payout settings are not affected. The interception happens on the network between your miner and the pool, not on our servers.

Symptoms

  • The miner's connection to the pool is reset, sometimes several times in a row.
  • The difficulty set by the pool jumps to hundreds of millions, for example 268,435,456 or 536,870,912. Braiins Pool never sets a difficulty above 16,777,216.
  • Accepted shares stop increasing while the hashboards keep hashing at full speed.
  • Hashrate on your Braiins Pool dashboard drops for minutes to hours, then returns without you changing anything.

If you see these symptoms, switch to one of the protected connections below.

Choose a protected connection

Use the first option your firmware supports.

OptionProtects hashrateWorks with
1. Stratum V2YesBraiins OS
2. Stratum V1 over TLSYes, if the firmware checks the certBraiins OS 26.11+; test other firmware
3. Braiins SV2 ProxyYesAny miner, via a computer in your network
Plain Stratum V1NoAll miners

If your firmware supports neither Stratum V2 nor validated TLS, use the Braiins SV2 Proxy, or install Braiins OS if your model is supported.

Stratum V2

Stratum V2 encrypts the connection and checks the pool's public key, which is part of the URL. A device that pretends to be the pool cannot prove it holds the matching private key, so the miner refuses to work for it. Braiins OS supports Stratum V2; most stock manufacturer firmware does not. For background on the protocol, see braiins.com/stratum-v2.

ParameterValue
Primary URLstratum2+tcp://stratum.braiins.com:3333/9awtMD5KQgvRUh2yFbjVeT7b6hjipWcAsQHd6wEhgtDT9soosna
Secondary URLstratum2+tcp://stratum.braiins.com:3336/9awtMD5KQgvRUh2yFbjVeT7b6hjipWcAsQHd6wEhgtDT9soosna
Backup URLstratum2+tcp://stratum.braiins.com:443/9awtMD5KQgvRUh2yFbjVeT7b6hjipWcAsQHd6wEhgtDT9soosna
User IDuserName.workerName
Passwordanything (or empty)

All three entries use Stratum V2, so the miner never falls back to an unprotected connection. Do not add a plain stratum+tcp:// entry.

Stratum V1 over TLS

TLS encrypts a normal Stratum V1 connection. The pool presents a certificate for stratum.braiins.com issued by a public certificate authority, and the miner checks it before it starts mining.

ParameterValue
Primary URLstratum+ssl://stratum.braiins.com:3443
Backup URLstratum+ssl://stratum.braiins.com:33443
User IDuserName.workerName
Passwordanything (or empty)

Some firmware writes the scheme as stratum+tls:// instead of stratum+ssl://, or has a separate TLS or SSL switch next to the URL. Check your firmware's documentation.

TLS only protects you if the miner validates the certificate. A miner that accepts any certificate encrypts the connection but still works for whoever answers. Check your firmware before you rely on TLS.

Braiins SV2 Proxy

For miners that support neither Stratum V2 nor validated TLS. The Braiins SV2 Proxy is a free program that you run on a computer in your own network: Linux, or Windows through WSL2. Your miners connect to the proxy with plain Stratum V1 inside your LAN, and the proxy connects to Braiins Pool over Stratum V2, which encrypts the connection and verifies that it is talking to the real pool.

For a backup, run a second instance of the proxy on another port or computer and add it as the miners' second pool entry. Do not use a backup that goes directly to the pool with plain Stratum V1; it would undo the protection. Download and setup: Braiins SV2 Proxy.

Do not fall back to plain Stratum V1

Keep every pool entry on the miner protected, including the backup. An attacker who can reset connections can also make the protected connection fail on purpose. If the backup is a plain stratum+tcp:// URL, the miner switches to it and can be intercepted again.

What a protected connection does not prevent

Stratum V2 and TLS stop your hashrate from being stolen. They cannot stop an attacker who hijacks the route from cutting the connection. During an interception your miner may still disconnect and reconnect, and you may see short drops in hashrate. It will not work for anyone else in the meantime.

Check whether your miner validates the certificate

Use these steps to find out whether your firmware supports Stratum V1 over TLS and whether it rejects certificates it should not trust. Test on one miner first.

Before you start

  • Write down the miner's current pool settings, so that you can restore them at the end.
  • Keep exactly one pool entry on the miner during every test. With a second entry, the miner switches to it when the test URL fails, and it looks as if the test URL works.
  • After every change of the pool URL, make sure the miner really uses the new one. On Whatsminer, restart the miner after each change; otherwise it may keep mining on the previous pool.
  • The miner's clock must be correct. Certificates are only valid between two dates, and a miner with a wrong date rejects even a valid certificate. Make sure the miner gets its time from the network (NTP).
  • You need access to the miner's web interface and, for step 4, its log.

Step 1: check that your network reaches the TLS endpoint

Run this on a computer in the same network as the miner. On Windows, openssl is included in Git for Windows (Git Bash).

openssl s_client -connect stratum.braiins.com:3443 -servername stratum.braiins.com -brief

A working connection prints Verification: OK and a certificate for braiins.com. Then paste this line and press Enter:

{"id":1,"method":"mining.subscribe","params":[]}

The pool answers with a line starting with {"id":1,"result":. If verification fails or the connection is reset, something on your network is interfering with TLS. Contact our support with the output.

Step 2: check that the miner can mine over TLS

Set the miner's pool URL to stratum+ssl://stratum.braiins.com:3443 with your usual User ID. After a few minutes, the miner should show accepted shares and the worker should appear on your Braiins Pool dashboard.

If the miner cannot connect, try stratum+tls:// instead of stratum+ssl://. If it still cannot connect, its firmware may not support TLS, or may not support the type of certificate the pool uses. Check the log for the reason. The following steps only make sense once this step works.

Step 3: check that the miner verifies the hostname

This test needs no log: the miner either mines or it does not.

Find the pool's IP address. On a computer, run:

nslookup stratum.braiins.com

Use the address it returns (for example 172.65.65.63) in place of the hostname, and set this as the miner's only pool URL:

stratum+ssl://172.65.65.63:3443

It is the same Braiins Pool server as in step 2, but the certificate is issued for *.braiins.com, not for an IP address.

  • The miner does not mine: it checks that the certificate matches the name it connected to. This is the correct result.
  • The miner mines: it does not check the hostname. Any server with a valid certificate for any name could impersonate the pool. Do not rely on TLS with this firmware.

Step 4: check that the miner rejects untrusted and expired certificates

The public test service badssl.com runs servers with deliberately broken certificates. They are web servers, not pools, so the miner will never mine there. What matters is the error the miner reports in its log.

Set each of these as the miner's only pool URL, one at a time, and note the error in the log:

Test URLCertificate
stratum+ssl://badssl.com:443Valid (reference)
stratum+ssl://self-signed.badssl.com:443Self-signed, not issued by a trusted authority
stratum+ssl://wrong.host.badssl.com:443Valid, but issued for a different hostname
stratum+ssl://expired.badssl.com:443Expired

With the reference URL the TLS connection succeeds, and the miner then fails because the server does not speak Stratum. Expect an error about the pool or the protocol, not about the certificate.

How to read the results:

  • The miner validates certificates if all three broken URLs fail with a certificate or TLS handshake error, for example "UnknownIssuer", "unknown CA", "certificate not valid for name", "hostname mismatch" or "certificate expired".
  • The miner does not validate certificates if any broken URL fails the same way as the reference URL. It completed TLS with a certificate it should have rejected. Do not rely on TLS with this firmware. Use Stratum V2 or the Braiins SV2 Proxy instead.
  • No result if the log shows the same message for all four URLs, or no reason at all. Some firmware, for example Whatsminer, logs the same line in every case. Then this step cannot tell, and only step 3 gives an answer for that firmware.

For comparison, this is what Braiins OS, which validates certificates, writes for the three broken URLs (shortened):

TLS handshake with 'self-signed.badssl.com' failed
    invalid peer certificate: UnknownIssuer

TLS handshake with 'wrong.host.badssl.com' failed
    invalid peer certificate: certificate not valid for name "wrong.host.badssl.com"; certificate is only valid for DnsName("*.badssl.com") or DnsName("badssl.com")

TLS handshake with 'expired.badssl.com' failed
    invalid peer certificate: certificate expired: verification time 1795603312 (UNIX), but certificate is not valid after 1428883199 (366720113 seconds ago)

Summary

ResultMeaning
Step 2 mines, step 3 does not mine, step 4 shows three certificate errorsThe firmware validates certificates; TLS protects you
Step 3 minesHostname not checked; do not rely on TLS
Step 4: a broken URL fails like the referenceCertificate not checked; do not rely on TLS
Step 4 gives no resultPartly verified; prefer Stratum V2 or the proxy

When you are done, set the miner back to the protected pool URLs above and add its backup entries again.

If you test a firmware that is not listed in our documentation, we would like to hear the result. Send it to our support with the firmware name and version.


Was this helpful?