Skip to content

Commit cbb4a23

Browse files
committed
Use simple version as an encoding prefix for authority pubkeys
- Don't use fancy prefixes
1 parent 3ee0a76 commit cbb4a23

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

04-Protocol-Security.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -371,21 +371,27 @@ At least, it can be published on the pool's public website.
371371

372372
The key can be embedded into the mining URL as part of the path.
373373

374-
Authority Public key is encoded as a 32-byte secp256k1 public key (with implicit Y coordinate), prefixed with `[0x4b, 0x69]`, in [base58-check](https://en.bitcoin.it/wiki/Base58Check_encoding) encoding.
374+
Authority Public key is [base58-check](https://en.bitcoin.it/wiki/Base58Check_encoding) encoded 32-byte secp256k1 public key (with implicit Y coordinate) prefixed with a LE u16 version prefix, currently `[1, 0]`:
375375

376-
The prefix `[0x4b, 0x69]` ensures that all possible public keys start with prefix `CA` in base58-check representation.
376+
```
377+
+--------------+-------------------------------------------------------------------------------------------------------+
378+
| [1, 0] | 2 bytes prefix |
379+
+--------------+-------------------------------------------------------------------------------------------------------+
380+
| PUBKEY | 32 bytes authority public key |
381+
+--------------+-------------------------------------------------------------------------------------------------------+
382+
```
377383

378-
E.g.:
384+
URL example:
379385

380386
```
381-
stratum2+tcp://thepool.com/CA2JBhdpuesgbHENcRJs4T9KpCpuUiFpcnLyQGeu4A6gbry7ArBe
387+
stratum2+tcp://thepool.com/9bXiEd8boQVhq7WddEcERUL5tyyJVFYdU8th3HfbNXK3Yw6GRXh
382388
```
383389

384390
### 4.6.1 Test vector:
385391

386392
```
387393
raw_ca_public_key = [118, 99, 112, 0, 151, 156, 28, 17, 175, 12, 48, 11, 205, 140, 127, 228, 134, 16, 252, 233, 185, 193, 30, 61, 174, 227, 90, 224, 176, 138, 116, 85]
388-
prefixed_base58check = "CA2JBhdpuesgbHENcRJs4T9KpCpuUiFpcnLyQGeu4A6gbry7ArBe"
394+
prefixed_base58check = "9bXiEd8boQVhq7WddEcERUL5tyyJVFYdU8th3HfbNXK3Yw6GRXh"
389395
```
390396

391397

0 commit comments

Comments
 (0)