Bitcoin Forum
November 08, 2024, 11:57:12 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 »  All
  Print  
Author Topic: Vanity bitcoin addresses: a new way to keep your CPU busy  (Read 29837 times)
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 20, 2011, 09:04:55 AM
 #41

So I've got a compiled bitcoin.exe using minGW according to this thread:  http://forum.bitcoin.org/?topic=5851.msg86700#msg86700

Now, how do I go about applying this patch?
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 20, 2011, 04:48:29 PM
 #42

Sorry for bumping, but I just can't figure this out on my own.  I think the command should be something like this:

patch -p1 < vanity.patch

But I don't want to just start typing things in without knowing what I am doing...
joan
Jr. Member
*
Offline Offline

Activity: 56
Merit: 1



View Profile
June 20, 2011, 05:21:53 PM
 #43

Also interested in this.
I think the patch was done against the subversion repo so it probably won't work…
Also, it looks like the sources have been reorganized since then.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
June 25, 2011, 10:47:17 PM
 #44

I'm unable to find the option to attach files to posts, so I'm forced to copy paste this here:

Code:
diff -urpN orig/bitcoin-0.3.23/src/main.h bitcoin-0.3.23/src/main.h
--- orig/bitcoin-0.3.23/src/main.h 2011-06-12 01:17:13.000000000 +0200
+++ bitcoin-0.3.23/src/main.h 2011-06-26 00:16:53.531905670 +0200
@@ -84,6 +84,7 @@ FILE* OpenBlockFile(unsigned int nFile,
 FILE* AppendBlockFile(unsigned int& nFileRet);
 bool AddKey(const CKey& key);
 std::vector<unsigned char> GenerateNewKey();
+std::vector<unsigned char> GenerateNewKey(std::string vanity);
 bool AddToWallet(const CWalletTx& wtxIn);
 void WalletUpdateSpent(const COutPoint& prevout);
 int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
diff -urpN orig/bitcoin-0.3.23/src/rpc.cpp bitcoin-0.3.23/src/rpc.cpp
--- orig/bitcoin-0.3.23/src/rpc.cpp 2011-06-12 01:17:13.000000000 +0200
+++ bitcoin-0.3.23/src/rpc.cpp 2011-06-26 00:14:12.042318453 +0200
@@ -6,6 +6,7 @@
 #include "cryptopp/sha.h"
 #undef printf
 #include <boost/asio.hpp>
+#include <boost/xpressive/xpressive_dynamic.hpp>
 #include <boost/iostreams/concepts.hpp>
 #include <boost/iostreams/stream.hpp>
 #ifdef USE_SSL
@@ -309,19 +310,61 @@ Value getinfo(const Array& params, bool
 }
 
 
+vector<unsigned char> GenerateNewKey(string vanity)
+{
+    using namespace boost::xpressive;
+    sregex re = sregex::compile(vanity);
+
+    RandAddSeedPerfmon();
+    unsigned int tried = 0;
+    for (;;)
+    {
+        CKey key;
+        key.MakeNewKey();
+        string strAddress = PubKeyToAddress(key.GetPubKey());
+        ++tried;
+        if (tried%100000 == 0) printf("Vanity key tried %u\n", tried);
+        if (!regex_search(strAddress, re)) continue;
+
+        if (!AddKey(key))
+            throw runtime_error("GenerateNewKey() : AddKey failed");
+        return key.GetPubKey();
+    }
+}
+
+void VanitySearchThread(void* parg)
+{
+    Array* a = (Array*)parg;
+    string vanity = (*a)[1].get_str();
+    string strAddress = PubKeyToAddress(GenerateNewKey(vanity));
+    string strLabel = (*a)[0].get_str();
+
+    SetAddressBookName(strAddress, strLabel);
+
+    delete a;
+}
+
 Value getnewaddress(const Array& params, bool fHelp)
 {
-    if (fHelp || params.size() > 1)
+    if (fHelp || params.size() > 2)
         throw runtime_error(
-            "getnewaddress [account]\n"
+            "getnewaddress [account] [vanity]\n"
             "Returns a new bitcoin address for receiving payments.  "
             "If [account] is specified (recommended), it is added to the address book "
-            "so payments received with the address will be credited to [account].");
+            "so payments received with the address will be credited to [account]."
+            "If [vanity] is specified, is less than 10 characters, and is all valid"
+            "base58 characters, then an address containing that string is generated.");
 
     // Parse the account first so we don't generate a key if there's an error
     string strAccount;
     if (params.size() > 0)
         strAccount = AccountFromValue(params[0]);
+    if (params.size() > 1)
+    {
+        Array* a = new Array(params);
+        CreateThread(VanitySearchThread, (void*)a);
+        return "...searching...";
+    }
 
     // Generate a new key that is added to wallet
     string strAddress = PubKeyToAddress(GetKeyFromKeyPool());

Should apply cleanly to bitcoin-0.3.23.
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 25, 2011, 11:32:58 PM
 #45

Thanks!  Wink  What's the command to apply it to a build?
cschmitz
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
June 26, 2011, 12:33:07 AM
 #46

I think this is inherently a bad idea, especially coming from one of the core developers of bitcoin.
Throwing away part of the network just to appeal to random nerdery is a horrible idea to implement when in the end, the core developers should really worry about using the resources of the system as efficiently as possible, after all the infrastructural components of the system are the basis of everything.
People thought  ipv4 was sufficient once, people thought 512kb ram were sufficient, etc. Being wasteful with a core resource in IT, given its short but rich history, is just wrong on so many fronts, i wouldnt even know where to start.

proud 5.x gh/s miner. tips welcome at 1A132BPnYMrgYdDaRyLpRrLQU4aG1WLRtd
TiagoTiago
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500


Firstbits.com/1fg4i :)


