Search content
Sort by

Showing 20 of 73 results by samr7
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 24/10/2012, 07:35:37 UTC
I'm 100% sure oclvanityminer is searching for patterns belonging to only a single public key at once, and this implies the multiplicative method (if I understand correctly). Still, I don't know if it is actually using that method.

There have been a lot of questions lately about additive vs. multiplicative, and how they work in oclvanitygen/oclvanityminer.  I'll try to answer them.

Oclvanityminer uses the additive method:

  • Generate a random partial private key
  • Calculate the associated partial public key
  • Add the base public key to the partial public key to get the test public key
  • Generate a large batch (~1M) of sequential addresses by successively adding the generator point to the test public key, and converting the points to addresses
  • If a match is found, report the partial private key plus the number of times the test public key was incremented.  Otherwise, repeat the previous step

Sequential public keys in this scheme are generated by successively adding the generator point to the test public key.  In the multiplicative method, we would skip adding the base public key to the test key at the start, and use the base public key as the increment instead of the generator point.

If anyone really wants to use the multiplicative method instead, it's possible to modify oclvanityminer to do this by changing maybe 5-10 lines of code.  The performance difference would be negligible.

You are correct that oclvanityminer will search for addresses belonging to a single public key at a time.  I'm not sure how additive vs. multiplicative makes a difference in the ability to concurrently search for patterns using different base public keys.  For that matter, I'm not quite sure how to efficiently search for multiple patterns with different base public keys in the first place.
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 12/10/2012, 03:28:05 UTC
Wow, someone really decided to use the Pool. About 20 Bitcoins worth of bounties are now available in the pool!

All these bounties have exposed a few bugs in oclvanityminer.  There were a handful of issues with the bounty list parser, and those have been fixed in git.  Another issue that also came up, the solve URL for vanity pool doesn't appear to accept POST requests.  It sends me back an error when I post something.  I changed oclvanityminer to use GET instead of POST for submitting solutions, and it seems to work.  I will post new binaries soon.

Edit: Pick up vanitygen 0.22
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 22/08/2012, 03:01:12 UTC
Ideas looking forward

It's possible to make vanity address mining much like regular bitcoin mining, in the sense of tracking the total work completed by each participant, and possibly distributing rewards to all participants rather than just the finder.  The idea would be, if somebody wants 1DanieLRH, post the bounty for 1Danie, and keep track of how many addresses each miner returns.  Eventually, a matching address will come back, and all of the partial matches will make it possible to determine the division of compute resources.

It also wouldn't hurt if the pool posted the portion of the bounty that will go to whoever solves it, rather than the amount paid by the customer.  It's a letdown to see a bounty for 0.1 BTC, and only receive 0.08 on completion.
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 22/08/2012, 02:00:29 UTC
Well, I guess everything is in order. It would be nice if you compiled it for the 64-bit Windows, but I don`t know whether it would increase the performance or not. Although The miner appears to work pecularly at times. Currently there are three works available, 1DanieLRH::0:0.100000; 1Satoshi::0:0.100000; 1ThePiachu::0:1.000000;, and instead of working on 1Satoshi, 7 letters, it chooses 1DanieLRH, 8 letters for the same reward. Does it just work on the first available work, or does it prioritise its work/reward ratio?

It does rank bounties by reward/difficulty.  Choosing the 8 letter prefix is the best choice here, but not by much:

Code:
$ ./vanitygen 1Satoshi
Difficulty: 51529903411245
...
$ ./vanitygen 1DanieLRH
Difficulty: 50656515217834

It will also group together bounties by public key.  When the 1Satoshi and 1satoshi bounties were both present, because they had the same public key, they would go into the same pattern set and would be searched for simultaneously.  Also, when dealing with bounties with the same public key, the aggregate reward/difficulty is used for decision making.  This would cause it to choose those two bounties together over the 1DaneiLRH bounty, if it were present.

Anyway, expect a new release in the next day or so that has an oclvanityminer64.exe.

Quote
Also a nice feature would be allowing one to specify a TestNet address for the vanitypooltest website, but that`s not really much of an issue.

You mean for the -a parameter?  It should accept a testnet address there.  Did it not accept one for you?  It is supposed to validate that what you enter for the -a parameter is a valid address of some sort, but it won't enforce a specific address type.

