Skip to content

Commit 86a64f1

Browse files
committed
incorporate improment suggestions
1 parent 729f412 commit 86a64f1

File tree

1 file changed

+49
-13
lines changed

1 file changed

+49
-13
lines changed

bip-0085.mediawiki

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,30 +366,61 @@ Application number: 828365'
366366

367367
The derivation path format is: <code>m/83696968'/828365'/{key_type}'/{key_bits}'/{key_index}'</code>
368368

369-
The key_type values are defined as follows:
369+
All path components are hardened (denoted by <code>'</code>). The key_type values are plain integers:
370370

371371
{|
372372
!OpenPGP Key Type
373-
!key_type value
373+
!key_type
374374
|-
375375
| RSA
376-
| 0'
376+
| 0
377377
|-
378378
| ECC(Curve25519)
379-
| 1'
379+
| 1
380380
|-
381381
| ECC(secp256k1)
382-
| 2'
382+
| 2
383383
|-
384384
| ECC(NIST)
385-
| 3'
385+
| 3
386386
|-
387387
| ECC(Brainpool)
388-
| 4'
388+
| 4
389389
|-
390390
|}
391391

392-
The RSA key generator should use BIP85-DRNG as the input RNG function. Likewise, any ECC key types over 256 bits should use BIP85-DRNG.
392+
The valid key_bits values and corresponding algorithms for each key_type are:
393+
394+
{|
395+
!key_type
396+
!key_bits
397+
!OpenPGP Algorithm / Curve
398+
|-
399+
| 0 (RSA)
400+
| 1024, 2048, 4096
401+
| RSA
402+
|-
403+
| 1 (Curve25519)
404+
| 256
405+
| Ed25519 (certify/sign/auth), X25519 (encrypt)
406+
|-
407+
| 2 (secp256k1)
408+
| 256
409+
| secp256k1
410+
|-
411+
| 3 (NIST)
412+
| 256, 384, 521
413+
| NIST P-256, P-384, P-521 respectively
414+
|-
415+
| 4 (Brainpool)
416+
| 256, 384, 512
417+
| brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 respectively
418+
|-
419+
|}
420+
421+
For key_types with a fixed curve (1 and 2), key_bits MUST be 256. Any other value is invalid.
422+
423+
BIP85-DRNG MUST be used as the input RNG function when key generation requires more than 64 bytes of random input. This applies to all RSA key sizes and to NIST P-521 (key_bits=521). All other supported ECC key types use the 64-byte HMAC output directly.
393424

394425
====Primary Keys and Subkeys====
395426

@@ -406,9 +437,15 @@ Keys allocated for GPG purposes use the following scheme:
406437
407438
All subkeys SHOULD use the same key_type as the primary key. Mixed key types across primary and subkeys are out of scope for this specification. Additional subkeys may be added following the same role pattern, incrementing the sub_key index.
408439

440+
For key_type 1 (Curve25519), the OpenPGP algorithm used depends on the key capability, because Curve25519 takes different forms for signing versus encryption in the OpenPGP standard:
441+
* CERTIFY, SIGN, and AUTHENTICATE capabilities use Ed25519 (EdDSA)
442+
* ENCRYPT capability uses X25519 (ECDH)
443+
444+
This means the primary key and sub_keys 1 (auth) and 2 (sign) under key_type 1 produce Ed25519 keys, while sub_key 0 (encrypt) produces an X25519 key. The same derived entropy bytes are interpreted according to the required algorithm.
445+
409446
<b>Note on timestamps:</b>
410447

411-
The resulting RSA key can be used to create a GPG key where the creation date MUST be fixed to unix Epoch timestamp 1231006505 (the Bitcoin genesis block time <code>'2009-01-03 18:05:05'</code> UTC) because the key fingerprint is affected by the creation date (Epoch timestamp 0 was not chosen because of legacy behavior in GNUPG implementations for older keys). Additionally, when importing sub-keys under a key in GNUPG, the system time must be frozen to the same timestamp before importing (e.g. by use of <code>faketime</code>).
448+
All keys derived under this application MUST use a fixed creation date of unix Epoch timestamp 1231006505 (the Bitcoin genesis block time <code>'2009-01-03 18:05:05'</code> UTC) when constructing the OpenPGP key packet, because the key fingerprint is affected by the creation date (Epoch timestamp 0 was not chosen because of legacy behavior in GNUPG implementations for older keys). Additionally, when importing sub-keys under a key in GNUPG, the system time must be frozen to the same timestamp before importing (e.g. by use of <code>faketime</code>).
412449

413450
<b>Note on GPG key capabilities on smartcard/hardware devices:</b>
414451

@@ -469,16 +506,15 @@ BIP32, BIP39
469506
470507
==Changelog==
471508

472-
===2.0.0===
509+
===2.0.0 (2026-02-27)===
473510

474511
====Added====
475512

476-
* ECC GPG key types for OpenPGP: Curve25519 (key_type 1'), secp256k1 (key_type 2'), NIST (key_type 3'), Brainpool (key_type 4')
513+
* ECC GPG key types for OpenPGP under application 828365': Curve25519/key_type=1, secp256k1/key_type=2, NIST/key_type=3, Brainpool/key_type=4
477514
478515
====Changed====
479516

480-
* GPG key section restructured to use a single application number (828365') with <code>key_type</code> as a path level component, replacing separate per-type application numbers
481-
* RSA GPG derivation path changed from <code>m/83696968'/828365'/{key_bits}'/{key_index}'</code> to <code>m/83696968'/828365'/0'/{key_bits}'/{key_index}'</code> (breaking change)
517+
* RSA application 828365' (introduced in 1.1.0) extended with a <code>key_type</code> path component (key_type=0 for RSA) to unify all OpenPGP key types under a single application number; RSA derivation path changed from <code>m/83696968'/828365'/{key_bits}'/{key_index}'</code> to <code>m/83696968'/828365'/0'/{key_bits}'/{key_index}'</code> (breaking change for existing RSA implementations)
482518
483519
===1.3.0 (2024-10-22)===
484520

0 commit comments

Comments
 (0)