View Profile
June 26, 2011, 12:49:14 AM
 #47

Shhhh! If people start wasting their hash/s it will get easier for the rest of us to crack blocks! <.<

(I dont always get new reply notifications, pls send a pm when you think it has happened)

Wanna gimme some BTC/BCH for any or no reason? 1FmvtS66LFh6ycrXDwKRQTexGJw4UWiqDX Smiley

The more you believe in Bitcoin, and the more you show you do to other people, the faster the real value will soar!

Do you like mmmBananas?!
unk
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
June 26, 2011, 02:07:27 AM
 #48

I think this is inherently a bad idea, especially coming from one of the core developers of bitcoin.
Throwing away part of the network just to appeal to random nerdery is a horrible idea to implement when in the end, the core developers should really worry about using the resources of the system as efficiently as possible, after all the infrastructural components of the system are the basis of everything.
People thought  ipv4 was sufficient once, people thought 512kb ram were sufficient, etc. Being wasteful with a core resource in IT, given its short but rich history, is just wrong on so many fronts, i wouldnt even know where to start.

it's hard, intuitively, to reason about numbers as large as the keyspace of the implicated private keys. but resource inefficiency isn't even plausibly a concern in this space. it's not at all like ip addresses.

maybe a comparison will help: if the world population grew by a factor of a thousand and then every person lived for a thousand years and generated a thousand keys per second while they lived, there would still be no issue with 'wasting' keys.

if that's still counterintuitive, you can think about it like this: if this idea were a problem merely because a developer of the bitcoin client encourages it, then bitcoin would not be secure, as the idea does not need the support of any bitcoin developers. i can generate and throw away thousands (i still cannot do billions like bytecoin because my maths are rusty) of keys a second, and nobody can stop me from doing that. if i
(or even ten thousand people acting in the same way) could compromise addresses that way, then bitcoin would be worthless from the perspective of financial security.
joan
Jr. Member
*
Offline Offline

Activity: 56
Merit: 1



View Profile
June 26, 2011, 08:58:26 AM
 #49

Should apply cleanly to bitcoin-0.3.23.
I admit I haven't tried, but I think this would not apply smoothly to what's currently in the git repo (which I think is what SgtSpike is using?). As mentioned, the sources have been reorganized.
GenerateNewKey() for example is now in the class CKeyStore, not global to main.h / rpc.cpp. This is where GenerateNewKey(std::string vanity) should be too.

I do have some kind of patch too but I haven't worked out the threading yet. So it just hangs until it finds a match, which is not very nice.
SgtSpike, I think you are under Windows, do you use TortoiseGit? It will make things easy when you want to create/apply patches.
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 26, 2011, 09:31:29 AM
 #50

I use MinGW.  I know next to nothing about c++ or compiling (web programmer here), so I was hoping there would be an easy way to include a patch (or diff?) file when I run the compile command.  If I find something that works, I won't upgrade my client until I absolutely have to in the future.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
June 26, 2011, 10:46:38 AM
 #51

Thanks!  Wink  What's the command to apply it to a build?

You need the patch utility. There are a couple of implementations for windows out there. Just unpack the bitcoin sources into a directory, download the patch, open a cmd window and type this:

Code:
> cd \path\to\bitcoin-sources
> patch -p1 < \path\to\vanity-0.3.23.patch

