Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEP-0046: Key Sharing Method for Stellar Keys #1601

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
173 changes: 172 additions & 1 deletion ecosystem/sep-0005.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Title: Key Derivation Methods for Stellar Keys
Author: SDF
Status: Final
Created: 2017-11-09
Updated: 2020-06-16
Updated: 2025-01-03
```

## Simple Summary
Expand Down Expand Up @@ -48,6 +48,18 @@ mnemonic code.

We strongly recommend using 24 word mnemonic (256 bits of entropy).

### Sharing Mnemonic Codes

Shamir Secret Sharing (SSS) method, as described in
[SLIP-0039](https://github.com/satoshilabs/slips/blob/master/slip-0039.md) should be used as a way to split a
mnemonic code into multiple parts. SSS is a two-layer scheme: _G_ groups are split into _N_ distinct members.
_g_ ≤ _G_ groups are required to reconstruct the mnemonic. Each group being comprised of a specific threashold of
members 1 ≤ _t_ ≤ _N_.

The entropy (which can be derived from a mnemonic code) should be used to derive the multiparts menomonic.
The parts are non-deterministic and any derivation leads to the same set of keys. As recommended for single
mnemonic codes, we recommend using 256 bits of entropy. Which leads to 33 word mnemonic phrases.

## Rationale

`BIP`s and `SLIP`s are industry standards used by a majority of cryptocurrencies and software/hardware wallets.
Expand All @@ -69,6 +81,12 @@ Mnemonic (12 words):
illness spike retreat truth genius clock brain pass fit cave bargain toe
```

Entropy:

```
713a3ae074e60e56c6bd0557c4984af1
tupui marked this conversation as resolved.
Show resolved Hide resolved
```

BIP39 Seed:

```
Expand Down Expand Up @@ -96,6 +114,25 @@ m/44'/148'/8' GDJTCF62UUYSAFAVIXHPRBR4AUZV6NYJR75INVDXLLRZLZQ62S44443R SCD5OSHUU
m/44'/148'/9' GBTVYYDIYWGUQUTKX6ZMLGSZGMTESJYJKJWAATGZGITA25ZB6T5REF44 SCJGVMJ66WAUHQHNLMWDFGY2E72QKSI3XGSBYV6BANDFUFE7VY4XNXXR
```

Shamir Secret Sharing shares (non-deterministic) - group threshold = 2; groups = [(2, 3), (1, 1), (2, 3)]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Stellar keys of BIP 39 and the Stellar keys of SLIP 39 are different. Are you willing to add it?

Additionally, this part only applies to BIP-39. Can you specify that? For example, m/44'/148' key (BIP39):

m/44'/148' key:

e0eec84fe165cd427cb7bc9b6cfdef0555aa1cb6f9043ff1fe986c3c8ddd22e3

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Stellar keys of BIP 39 and the Stellar keys of SLIP 39 are different. Are you willing to add it?

Sorry I don't understand what you mean.

Copy link
Author

@tupui tupui Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now (linked to the other PR.) If I start from the entropy and use it directly then yes keys will be different. To get the same keys I need to go with the to_bip39 as I had before. I wanted to have everything being consistent with a single set of Stellar Keys. But if we can't because we say we don't want to use BIP39 as transition then I can make a specific section for SLIP39 as you suggested.

(Would be so much easier to just use the normal mnemonic phrase as a secret for Shamir 😅)


```
[['parking evoke acrobat leaf camera artwork trial unhappy welcome speak vocal '
'formal spend phrase raisin genre beaver custody change kind',
'parking evoke acrobat lily bike clothes injury category boundary shaped '
'firefly order stadium scroll check herald estate desert cultural acrobat',
'parking evoke acrobat lungs acne fortune retailer glasses pile toxic '
'rebound spray software gross package style grin pipeline work finger'],
['parking evoke beard leader cradle alpha junction vintage adequate railroad '
'column ceiling view plunge learn intimate location invasion repair filter'],
['parking evoke ceramic leaf credit perfect violence cleanup trip email '
'forward easy playoff slap parcel else center primary both smell',
'parking evoke ceramic lily apart response nuclear frozen jump arcade fatal '
'jewelry segment ladybug pajamas junior distance subject away recall',
'parking evoke ceramic lungs category music crunch ruin ancient spill coal '
'chubby volume prospect party corner soul likely afraid sharp']]
```

### Test 2

