hey @Bunjin, great proposal! We’ve been thinking about something similar to this in Status for a long time, getting the derivation path from ENS names, and I like this solution! we would love to contribute to this and implement it when it’s finalized.
I also think this can work on top of eip-1581, what do you think?
I saw this in the proposal this:
But EIP-1581 only defines a standard way to derive non-wallet keys, without requiring apps to be registered. Only the key_type should be, so in this case the key type can be apps / dapps, and the the sub paths what you already proposed, which I like especially in the way we can get the derivation path from a ENS name.
So if we have both we can have general non-wallet keys not based on app/domains, and apps keys based on specific apps/dapps.
First of all BIP 43’ is not a purpose field since it’s the global standard for the purpose field structure. BIP44 is BIP 43 compliant. If we deviate from BIP44, we need a different purpose field than 43 and 44 altogether.
Second, it uses coin type 60, which I think is not necessary here. We already have the BIP44 structure of main accounts for transacting Ether, here we are trying to define applications keys, which are not Ethereum specific, so I don’t think we need a coin type field there.
Third EIP 1581 would like to introduce a key type field which poses several questions imho.
Why separate the keys by what this EIP calls type?
The EIP says for this field:
Describes the purpose for which the key is being used.
What key types does this EIP propose? Where are they referenced, how is this list maintained? But a key is a key, there are no key types by definition, only potentially by use. We don’t need impose to split the keys by purpose, or at least we don’t need to impose that. What would be the benefit of this field?
More importantly EIP1581 is silent about authentication. How does one request access to a given key (key type and key index)? How does one prove he is using the key type required?
What’s preventing you to use EIP1775 for “non wallet usage of keys”? An application authenticated through its name and then gets access to the keys for its domain (we are not retricted to DNS or ENS names).
If you’d like to introduce a general application such as “ssh” at the wallet level, then we can use EIP1775 to derive keys for this domain’s name and skip authentication.
So all things considered I think the EIP we propose here is more global than EIP1581 and that it solves several issues of EIP1581.
Why would you like to preserve EIP1581, what do you think that EIP would allow that EIP1775 would not?
Purpose code 43 is reserved for usage by non-Bitcoin cryptocoins. In this case, the level immediately below the purpose code is hardened derivation using the index for the cryptocoin specified by SLIP-0044. The details of levels below this coin type are to be entirely decided by the standard process of the specific cryptocoin, but it is recommended that the very next level be a sub-purpose code with a similar use as this BIP’s purpose code.
So that the recommended use for non-Bitcoin cryptocoins is: m / 43' / coin_type' / subpurpose' / ...
that’s why we ended up using that path.
In our case we were thinking about 2 different native chat apps, where a user can recover an account from the mnemonic and in both apps use the same keys, so different apps where the only common thing is the “purpose” of the key (chat, storage, etc…). I see the difference since in the other case it’s a wallet/dapp-browser that manages the keys for the current app.
Yeah you are completely right! A key is a key, so it can be used for anything. But in our case we wanted to have a standard based on the purpose so that if I’m chatting with you, I can change to a different native app and still using the same key if the other client uses the right “chat” key. Same like BIP44, I can change wallet but I have the same keys based on the coin type.
Yeah that’s not covered because it’s not intended to be chosen by a dapp, but by the wallet itself. I see your point though, that’s why I thought 1775 can add those points on top of 1581.
I’m still thinking about a native app. What would you use instead of the dapp domain or name so that the same key can be shared in different apps?
Let’s see if we can find some common points, or maybe they are just 2 completely different use cases and it’s fine too
So in any case if you are willing to use BIP44, I think you should use purpose field 44’ and not 43’, no matter the coin type.
HD path BIP43 deviating from BIP44:
When deviating from BIP44, one should use a different purpose field than 44’ but it has not been standardized to use 43’ and cointype’.
In fact several other indexes have been already used and standardized see:
and what I mention in the EIP, where I reference all these:
Importantly, I don’t see why these standards should be related to a coin type and I would refuse to restrict to what luke JR suggested (that wasn’t merged) as :
m / 43' / coin_type' / subpurpose' /
Imho that’s too restrictive to subject these to a coin_type.
B] Now about your use case and how EIP1775 could allow for it:
I understand and agree that it’s an important use case to be able to implement non transacting, cross apps/domains keys (for instance for chat or others).
For that I see two alternatives:
develop an EIP alongside 1775, such as yours
but then I’d recommend to use a different purpose field than 43 and 44, and not used already also I think we should remove the coin type since apps such as chat are not necessarly related to a coin.
[I favor this approach for the sake of simplicity] Use EIP 1775 to encompass all in the following way:
For cross applications non transacting keys (not main accounts), we need a different naming scheme than DNS or ENS and we assume that the wallet or the clients will not have to authenticate these but will include them in their core logic.
This naming scheme would be something like cak:[name]
where cak (cross app key is just a header that allows to fully distinguish these from DNS/ENS) and name is the standardized name of the use case.
e.g.: cak:whisper, cak:ssh, cak:swarm …
we also need to specify the hashing scheme for these in a way that ensures no collision with the current hashing in EIP1775 of ENS/DNS names. It should be fairly easy.
With this 2nd approach, this would mean 3 types of keys:
main accounts (along BIP44 eth standard, and potentially for other cryptocurencies too)
EIP1775 app specific keys authenticated through ENS and/or DNS
EIP1775 cross apps/domains keys not authenticated but included in the wallet/client.
There is no standardised prefix for coins other than Bitcoin besides BIP44 - which is organised around UTXO coins and one specific use-case. Given the Bitcoin community’s resistance to expending effort on helping other projects with standardisation, it’s unlikely we’ll ever have one - so the unmerged proposal from luke-jr is the closest we’re likely to come.
It’s definitely in contravention of BIP44 to use m/44'/60'/ as a prefix and not use the remaining fields as specified.
I’m not sure why you think this is a restriction, or unacceptable. Can you clarify?
When there’s multiple independent teams trying to use a namespace without collisions, we need a way to divide it up to ensure that collisions don’t happen. Using this proposal is one way to do that, and allows us to define any subtree we want without any chance of overlap.
using hashes generates very long paths, which is a performance issue for resource-limited wallets like the Keycard or the Ledger (there can even be limits on the allowed nesting in some wallets). This is the reason why we went with a key usage specifier instead in EIP-1581 for the general case, still allowing a hashing scheme like the one defined in EIP-1775 to be implemented in the key_index field
Of course, I’ll try to clarify. Imho the EIP1775 or also EIP1581 are transversal to all cryptocurrencies and even more global than that because one could like to use chat keys or application specific keys without using any cryptocurrency. Thus EIP1775 or EIP1581 should in fact be global Crypto IPs.
Therefore any standard we propose here should not be a subset of a coin_type. I know that it’s only something that’s in the HD path, but I think it would matter and for instance that would mean that if other cryptocurrencies teams would like to use app keys or non wallet keys, then they would use a path that includes Ethereum coin_type which is kind of weird and would lead to confusion imho.
I fully agree about the need to avoid collision in a proper way. What you suggest is one way indeed (and it relies on the IPs list to be fully separated within each “cryptocurrency space”), however like I mentioned above it imposes a separation per crypto currency (and these to be subjected to cryptocurrencies).
What we propose here is another approach to avoid collision: using a purpose field list, which in any case will be required at the BIP43 level since several purpose fields are already in use (and some of them are not BIP related).
In any case, I’m open to solving this in another way, similar to what you subject but philosophically (and not only) I’m against imposing the use of a coin_type in the path for the reasons mentioned above.
As I said - the presence of the coin type field is only namespacing. It doesn’t limit the use of the standard, it’s simply where it’s defined. You’re defining something in the EIP process; the only part of the namespace you can issue yourself is the part (nominally) controlled by that process.
Analagously, suppose you’re producing a product for sale worldwide, and you need a UPC (barcode) number. Because you are in the US, your UPC codes will be prefixed with that because that is where the product originated - but that says nothing about where the product can be sold.
The root of the HD key namespace is controlled by BIP43, which says that the first field will be a BIP number. If you want to use any part of the namespace other than the one we’ve managed to get somewhat ad-hoc allocated to non-Bitcoin projects, you’ll need to write a BIP and get it approved. The EIP process can’t help with that.
Great analogy, however for this proposal, I think we would be more in a situation where we are defining a new way of defining bar codes (fully compatible with the previous technology), defining a core standard for wallets, not labeling a product.
For the sake of pragmatism, I’m ok with using a path like you suggest (m/43’/60’/1775’) but there may be an advantage of using a child depth of 1 (like I initially suggested) for the purpose field is that it’s obviously less depth than 3 and thus less computationally heavy (see comments by @bitgamma above).
Another option may be indeed to submit part of this as a BIP to claim a first depth BIP43 purpose field.
Since the prefix is fixed it doesn’t add much to computation time, it can be easily computed once, cached and used as the derivation root for this kind of key (of course, this requires changes to the firmware). What is more of concern is the dynamic part of the key, especially when using hashes or random UIDs, since it changes completely from app to app without any common prefix.