Ok as a developer my first response is: Do not re-invent the god damn wheel!... But here is how you do it:
- Get the bip39 list in the language of your preference (here is the english one
bips/english.txt at master · bitcoin/bips · GitHub).
- Pick 24 words in an fully random way (btw this is not enough to ensure entropy but since you want to do it yourself)
- Use the 24 words to generated a master seed (from here you will generate private keys), you do this by generating a hash using a PBKDF2 method with those 24 words as the︀ source (you can use a passphrase which is normally known as a 25th words mnemonic︁ phrase which I think is misleading but hey I don't make the rules here)
- From the master seed that you got you now need to generate the keys from︂ it based on the blockchain you're using, so here comes BIP44 which is the standard︃ so every wallet handles this in the same way. You generate the keys by doing︄ a derivation in an specific point and you might have seem something like "m /︅ 44' / 0' / 0' / 0 / 0" before in a hardware latter or︆ website... So read it up here:
bips/bip-0044.mediawiki at master · bitcoin/bips · GitHub and find︇ the path for your preferred chain
- From that you will get your private keypairs︈ and you will be able to generate more by just changing the path while also︉ being able to recover them from one single 24 words list...
Now, that being said:︊ Doing all of this is useless if you don't know how to build your own︋ wallet because you still need to sign transactions so you will end up adding them︌ to a wallet and so you will be in the same position as if you︍ just had created them with the damn wallet in the first place
😉
Get a trezor︎ or a ledger if you don't know how to build your own because there are️ more chances you will lock out of your funds before someone actually hacks your devices