Mnemonic (15 words):
Expand All @@ -104,6 +141,12 @@ Mnemonic (15 words):
resource asthma orphan phone ice canvas fire useful arch jewel impose vague theory cushion top
```

Entropy:

```
b781c27351c7024355cf7f0b0efdc7f85e046cf9
```

BIP39 Seed:

```
Expand Down Expand Up @@ -131,6 +174,32 @@ m/44'/148'/8' GD3KWA24OIM7V3MZKDAVSLN3NBHGKVURNJ72ZCTAJSDTF7RIGFXPW5FQ SBDNHDDIC
m/44'/148'/9' GB3C6RRQB3V7EPDXEDJCMTS45LVDLSZQ46PTIGKZUY37DXXEOAKJIWSV SDHRG2J34MGDAYHMOVKVJC6LX2QZMCTIKRO5I4JQ6BJQ36KVL6QUTT72
```

Shamir Secret Sharing shares (non-deterministic) - group threshold = 2; groups = [(2, 3), (1, 1), (2, 3)]:

```
[['party buyer acrobat leaf broken database scatter prevent voting glance '
tupui marked this conversation as resolved.
Show resolved Hide resolved
'metric inmate clock harvest smug aide grownup observe tofu auction idle '
'scandal enemy',
'party buyer acrobat lily check muscle vintage glance society greatest '
'retreat valid repair swimming tofu science dismiss amuse laser mansion '
'airport wealthy failure',
'party buyer acrobat lungs human friar picture density resident again hairy '
'response academic afraid artist lunar superior research inform science item '
'arena python'],
['party buyer beard leader organize eclipse airline exercise secret smell '
'headset champion minister satisfy furl losing arcade undergo cleanup lend '
'multiple paper flexible'],
['party buyer ceramic leaf universe violence stay amount painting cultural '
'wolf elbow minister fiscal reaction lizard envelope unfair moment counter '
'disease rhyme leaves',
'party buyer ceramic lily reward emphasis photo aluminum training magazine '
'veteran western spelling yield overall curly theater romp simple racism '
'paper animal punish',
'party buyer ceramic lungs envelope moment destroy silent decent golden wits '
'ranked beam hairy volume fatal airport raspy document sniff educate worthy '
'phantom']]
```

### Test 3

Mnemonic (24 words):
Expand All @@ -139,6 +208,12 @@ Mnemonic (24 words):
bench hurt jump file august wise shallow faculty impulse spring exact slush thunder author capable act festival slice deposit sauce coconut afford frown better
```

Entropy:

```
150df9e3ab10f3f8f1428d723a6539662e181ec8781355396cec5fc2ce08d760
```

BIP39 Seed:

```
Expand Down Expand Up @@ -166,6 +241,38 @@ m/44'/148'/8' GDHX4LU6YBSXGYTR7SX2P4ZYZSN24VXNJBVAFOB2GEBKNN3I54IYSRM4 SCGMC5AHA
m/44'/148'/9' GDXOY6HXPIDT2QD352CH7VWX257PHVFR72COWQ74QE3TEV4PK2KCKZX7 SCPA5OX4EYINOPAUEQCPY6TJMYICUS5M7TVXYKWXR3G5ZRAJXY3C37GF
```

Shamir Secret Sharing shares (non-deterministic) - group threshold = 2; groups = [(2, 3), (1, 1), (2, 3)]:

```
[['tactics thorn acrobat leaf aviation trend regular elbow desert leaf warn '
'chemical huge river pupal grumpy retreat grownup herd counter species '
'license buyer orbit wits bundle husband robin exotic chest debut deny dish',
'tactics thorn acrobat lily average calcium yoga wisdom diploma usher furl '
'impulse dominant puny lunar profile slow loyalty practice uncover friendly '
'platform justice starting sled yelp satoshi heat rebuild royal junction '
'damage wavy',
'tactics thorn acrobat lungs avoid empty diet document license column '
'process license season patrol stick nylon focus tenant wavy smell task '
'eyebrow space garlic dance mountain artwork capacity busy gather ambition '
'employer fused'],
['tactics thorn beard leader aircraft energy desktop paid dive kitchen '
'marathon geology tactics seafood visual duration dough mountain oral nail '
'fact dominant decent warmth skin orange deploy artwork necklace material '
'jewelry guitar gums'],
['tactics thorn ceramic leaf antenna spine nervous patent invasion wine '
'maximum recall shame observe daughter mobile ending numb railroad rocky '
'vampire editor drug idle seafood geology black wrist view bike course alarm '
'nail',
'tactics thorn ceramic lily angry jewelry step coastal necklace force '
'meaning machine cleanup satisfy secret rescue starting kind humidity '
'forward party jerky garbage empty scroll usual march index gasoline playoff '
'talent knit calcium',
'tactics thorn ceramic lungs amuse silver briefing pistol reject duke '
'maximum party provide true therapy promise gray blessing broken inside firm '
'invasion wavy broken screw else dynamic timber system cluster distance dive '
'genuine']]
```

### Test 4

