Users have been reporting the need to see private keys for use with MetaMask.
(We need to ensure that the mnemonic is in fact not sufficient and plan to include private key output)
This feature will be really appreciated because right now I have to import accounts on Metamask and I don't know where to find the private keys generated by Truffle.
I've made a PR on truffle-core which hard-codes the corresponding private keys and logs them.
Can we expect this feature on 4.0.2?
Until this gets merged, here are the private keys in text format so anyone can copy them into metamask. (Note: I OCR'ed an image from @NedYork in the PR. I verified the first one, but have not made sure the others came through correctly):
Private Keys:
(0) c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3
(1) ae6ae8e5ccbfb04590405997ee2d52d2b550726157b875055c56d94e974d162f
(2) odbbe8e4ae425a6d2687f1a7e5ba17bc98c675656790f1b8ad91195c05875ef1
(3) c88b705fb08cbea894b6aeff5a544fb92e78a18e19814cd85da85b71f772aa6c
(4) 588c684foba1ef5017716adb5d21a055ea8e90277d0868557519f97bede61418
(5) 659cbboe2411a44db65778987b1e22155c086a95eb6b18bdf89de078917abc65
(6) 82d052c865f5765aad42add458569276cood5d88a2d062d56b2bae914d58b8c8
(7) aa5680d5d48a8285415f7a108567c7299ca75f555755860a87b08f59595618b7
(8) Of62d96d6675f52685bbdb8ac15cda7c25456f65efbb9d07700d8669ff12b7c4
(9) 8d5566125cb560bb606579f90aobfd4769eecc0557f1b562dcae9012b548b1e5
Why would you want to copy these keys one by one into MetaMask?
Just pasting the mnemonic into MetaMask, then clicking the Create Account menu a few times would recreate them within MetaMask automatically, since they are derived from the mnemonic.
Is it about convenience, so you can mix these in with your other keys you have already added to MetaMask?
Is it even a good idea to do so?
@onetom that would be convenient. But I don't see a place to paste the phrase in metamask
@iamchrissmith some of the keys work and some do not - e.g. (5)
@arielgabizon you need to "logout" of metamask by hitting "Lock" and then below where you enter your password is the "restore from seed phrase" link

Some of the keys @iamchrissmith posted didn't work for me.
The correct keys can be found here (and pasted below): https://github.com/trufflesuite/truffle-core/blob/ab4281ff3363da4810168b750de6f525da20fd17/lib/commands/develop.js#L68
var privateKeys = [
'c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',
'ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f',
'0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1',
'c88b703fb08cbea894b6aeff5a544fb92e78a18e19814cd85da83b71f772aa6c',
'388c684f0ba1ef5017716adb5d21a053ea8e90277d0868337519f97bede61418',
'659cbb0e2411a44db63778987b1e22153c086a95eb6b18bdf89de078917abc63',
'82d052c865f5763aad42add438569276c00d3d88a2d062d36b2bae914d58b8c8',
'aa3680d5d48a8283413f7a108367c7299ca73f553735860a87b08f39395618b7',
'0f62d96d6675f32685bbdb8ac13cda7c23436f63efbb9d07700d8669ff12b7c4',
'8d5366123cb560bb606379f90a0bfd4769eecc0557f1b362dcae9012b548b1e5'
];
This will go out in the next release. Cheers!
If you restore the Metamask vault from the default seed phrase used by Truffle, doesn't it create a huge security problem when you create new accounts from Metamask on the main net? Anyone would be able to find the private key for this account, wouldn't they?
Can you please tell me which key generation algorithm is used by truffle suite for generating these keys?
@onikajnu you can see the implementation here: https://github.com/trufflesuite/truffle/blob/develop/packages/core/lib/mnemonics/mnemonic.js#L22-L33
Most helpful comment
@arielgabizon you need to "logout" of metamask by hitting "Lock" and then below where you enter your password is the "restore from seed phrase" link