(Disclaimer: that's untested). Then compile as usual. I only compiled bitcoind (headless) since that's what I use anyway.


I think this is inherently a bad idea, especially coming from one of the core developers of bitcoin.

I understand he did it for the lulz and in no way he seriously endorses its usage. After all, you have to jump through a couple of hoops to get it working.
marcus_of_augustus
Legendary
*
Offline Offline

Activity: 3920
Merit: 2349


Eadem mutata resurgo


View Profile
June 26, 2011, 11:51:05 AM
 #52


... it seems like intentionally creating identifiable addresses goes counter to security through anonymity from the get-go ...

TheSeven
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500


FPGA Mining LLC


View Profile WWW
June 26, 2011, 12:17:29 PM
 #53

YAY! Pooled bitcoin vanity address mining! Grin

My tip jar: 13kwqR7B4WcSAJCYJH1eXQcxG5vVUwKAqY
unk
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
June 26, 2011, 03:29:44 PM
 #54

... it seems like intentionally creating identifiable addresses goes counter to security through anonymity from the get-go ...

obviously, you wouldn't choose a 'vanity' address if you didn't want it to leak some information. but just because bitcoin provides anonymity doesn't mean everyone cares to be anonymous in every transaction.

for example, many people post in this forum under their real names and have bitcoin addresses in their signatures. that involves 'intentionally creating identifiable addresses' in much the same way.
inh
Full Member
***
Offline Offline

Activity: 155
Merit: 100


View Profile
June 26, 2011, 05:34:43 PM
 #55

Someone mod poclbm (simplest python miner I could find) to use the GPU for address generation. The CPU is so slow!
marcus_of_augustus
Legendary
*
Offline Offline

Activity: 3920
Merit: 2349


Eadem mutata resurgo


View Profile
June 26, 2011, 11:02:51 PM
 #56

... it seems like intentionally creating identifiable addresses goes counter to security through anonymity from the get-go ...

obviously, you wouldn't choose a 'vanity' address if you didn't want it to leak some information. but just because bitcoin provides anonymity doesn't mean everyone cares to be anonymous in every transaction.

for example, many people post in this forum under their real names and have bitcoin addresses in their signatures. that involves 'intentionally creating identifiable addresses' in much the same way.

I wonder how many who are doing this realise they are effectively tying the value of their bitcoins to their reputations?

FreeMoney
Legendary
*
Offline Offline

Activity: 1246
Merit: 1016


Strength in numbers


View Profile WWW
June 27, 2011, 03:11:16 AM
 #57

... it seems like intentionally creating identifiable addresses goes counter to security through anonymity from the get-go ...

obviously, you wouldn't choose a 'vanity' address if you didn't want it to leak some information. but just because bitcoin provides anonymity doesn't mean everyone cares to be anonymous in every transaction.

for example, many people post in this forum under their real names and have bitcoin addresses in their signatures. that involves 'intentionally creating identifiable addresses' in much the same way.

I wonder how many who are doing this realise they are effectively tying the value of their bitcoins to their reputations?

Only their donations are tied (with proper caution) to them and how could you get donations without tying in your rep?

Play Bitcoin Poker at sealswithclubs.eu. We're active and open to everyone.
cschmitz
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
June 27, 2011, 04:21:57 AM
 #58

maybe a comparison will help: if the world population grew by a factor of a thousand and then every person lived for a thousand years and generated a thousand keys per second while they lived, there would still be no issue with 'wasting' keys.

its not a math issue its a conceptual issue. also lol³ at your "thousand keys per second" analogy for a system that by definition wants to be around 2033.

proud 5.x gh/s miner. tips welcome at 1A132BPnYMrgYdDaRyLpRrLQU4aG1WLRtd
EricJ2190
Full Member
***
Offline Offline

Activity: 134
Merit: 102


View Profile
June 27, 2011, 04:59:33 AM
 #59

The point is, nothing extra (except electricity) is being consumed by generating vanity addresses. An address that is generated then discarded may as well have never been generated. The network never has any indication that this address ever existed.
TiagoTiago
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500


Firstbits.com/1fg4i :)


View Profile
June 28, 2011, 09:14:06 PM
 #60

If mining hardware was instead dedicated to generating new addresses; how long do you think would it take till someone stumbled on an existing address that had more BTC stored than what the person would have earned by mining?

(I dont always get new reply notifications, pls send a pm when you think it has happened)

Wanna gimme some BTC/BCH for any or no reason? 1FmvtS66LFh6ycrXDwKRQTexGJw4UWiqDX Smiley

The more you believe in Bitcoin, and the more you show you do to other people, the faster the real value will soar!

Do you like mmmBananas?!
Pages: « 1 2 [3] 4 5 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!