Quote
So, unless someone else has some objections, I`ll send you the Bitcoins soon. What address would you like to receive them with? 1samr7UZxtC6MEAFHqr1h3Kq453xJJbe4 ?

That's the right address.
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 18/08/2012, 19:03:16 UTC
I`m looking forward to trying out how it works, thanks! Does it have all the features listed in the requirements, so I can send you the bounty afterwards?

Yes, please!  It should meet all the requirements.  One minor exception though, it looks like you specifically want 64-bit Windows binaries, but I only build the OpenCL pieces for 32-bit Windows.  This can be changed.

Actually, I did talk to the person and they wanted just the capitalised version. They didn`t know that the pool is case-sensitive, so I payed for the other version and added a note on the work submission about the issue.

Later I will want to include regular expressions into the pool, but those might be a bit harder to check for validity at the initial stage.

Indeed, determining a "difficulty" for a PCRE style regular expression is quite the can of worms.

It should be possible to design a subset of PCRE that can be converted directly into a bunch of prefixes, instead of having to execute the regular expression on each potentially matching address.  The idea would be to force the RE to start with a ^, disallow *, limit the length, and limit the resulting number of prefixes.  This would be a lot more expressive than a case-sensitive or case-insensitive prefix, and just as fast to search.  It would also solve the problem of executing REs on the GPU, as long as the RE isn't so complicated that it creates a search table that is too large to fit on the GPU.
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 18/08/2012, 16:58:52 UTC
One feature you may wish to consider adding to vanity pool, the ability to specify case-insensitivity in bounties.

Whoever posted the bounties for 1Satoshi and 1satoshi paid for two different addresses differing only in the case of the first letter.  It's entirely possible that that person simply wants that name on firstbits, and would rather pay for one case-insensitive address.  Also, at the reward offered for those bounties, finding a case-insensitive match would be very close to profitable, but finding either of the case-sensitive variants is not.

Or maybe not in this case, looks like 1satoshi is taken on firstbits.
Post
Topic
Board Development & Technical Discussion
Re: Vanity Pool - vanity address generator pool
by
samr7
on 18/08/2012, 08:13:09 UTC
The vanitygen suite now includes a program called oclvanityminer that is designed to work with this pool.  Please try it out!

Code:
$ ./oclvanityminer -u https://vanitypool.appspot.com/ -a 1samr7UZxtC6MEAFHqr1h3Kq453xJJbe4
Searching for pattern: "1satoshi" Reward: 0.100000 Value: 0.000007 BTC/MkeyHr
Difficulty: 51529903411245
Searching for pattern: "1Satoshi" Reward: 0.100000 Value: 0.000007 BTC/MkeyHr
Next match difficulty: 25764951705622 (2 prefixes)
[6.14 Mkey/s][total 62914560][Prob 0.0%][50% in 33.6d]

I'm happy to throw what meager compute power I have at this.  However, the bounties for the above example would have to be about 10X what they are to be as lucrative as bitcoin mining at the current difficulty.
Post
Topic
Board Project Development
Re: [Bounty] Vanity address split-key generator software
by
samr7
on 04/07/2012, 16:42:42 UTC
I'm also hoping some people/businesses will want to order their addresses in bulk, which could make things interesting...

Interesting idea.  So, by ordering in bulk, you mean post multiple bounties with the same public key?  Then the mining client can run them all at the same time, and when deciding which bounties to go after, it should sum the cost-reward of all bounties with the same public key.
Post
Topic
Board Project Development
Re: [Bounty] Vanity address split-key generator software
by
samr7
on 04/07/2012, 07:30:46 UTC
Thank you, but it's not really that complicated.

This thing enables a whole business model, and it's good for a bunch of reasons.  There won't be room for many sites like this, because the bounty will be held in a sort of escrow, and potential customers won't want to pay the bounty twice or three times.  So they'll pick the site with the most compute power.  The way it's shaping up, they'll also have to post a reward large enough to beat out the current top bounty on reward-to-difficulty in order to get their job prioritized.

Quote
I guess you are right about the two strings, kind of silly of me to split them up. I'll probably just add the additional functionality to the /getWork address and delete the reference to the other one in the protocol specification, while still supporting it for awhile.

As for "knowing all of this", you give me a bit too much credit - I'm not really that proficient of a web programmer. I do a lot of projects because I know nothing about the field - my bachelor's thesis was about AI and used OpenGL, didn't know much about either before I started, and my master's thesis was about Bitcoin, Google App Engine and Go, also haven't used any before I started. When it comes to web stuff, I'm still learning a lot.

So, could you elaborate a bit more?

I might have been too nitpicky about two URLs, that works fine, and it will do the job going forward.  However, how would you change it in a backward-compatible way to support something like a case-insensitivity flag?

If I had to design it from scratch though, maybe the bitcoin JSON-RPC model would be a good choice.

Quote
From what I can see, the bounty was claimed by someone with the public key of
C2042FBA7ABE6DF861F7EF45E297EB684BE107D8CC4752F7740E7141FCD22470
Which uses the additive split-key mining. I programmed the Pool to not do anything with the bounty if some data is incorrect - be it an invalid key or Bitcoin address. This way the coins don't get lost or stolen by someone providing a valid solution without the proper means to pay. I figured this would be the fairest - I could implement a Pool that would register a solution without a valid payout address, but it is a bit wrong in my opinion.

If all the data is correct, the Pool will attempt to send the bounty and clean everything up. I'm currently in the process of adding in some extra error handling and pushing the payout onto a separate thread. As Bitcoind is on a different server than the Pool, I can't expect both of them to be able to communicate all of the time. But that will be in the next version I'm preparing. For now some errors can occur - at some point I got a bug that allowed me to pay myself the bounty twice over (happened due to the call to Bitcoind timing out - the payment went through, but it did not register in the Pool).

Yep that was me.  The payment did go through, and it shows up on block explorer.  My testnet client unfortunately didn't see it because the transaction is on testnet2 and my client is on testnet3.

The pool keeps 20%, or 1 tBTC?
Post
Topic
Board Project Development
Re: [Bounty] Vanity address split-key generator software
by
samr7
on 01/07/2012, 09:17:14 UTC
Hi ThePiachu,

I really like what you've done with vanity pool!  This has a lot of potential.

- Give an option to the user to automatically fetch and submit work from a "vanity mining pool" through the use of the protocol outlined in https://vanitypooltest.appspot.com/faq

You might want to overhaul this a little bit before it becomes more popular.  It ought to behave more like a standard web service, with one URL to do everything, rather than two.  And if you're going to use POST, the example code shouldn't put the parameters in a query string, it should use x-www-form-urlencoded.  But you already know all of this, and are just trying to look like an upstart, and I respect that.

Anyway, there is currently source code to a vanitygen derivative that implements a polling loop and other mining client features, and it is available on github.  Here's what it looks like:

Code:
# ./oclvanityminer -p 0 -d 0 -u https://vanitypooltest.appspot.com/ -a 1samr7UZxtC6MEAFHqr1h3Kq453xJJbe4
Searching for pattern: "1Testo2" Reward: 5.000000 Value: 0.020260 BTC/MkeyHr
Difficulty: 888446610538
Compiling kernel, can take minutes...done!
Pattern: 1Testo2                                                               
Address: 1Testo2cH7JbqERjEkTz4MfmP2mQh6Aoi
PrivkeyPart: 5KHjU9V8tR6HNfoL5ZFmkgLzPPGt1u2BjQFMmL31ZtNWovptxDj

Like other mining software, oclvanityminer must be given a URL to the bounty server, with the -u parameter.  This URL is a base URL to which the /getWork and /solve paths are appended.  It also requires an address to receive bounties, specified with the -a parameter, which is checked against typos and cut-and-paste errors.  The other parameters specify which OpenCL device to use, and are the same as oclvanitygen.

The miner follows the basic logic of mskwik's perl script -- it polls the server on regular intervals, and selects the best bounty based on difficulty and reward.  If the best bounty has changed since the last poll, it will reconfigure the OpenCL engine.  If no bounties are available, it will halt the OpenCL engine.

Indeed it found a match for "1Testo2" on vanitypooltest.appspot.com, which took a few hours on a cluster of AMD 5830s.  Unfortunately, while the address to receive the bounty passed validation, it wasn't valid in this case -- the bounty is in testnet coins, and the address is a regular net address.  The pool server replied with an error about the address not appearing to be valid, which is good, but it's unclear what the pool server did with the bounty.

The address miner has a few wrinkles left to be worked out and isn't formally released yet.  For anyone who wants to try it out, there is a win32 binary of the miner program posted here.
Post
Topic
Board Development & Technical Discussion
Re: Defense against 0/Unconfirmed double-spending
by
samr7
on 20/08/2011, 05:24:19 UTC
also you can replace transactions using the sequence invalidating your old tx.

Are you referering to the nSequence field of transaction inputs?

I thought that was locked out.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 17/08/2011, 23:38:16 UTC
It's great to see that someone is trying to establish standards in bitcoin community. A while ago I was doing a bit of research regarding the private key export and came to a conclusion that OpenPGP message format would suit this use case perfectly. I encourage you to take look into RFC 4880 if you haven't already, quite a brilliant piece of work. What I advocate is to use the existing, vast system that OpenPGP is and try fitting bitcoin into it.

Advantages to taking this approach are numerous.
  • OpenPGP is a well known and tested standard
  • Security is built in
  • There is room for growth and modifications
  • It's very robust and covers almost all use cases
  • Possible use of existing OpenPGP compliant architecture

There is one great disadvantage, though. With robustness comes complexity - it's not a quick and easy fix to the problem of key sharing but rather a lengthy process of integrating bitcoin into OpenPGP ecosystem.

This sounds very interesting.  I can see simple use cases like using one EC key both as a bitcoin account and for signing PGP messages.  Possibly using a bitcoin-disclosed public key to encrypt messages, if this is safe.  How else would integration be possible?

Another factor, GnuPG has yet to produce a stable release with support for EC keys.
Post
Topic
Board Development & Technical Discussion
Re: Question about transaction outputs.
by
samr7
on 17/08/2011, 20:41:14 UTC
I guess it is not possible then? i.e. there is no relationship between prev_out hash and any of the out hashes?

Somebody who knows the source better than I can correct, but it looks like the output for "change" is inserted at a random position in the transaction.  See CWallet::CreateTransaction(), wallet.c:969.  So, there shouldn't be any deterministic clues.
Post
Topic
Board Development & Technical Discussion
Re: Pywallet: manage your wallet
by
samr7
on 16/08/2011, 00:06:11 UTC
New release:
 web interface now use --datadir and --wallet flags to autofill forms
 no more "A if cond else B", so it should run with python 2.4 and maybe less, can someone test?

Very cool, the web interface auto-fill works beautifully.

I tried running it with Python 2.4.  It kinda works.  The biggest issue I ran into, the json module does not appear to exist in Python 2.4.  According to the docs on python.org, json would appear to have been introduced in 2.6.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 15/08/2011, 19:25:39 UTC
The primary goal of this format is to create something like PKCS#8/RFC5958.  PKCS#8 is the format commonly used to store SSL/TLS private keys, in password-protected form or otherwise.  It is a very flexible format with metadata describing of the type of private key, and the PBKDF parameters and block cipher used to encrypt it.

It's possible to convert an exported bitcoin private key in the base-58 format to and from PKCS#8.  In PKCS#8, the built-in password-protection feature can be applied to the private key.  Also, if a bitcoin key were to be imported into some other non-bitcoin application for whatever reason, perhaps as a signing key, PKCS#8 would be the best bet as an import format.

It's also possible to take a PKCS#8 representation and produce a reduced mapping that assumes certain parameters.  If we assume the use of the SECG 256k1 EC curve, a set of of PBKDF2 parameters, and the use of AES with a specific key size, the representation can be smaller.  Unfortunately, due to RFC5915, there is a practical lower limit on the size of any reduced format.  For bitcoin private keys, this is close to 135 bytes, and it includes numerous details that, for our purposes, aren't necessary or can be assumed.  This is unwieldy large.

The next step of evolution from PKCS#8 might work as follows.

privkey = Minimal EC private key representation, 32 bytes long
param = Parameter descriptor byte.  This is an index into a predefined list of parameter groups, perhaps like:
  • 0: SECG 256k1 key, PBKDF2, HMAC-SHA256, 8-byte salt, 4096 iterations, AES-256-CBC
  • 1: SECG 256k1 key, PBKDF2, HMAC-SHA256, 8-byte salt, 4096 iterations, Camellia-256-CBC
  • 2: SECG 256k1 key, PBKDF2, HMAC-SHA256, 8-byte salt, 16384 iterations, AES-256-CBC
  • etc..

pbhash = Hash function from parameter list
cipher = Block cipher function from parameter list
salt = Random salt value of size described in parameter list
iter = PBKDF iteration count described in parameter list
pbkey = PBKDF2(password, salt, pbhash, iter)
protkey = param | cipher(privkey, pbkey) | salt

This would handle the cryptography in the most conservative, commonly-used way, and should not make anyone nervous, or at least, not any more nervous than PKCS#8.  It would also make the format easily adaptable to new block ciphers and key derivation functions.  The smallest representation using AES would be 58 bytes long, and would convert to an 83-character base-58 string.  This is much more compact than a PKCS#8 interoperable format, but I still think it's too long.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 12/08/2011, 19:00:49 UTC
Two different encryption schemes and/or passwords seems like a bad idea to me, both from a code maintenance/security point of view and from a usability point-of-view.

Can you expand on "private keys in base-58 export format are great for swapping around" -- what's the use case?  Who are you swapping with, and how?

Swapping around means storing a private key outside of a wallet.dat, either to be imported into another wallet.dat or another bitcoin client implementation.  It's an interchange format, not a specific wallet implementation.

The format proposed here is an extension that allows an exported private key to be password-protected.  Naturally, if it is to be interchangeable with another bitcoin wallet or another implementation, it shouldn't/can't be protected using the same password or master key as the wallet from which it came (if that wallet is encrypted).  The initial use case is to allow someone to use vanitygen to generate an address, and securely store the private key until it is later imported into a client.

Anyway, I think this proposal is orthogonal to the encryption of wallet.dat.

If you would rather this format follow the same password-derivation and encryption scheme as the master keys of the bitcoin wallet encryption system, that's certainly possible.  They're already quite similar, and until pixelglow came out and recommended PBKDF2, they both used EVP_BytesToKey().  I don't think the use cases between the wallet master key and a password-protected export format are quite the same though.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 12/08/2011, 16:04:23 UTC
If you're talking about private keys, the distiction remains: either you want to export/import what is in an already encrypted wallet (useful for backup), or you want to do encryption separately. The intent here seems to be the second case, which is fine. It just means you'll need to both the wallet passphrase and the key password ready if you want to import.

Absolutely!  The goal is to handle the keying independently and not depend on the master key of a specific encrypted wallet.  So, if it were used for exporting, it wouldn't be as convenient as "backupwallet," and at least one export password would be required.  But it could be implemented to be more convenient than dumpwallet + GPG.

Quote
Also, considering the used version byte, could you follow this thread? I'd say encrypted privkeys form a new data class.

Thanks!  I posted a note to the list and referenced that thread.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 11/08/2011, 16:19:24 UTC
Interesting, although your layering/composing of different cryptographic schemes may come back to bite you.

As I see it, you want to encrypt the password and also verify that the encrypted bits are unchanged. Here's a slight modification of the above:

privkey = 32-byte EC private key, big-endian form
salt = 4-byte random salt value
symkey = PBKDF2(HMAC-SHA1, password, salt, 4096, 64)
cryptedprivkey = (privkey XOR symkey[0:32])
pwcheck = HMAC-SHA1(symkey[33:64],cryptedprivkey)
protkey = cryptedprivkey | pwcheck | salt

  • You should use the more recent PBKDF2 (http://www.di-mgt.com.au/cryptoKDFs.html), which allows you to produce arbitrary length keys. In this case we're generating a 64-byte length key, half of which we'll use for encryption and the other half for authentication.
  • Next we encrypt the privkey with half the symkey by XOR'ing them together, a simple stream cipher. This avoids the use of AES in client code (slow in Javascript?, missing an initialization vector, plaintext length < AES block size of 128 bits) and should be pretty safe. Stream ciphers like RC4 are simply a random keystream XOR with the plaintext and are difficult to break, provided the random keystream is truly unpredictable and you never repeat the key. The trouble with stream ciphers then manifests when you have a large enough chunk of data to encode, then without a proper CPRNG like RC4 the keystream may repeat etc. and thus block ciphers under CBC become useful. Since we have a 32-byte private key and a 32-byte symkey to XOR together, this should not be the issue.
  • We then use a MAC, specifically a HMAC-SHA1, to act as the password check against modification. We use the second half of the symkey as the secret. HMAC's are particularly designed for message authentication.

Alternatively (safer/more paranoid) you could use two salts to produce two 32-byte keys, one for the encryption, one for the authentication.


Excellent!!

Pixelglow, you really seem to know your stuff, are you a pro??

The PBKDF that I've been using isn't exactly PKCS#5 v1, it's actually OpenSSL's EVP_BytesToKey().  It's similar but will produce arbitrarily large key material.  Otherwise, there certainly wouldn't be enough key material for an AES IV using SHA256.

Regardless, using PBKDF2 with an HMAC function would seem to be a very desirable change, and also appears to be very easy to get with OpenSSL.

Regarding pwcheck, the use of an HMAC function there with some additional key material also seems like the appropriate tool for the job, more so than my hacked-together mess.  Can't really say no to that either.

Would you recommend HMAC-SHA1 over HMAC-SHA256?

Somebody smart said that a work is finished not when everything that can be added to it has been added, but when everything that can be removed has been removed.  AES may fit into this category.  However, other similar password-protection schemes, including bitcoin's built-in wallet encryption, also use AES for fixed-size private keys, and it's nerve-racking to replace it with XOR, even though it may be the correct thing to do.

Thank you very much!!
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 10/08/2011, 21:05:24 UTC
The difference between an 8 byte salt and a 4 byte salt isn't 4 bytes, and it isn't a factor of 2.  It is a factor of over 4 billion.  It is the difference between "Got a minute?" and "Sometime after the end of the universe".

In reality, it is probably not that big of a deal.  Precomputing AES tables isn't a trivial task, and even 4 or 5 bits of salt is probably enough to make it impractical for well beyond the potential lifetime of one of these protected keys.

But cryptosystems are designed with defense in depth for very good reasons.  When a weakness in one part is discovered, it is usually not a catastrophe because we have added redundant security measures.

You make some very good points about this.

In terms of the purpose of the salt, what would be the usage model for any sort of precomputed table for this problem?  It seems like it would be limited to creating a list of AES keys derived from possible passwords, each of which would have to be tested, still requiring exponential time in the length of the password, but allowing the attacker to circumvent running the expensive PBKDF function for each test.  Is there something sneaker and more devious that an attacker could do with this particular problem?  I don't think this is like trying to build a table for a hash function, where the outputs depend on only the password and the salt, in which case the attacker can index the outputs to the inputs and build a true lookup table or a rainbow table.

Anyway, if that's true, then at 48 bytes per AES key + IV, and 2^32 salt variations of each, the attacker would need to be able to store 192GB per precomputed password.  At least, without some clever way of compressing the keys.  That is a lot easier than 2^64 variants of each, but still seems intractable.

The tradeoff to having four extra bytes of hash would be six extra characters in the encoded output.  Example side-by-side is below:

PAYxy8B9zhSGpbyC7Z29KRS7rsPzAcTF3zSPmyAigbAJYamt9GmNwsFT9E95dGfp6Ri
3W3qzi2Sow4o7LP7jwwnrmqiiGxyMcwLdubKxYhNy4J63eigN3jz7avYqSWfGwxz3nMDDXwwc


Edit: It's possible, using a smaller value for the type byte, to reduce it to five extra characters.

Your point about weakness mitigation is well taken though, and the tradeoff may be worth it.

EDIT: I would even recommend that fewer bits went into the password check.  Like, maybe as few as 8.  This will make it even more expensive to brute force passwords, as it will result in an enormous number of false positives that can only be checked by doing a time-consuming EC multiply (to derive the bitcoin address) and a database lookup (to see if there are any coins at that address, only to find there are none).  In the event of a typo, even with 8 bits, still a >99% chance it will still be caught.  The password check as it stands is probably just a gift to an attacker.

The PBKDF function here requires 8192 rounds of the SHA256 hash function, so it should already be a lot more expensive than computing the bitcoin address and looking it up in a list.  Even if the attacker was using a table, having to do an EC operation as often as every 2^8 keys probably won't cause a big slowdown.  But, it will make the password cracker a bit more complicated.

For the one person who gets a letter of their password wrong, and is unlucky enough to have it silently accepted and mapped to the wrong account, and either the bitcoin address isn't known or isn't compared to the expected value, they better hope the password-protected version of their key wasn't discarded.
Post
Topic
Board Development & Technical Discussion
Re: Password-protected private key export format
by
samr7
on 10/08/2011, 19:54:41 UTC
Hm, in this case the overall length isn't as important as having visual breaks. Think about the way Microsoft prints its product keys that people have to type in to activate Windows.

This is a very good point.  Segmentation like this is something that regular bitcoin addresses could benefit from as well -- typing in 34 characters is difficult enough.

So, the password-protected key above could look something like:

PAYxy8-B9zhSG-pbyC7Z-29KRS7-rsPzAc-TF3zSP-myAigb-AJYamt-9GmNws-FT9E95-dGfp6Ri

And the address:

1Hackn-YhLRpt-tqGAiB-ew1fQA-KRGnMo-rkxk

The breaks sure make it easy to remember where you left off, and they're a heck of a lot easier to transcribe to and from paper, or between screens!  But, the password-protected key now only barely fits into an 80-column terminal, and with anything prefixed at the beginning of the line, it will overflow.   Sad

Maybe this idea deserves its own thread.