Ethereum: Practical way to split a bip39 seed into a 2 out of 3 factor auth?

Securing Your Ethereum Seed with 3-Factor Authentication

As an Ethereum user, you are aware of the importance of keeping your seed private and secure. However, you may be wondering how to break your mnemonic code into smaller sections, known as “3-factor authentication,” which allows you to recover your Trezor wallet from a paper backup without having all three parts. This approach is often referred to as “2-factor authentication” .

In this article, we will dive into the practical ways to achieve this secure and efficient method of managing your Ethereum seed.

Understanding Mnemonic Codes and 3-Factor Authentication

A mnemonic code is a string of words that represents the private key of an Ethereum wallet. It is typically generated using a 12-word phrase or sentence associated with your personal information, such as your name, date of birth, or password. The mnemonic code serves as the “seed” for your Ethereum address.

Multi-factor authentication is a method of breaking down a mnemonic code into smaller sections, called “factors.” These factors are used to recover the private key from a paper backup. 2-factor authentication out of 3 means that you need two of these factors to recover your wallet, and one of them can be obtained from a paper backup.

Dividing Your Mnemonic Code into Factors

To divide your mnemonic code into three factors using Ethereum’s multi-factor authentication standard (EIP-1559), follow these steps:

  • Generate a new mnemonic code: Create a new 12-word phrase or sentence for the new seed.
  • Create an interface to display the mnemonic code

    : Write a script in a language like Solidity that displays the mnemonic code on the screen and prompts the user for input (e.g., “Enter your name”) until two factors are entered correctly.

Here’s a basic example of how you could implement this:

pragma solidity ^0.8.0;

contract FactorAuth {

mapping(address => string) public mnemonics;

function displayMnemonic(string memory _mnemonic) public display returns (string memory, string memory) {

for (uint256 i = 0; i < 12; i++) {

string memory tempMnemonics = _mnemonic;

if (i == 6 && i == 9 || i == 12) {

tempMnemonics += "yourname";

}

mnemonics[msg.sender] = tempMnemonics;

}

}

function getTwoFactors(string memory _mnemonic, string memory _input) public view returns (string memory, string memory) {

uint256 i = 0;

while (i < 2 && i < 12) {

if (mnemonics[_mnemonic].contains(_input)) {

return mnemonics[_mnemonic][i] + "your name";

}

i++;

}

return ("", "");

}

function getOneFactor(address _address) public view returns (string memory) {

for (uint256 i = 0; i < 12; i++) {

if (mnemonics[_address].contains(mnemonics[msg.sender][i])) {

return mnemonics[_address][i];

}

}

return "";

}

}

Recovering your Trezor wallet

To recover your wallet using two factors, follow these steps:

  • Make a paper copy of your seed: Store the correct two factors safely.
  • Enter a factor from your paper backup: Use the first factor to unlock the wallet and access your funds.

Once you have recovered your wallet, use the third factor (from the original mnemonic code) to generate a new mnemonic or reuse an existing one for added security.

Conclusion

Dividing your mnemonic code into factors provides an additional layer of security when storing your Ethereum seed. By following the EIP-1559 standard and creating a custom interface to display the mnemonic code, you can create this handy method for securing your seed.

Metamask Recover Public Python

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top