Mnemonic (24 words + BIP 39 passphrase):
Expand All @@ -176,6 +283,12 @@ cable spray genius state float twenty onion head street palace net private metho
p4ssphr4se
```

Entropy:

```
1ffa5d83ea6593d666b350d6f3e652d598c3063ab51ed4c2e9d6a1d07c8545df
```

BIP39 Seed:

```
Expand Down Expand Up @@ -203,6 +316,39 @@ m/44'/148'/8' GDS5I7L7LWFUVSYVAOHXJET2565MGGHJ4VHGVJXIKVKNO5D4JWXIZ3XU SAIZA26BU
m/44'/148'/9' GBOSMFQYKWFDHJWCMCZSMGUMWCZOM4KFMXXS64INDHVCJ2A2JAABCYRR SDXDYPDNRMGOF25AWYYKPHFAD3M54IT7LCLG7RWTGR3TS32A4HTUXNOS
```

Shamir Secret Sharing shares (non-deterministic) - group threshold = 2; groups = [(2, 3), (1, 1), (2, 3)]:

```
[['elevator fawn acrobat leaf august plot harvest welcome domestic junction '
'force marvel trash prune profile preach robin observe phantom moment energy '
'exercise argue category python swing miracle quiet ticket drove intimate '
'laundry intimate',
'elevator fawn acrobat lily agree fake subject mayor darkness adorn market '
'resident picture elephant exhaust umbrella timber military rhythm walnut '
'prevent deny afraid advance envelope ounce scene clay beard valuable goat '
'freshman leaf',
'elevator fawn acrobat lungs answer sugar become believe beaver skunk '
'undergo lying sprinkle soldier intimate exotic predator execute moisture '
'cause level decorate become august tracks observe duckling vexed review '
'percent execute lair dough'],
['elevator fawn beard leader acrobat maiden general racism elite hush rich '
'paces have cleanup bracelet aunt violence making bracelet herald careful '
'fatal literary ivory hour home auction cowboy increase chew crucial hamster '
'miracle'],
['elevator fawn ceramic leaf acid plan carve ultimate building paper brother '
'vampire edge lying energy grief location index multiple depart hour costume '
'radar observe crowd strategy duke perfect beard mouse craft marathon '
'explain',
'elevator fawn ceramic lily angry always buyer forward elephant slice '
'charity loyalty miracle tadpole strike kitchen taught pecan havoc domestic '
'holy railroad hawk invasion flip slice vanish level glad level maiden elbow '
'umbrella',
'elevator fawn ceramic lungs agree holiday browser twice anatomy wrote '
'hamster inform flash coding gasoline dragon evidence survive insect exact '
'guitar beaver best element sled usual reward unhappy ending replace ladybug '
'jump profile']]
```

### Test 5

Mnemonic (12 words - entropy bytes: `00000000000000000000000000000000`):
Expand All @@ -211,6 +357,12 @@ Mnemonic (12 words - entropy bytes: `00000000000000000000000000000000`):
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
```

Entropy:

```
00000000000000000000000000000000
```

BIP39 Seed:

```
Expand Down Expand Up @@ -238,6 +390,25 @@ m/44'/148'/8' GABTYCZJMCP55SS6I46SR76IHETZDLG4L37MLZRZKQDGBLS5RMP65TSX SC6N6GYQ2
m/44'/148'/9' GAKFARYSPI33KUJE7HYLT47DCX2PFWJ77W3LZMRBPSGPGYPMSDBE7W7X SALJ5LPBTXCFML2CQ7ORP7WJNJOZSVBVRQAAODMVHMUF4P4XXFZB7MKY
```

Shamir Secret Sharing shares (non-deterministic) - group threshold = 2; groups = [(2, 3), (1, 1), (2, 3)]:

```
[['talent fawn acrobat leaf beyond scene findings total survive ounce smell '
'finance bishop buyer render flip diagnose dish leaves impact',
'talent fawn acrobat lily beyond percent wits surface kidney envelope order '
'emperor pancake receiver plan firefly hush resident screw club',
'talent fawn acrobat lungs beyond agree already memory bulb cover adult '
'scout document failure video therapy jump obtain agency cards'],
['talent fawn beard leader custody magazine fact laden award smirk velvet '
'exhaust miracle hamster sharp black mouse vintage syndrome finger'],
['talent fawn ceramic leaf depict emission froth database smell smear exotic '
'island level estimate display favorite award river paces parcel',
'talent fawn ceramic lily dining tolerate priest tendency humidity early '
'spend antenna episode spray mental grasp literary acrobat flavor grief',
'talent fawn ceramic lungs downtown broken snake peanut aluminum desktop '
'large damage spine herd dramatic lizard bulge alpha election fatigue']]
```

## Reference Implementation

- Console HD wallet: https://github.com/stellar/go/tree/master/tools/stellar-hd-wallet
Expand Down