# Bitcoin phrase wallets

**URL:** <https://forum.grin.mw/t/bitcoin-phrase-wallets/10196>\
**Category:** Uncategorized\
**Created:** [November 29, 2022, 3:59pm UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196 "2022-11-29T15:59:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 29, 2022, 3:59pm UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/1 "2022-11-29T15:59:23Z")

</div>

Does anyone remember when it was common to generate a bitcoin wallet from any possible phrase? Like you would take a sentence from a favorite book and use that as your key.

I remember a story in 2017 or so that it appeared someone had ran the majority of written history through a scraper and drained many such wallets.

I can’t find a wallet generator like that anymore, maybe they have all gone offline now that it’s known to be insecure. But there were some fun ones to check like if you just entered “bitcoin” as the seed phrase people would be running transactions through that wallet as a public pot game.

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 29, 2022, 4:20pm UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/2 "2022-11-29T16:20:50Z")

</div>

It looks like maybe these were “deterministic wallets”.

And here’s one generator but I’m not sure if it was a standard or if different generators worked differently.

[https://keybase.io/warp/warp\_1.0.9\_SHA256\_a2067491ab582bde779f4505055807c2479354633a2216b22cf1e92d1a6e4a87.html](https://keybase.io/warp/warp_1.0.9_SHA256_a2067491ab582bde779f4505055807c2479354633a2216b22cf1e92d1a6e4a87.html)

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 29, 2022, 4:42pm UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/3 "2022-11-29T16:42:54Z")

</div>

I think it would be fun if we could do these in grin.

---

<div class="post-metadata">

**Author:** ![NicolasFlamel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/nicolasflamel/32/4912_2.png) [@NicolasFlamel](https://forum.grin.mw/u/NicolasFlamel)\
**Post date:** [November 30, 2022, 12:59am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/4 "2022-11-30T00:59:28Z")

</div>

You could use the SHA-512 hash of any possible phrase as the extended private key for a Grin wallet and it would work most of the time, but, as you already pointed out, this is a bad idea due to people not being very good at thinking up random phrases.

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 30, 2022, 1:15am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/5 "2022-11-30T01:15:55Z")

</div>

Perfect, anyone know of a relatively easy way to get a 512 key into any of our current wallet apps?

---

<div class="post-metadata">

**Author:** ![NicolasFlamel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/nicolasflamel/32/4912_2.png) [@NicolasFlamel](https://forum.grin.mw/u/NicolasFlamel)\
**Post date:** [November 30, 2022, 2:15am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/6 "2022-11-30T02:15:28Z")

</div>

I don’t know Rust, so take this with a grain of salt. You can replace [this line](https://github.com/mimblewimble/grin/blob/master/keychain/src/extkey_bip32.rs#L355) in grin with `hasher.append_sha512("any possible phrase".as_bytes());` to hardcode a passphrase into it. I think that will work without breaking too much else.

Then you’d need to change these files in grin-wallet to use your modified grin repo:

- [api/Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/api/Cargo.toml)
- [controller/Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/controller/Cargo.toml)
- [config/Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/config/Cargo.toml)
- [Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/Cargo.toml)
- [impls/Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/impls/Cargo.toml)
- [libwallet/Cargo.toml](https://github.com/mimblewimble/grin-wallet/blob/master/libwallet/Cargo.toml)

⚠ **Don’t use this on mainnet** ⚠ I can send you some Grin testnet coins if you really want to try this.

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 30, 2022, 2:25am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/7 "2022-11-30T02:25:15Z")

</div>

Nice. I need to insert that before building grin wallet right? And then any ideas what to do once it’a built to execute that?

---

<div class="post-metadata">

**Author:** ![NicolasFlamel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/nicolasflamel/32/4912_2.png) [@NicolasFlamel](https://forum.grin.mw/u/NicolasFlamel)\
**Post date:** [November 30, 2022, 2:36am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/8 "2022-11-30T02:36:22Z")

</div>

Here’s the generalized steps that you’d need to do.

1. Download the grin source code: `git clone https://github.com/mimblewimble/grin.git`
2. Edit [this line](https://github.com/mimblewimble/grin/blob/master/keychain/src/extkey_bip32.rs#L355) in grin with your hardcoded passphrase.
3. Download the grin-wallet source code: `git clone https://github.com/mimblewimble/grin-wallet.git`
4. Edit the Cargo.toml files in grin-wallet to use the package that you modified step 2.
5. Build the grin-wallet that you modified in step 4: `cargo build`
6. Run the compiled grin-wallet program to create a Grin wallet: `./target/debug/grin-wallet --testnet init`

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 30, 2022, 3:14am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/9 "2022-11-30T03:14:48Z")

</div>

Thanks I’ll give that a try sometime.

---

<div class="post-metadata">

**Author:** ![tromp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/tromp/32/22_2.png) [@tromp](https://forum.grin.mw/u/tromp)\
**Post date:** [November 30, 2022, 7:34am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/10 "2022-11-30T07:34:05Z")

</div>

To make a seed from a seedphrase, it is crucial that you use an extremely costly transformation.  
One possibility is to use the seedphrase to seed siphash and try solve the corresponding cuckatooN graph, where N \> 32. For any long enough cycle, its cyclehash will make a good masterkey.

This follows the basic idea of key stretching/strengthening [1].

[1] [Key stretching - Wikipedia](https://en.wikipedia.org/wiki/Key_stretching)

---

<div class="post-metadata">

**Author:** ![Trinitron](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/trinitron/32/4990_2.png) [@Trinitron](https://forum.grin.mw/u/Trinitron)\
**Post date:** [November 30, 2022, 1:20pm UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/11 "2022-11-30T13:20:55Z")

</div>

Is the idea that this cost would prevent the scraper and other attacks? The “bitcoin” wallet would still be easy to guess right?

---

<div class="post-metadata">

**Author:** ![tromp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/tromp/32/22_2.png) [@tromp](https://forum.grin.mw/u/tromp)\
**Post date:** [December 1, 2022, 8:08am UTC](https://forum.grin.mw/t/bitcoin-phrase-wallets/10196/12 "2022-12-01T08:08:01Z")

</div>

Yes, the scraper and brute force attacks are not very effective when taking gigabytes of memory and multiple seconds (or even minutes) per guess.
