MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.02k stars 4.91k forks source link

Encourage use of different cryptographic secrets for each network #3131

Open benjamincburns opened 6 years ago

benjamincburns commented 6 years ago

Givens/Assumptions

Current behavior

Today my only option for network-level compartmentalization is to save my secrets (seed phrases) somewhere outside of MetaMask (I'd recommend 1Password if you're using a digital medium), and then lock/restore from seed phrase every time I want to switch networks.

Enforcing this requires a high level of personal discipline, and even in when such discipline is exercised, accidentally using an account meant for one network on another network is still easier done than avoided.

Desired behavior

Seed phrases, private keys, and any other secrets should be associated with a particular network, and the UI should discourage reuse between private/trusted and public/untrusted networks by making doing so somewhat burdensome.

Proposed changes

What follows is an example of how I think this could be achieved, but my purpose in writing it is to illustrate the goal behind this change more so than to perfectly specify these changes. As such, please don't implement this as written without further consideration.

1. Though ideally these are still randomized to prevent this sort of thing. 2. The "trusted"/"untrusted" language was the best generic terminology I could come up with on short notice, and I'm not at all wedded to it. I just didn't quite like "Production/Test" or "Production/Development" because some testnets are public and therefore untrusted.

danfinlay commented 6 years ago

One issue I'd like to see this account for is post-plasma. When a user sends some ether into a plasma shard, will they be forced to use a different account within the shard? If so, that should be actively discussed w/ plasma people.

benjamincburns commented 6 years ago

When a user sends some ether into a plasma shard, will they be forced to use a different account within the shard?

@danfinlay we can talk face-to-face on this, but I'm not familiar with plasma. However, In terms of security, I'd regard a sharded network as one environment, so using different secrets per shard would be overkill. However, I thought one of the key requirements of sharded networks was account affinity to a particular shard. If that assumption holds in plasma (assuming it was ever correct at all), then I'd think that MetaMask would need to handle the account->shard mapping, anyway.

Either way, I'd think that while we should make sure that a solution to this issue doesn't preclude a solution to plasma sharding, I'd hope that addressing sharding shouldn't block this issue.

danfinlay commented 6 years ago

This may be a good idea, but it will take a while before it can get to production since it touches pretty much every part of our architecture, from UI, down to undefined behavior for existing users who may need a migration path, so there would be a lot of work involved in moving to this.