Open MisterTicot opened 5 years ago
There is another option to archive this and it's on my TODO list.
I need to extend TrezorConnect.manifest
function with requested permissions, for example it could be called like this:
TrezorConnect.manifest({
email: 'dev@email.com',
appUrl: 'some.app.com',
permissions: [
{
type: 'read',
coins: ['btc', 'xlm']
accounts: ["m/49'/0'/0'", "m/44'/148'/0'"]
},
{
type: 'write',
coin: ['bitcoin', 'stellar']
accounts: ["m/49'/0'/0'", "m/44'/148'/0'"]
},
],
});
Once granted will never ask for export in popup, however if you decide get keys/addresses/whatever from the account which is not specified in manifest (in this case "m/44'/148'/1'") then confirmation screen will appear
Motivation
Exporting pubkeys to application involves user interactions that could be skipped without weakening Trezor security model.
Current situation
At that time, we have to confirm the export of the same pubkeys to the same applications each time we want to use it. This is redundant & annoying.
Case 1:
Ask me again
Unless user checked
Don't ask me again
, pubkey exportation involves two interaction:export
.Case 2:
Don't Ask me again
Only interaction 2 will show (confirm exportation).
Possible Improvements
Option 1: provide a device ID
Applications could use a device ID that would be accessible through TrezorConnect without any user interaction or popup (providing the device is unlocked). Then, applications could save this ID along with device pubkeys, and use it to retrieve pubkeys without use interaction.
For this to work, applications need a way to know when device have been reset so it can flush old pubkeys & import again.
Drawback: Privacy concern of storing pubkeys application-side.
Option 2: improve TrezorConnect interaction
For
Case 1
, both interactions could get merged into one. The authorization becomes an authorization of exporting key(s) K to application A.For
Case 2
, if the requested keys have already been authorized throughCase 1
, export without interaction. Else, fallback toCase 1
.Alternatively, the TrezorConnect class could give immediate access to all user-authorized keys through a
knownKeys
parameter. This would probably be the most comfortable setup for programmers.