Pages:
Author

Topic: Printing bitcoins, an implementation (Read 17678 times)

TT
member
Activity: 77
Merit: 10
November 25, 2011, 07:58:39 AM
#88
"Therefore, my technique would be inappropriate if I was only given the 32-byte private key. I've got no idea how to actually compute it Sad"

It's all in the CKey class in key.h

CKey::GetPrivKey and CKey::SetPrivKey use the 279-byte DER key.
CKey::GetSecret and CKey::SetSecret use the 32-byte private key.

Look at the satoshi client source code for details on how to call the OpenSSL library.

https://github.com/bitcoin/bitcoin/blob/master/src/key.h
sr. member
Activity: 322
Merit: 251
FirstBits: 168Bc
July 19, 2011, 11:50:23 AM
#87
I could invision a service whereby I generate key pairs and send them off to be minted.

I generate key pairs on my computer. I then symmetrically encrypt the private key and send them to the print-minting service along with identifying information, perhaps even my photo. The print-mint prints unique bill-notes (with my smiling mug in the center) and sends them back to me. I can then write the passphrase on the bill-notes (either in advance or upon purchase/distribution).

Recipients must trust me or transfer the bitcoins from the bill-note immediately. Recipients must trust the print-mint not to duplicate bill-notes and that counterfeiting is impractical, or again just transfer bitcoins to themselves upon receipt. The print-mint can verify that I have not duplicated the keys (at least with respect to the block chain and the print-mints own public key records).
sr. member
Activity: 280
Merit: 250
July 19, 2011, 10:57:15 AM
#86
I have tried several QR decoders that are free on the internet and none seem to be able to read the images or cropped images.  Has anyone been able to decode these QR images?

+1, QR decoder libraries
Works for me with Barcode Scanner on Android. Still, I don’t know how to get the public key out of the private one.
Used my Android but a bunch of letters pop up and now I am confused  Angry
donator
Activity: 743
Merit: 510
July 19, 2011, 04:48:30 AM
#85
Very good thread! I read it all and understood half but it is extremly interesting. I do believe that a one time use paper will soon find lot of uses, specially as for gifting. Is there a new thread about this?


Idea1 - where the issuer knows the new holder: There could be a free central colector (not bank) which holds paper transfered bitcoins so as to avoid trusting in each individual user. This collector shall reccord every transaction as individual and save some aditional data as a password to check the validity of the holder. QR eps would be issued to add it were ever you want, recalling this central colector and will ask for the password which will be revealed by the issuer as revealing the signature in the creditcard. Then the coins could be redeemed or change the password for fowarding them to a new holder or send them into a wallet. The system should allow to transfer many different amounts and have a central user control pannel.

Idea2 - the issuer don't knows the new holder: same central colector, QR+password hidden under metal ink. Obviously onetime redeem per paper.

Is this too simple and wrong? Sorry my english please.
member
Activity: 92
Merit: 10
June 29, 2011, 03:59:25 PM
#84
I'm so confused trying to read this thread.  I really like BitBills, plastic cards containing Bitcoins, very cool concept. Smiley
newbie
Activity: 52
Merit: 0
May 28, 2011, 03:14:52 PM
#83
If this is one time use paper(private key) - it wont work. Paper consumption around the world will be insane.
And another problem - if someone will see and just take photo of our money - we will lose it.

So we are coming to the beginning  - banks - we will need them to keep bitcoins and get paper edition of them without public/private keys printed in it but:
a) only with security signs like current USD or other money have to prove their validity
b) just with PUBLIC key to check if it is really somewhere in the network, also backed up in one of the central points.

It's not that easy to get it safe.

mine 0.02 btc
hero member
Activity: 504
Merit: 500
PGP OTC WOT: EB7FCE3D
May 28, 2011, 11:29:46 AM
#82
... you have to make it easy for the village idiot to use ...
might be related (and please do not overthink the following example that i might however compare any parent of any of us to any village type user ...

Quote from: gavinandresen on May 19, 2011, 05:08:27 pm
I think it is important to set expectations; I still wouldn't recommend that my mom use bitcoin for anything just yet, because it is not easy enough to use securely. And the road ahead is likely to be bumpy; there will be technical issues that need fixing, there will be legal questions, there will be price bubbles, and there will be scams. I predict that some company using bitcoins to do something illegal will be caught and prosecuted, and that will be mis-reported as "Bitcoin is illegal."

in the meantime someone is printing bitcoins but for cca 10% of their face value
& you have to trust him/her that you have the only copy of the keys ...
sr. member
Activity: 322
Merit: 251
FirstBits: 168Bc
May 28, 2011, 08:06:04 AM
#81
A similar take on the signing check idea, is to symmetrically encrypt the private key before encoding in QR/Data matrix. Then writing the password on the check 'signs' it. Of course the paper money isn't transferable before 'password signing'.
member
Activity: 92
Merit: 10
March 25, 2011, 01:26:05 PM
#80
They wouldn't have to stop accepting alltogether, they would just need to cash in in the contents of the presented wallet before considering the payment as having been effectuated(sp?), it would reduce the trust people have on the notes though, and probably in Bitcoin as a whole (most people don't know the difference between their web browser and the whole Internet, or even that they aren't the same thing)

I have a friend who, for years, thought the Internet was called Netscape.  It was incredibly hard for me to convince him that Netscape is just the name of a web browser, that there are plenty of browsers out there, and that the World Wide Web of pages he thinks is the Internet is actually only one Aspect of what the Internet actually is.  It was a major pain.

As for bitcoin printing, I just can't do all that work getting this stuff running.  Once you guys iron out all the kinks and get all this stuff solidly figured out, you have to make it easy for the village idiot to use, and that would probably mean a Windows program, or an iPhone app, or something.  Good luck with that, I'll be waiting with extreme excitement. Smiley
hero member
Activity: 616
Merit: 500
Firstbits.com/1fg4i :)
March 20, 2011, 06:42:30 AM
#79
They wouldn't have to stop accepting alltogether, they would just need to cash in in the contents of the presented wallet before considering the payment as having been effectuated(sp?), it would reduce the trust people have on the notes though, and probably in Bitcoin as a whole (most people don't know the difference between their web browser and the whole Internet, or even that they aren't the same thing)
full member
Activity: 140
Merit: 100
March 20, 2011, 12:36:40 AM
#78
I've been following this thread with interest, because one of my first ideas for Bitcoin was to use it as a backing for paper notes. These are still useful sometimes for in-person transactions, and would probably be good PR as well, since paper currency is familiar and comfortable. I can see myself tipping a bartender an extra 1 BTC just to get their attention.

I had not thought of printing a private key directly on the note! I'd just figured you could have something like a Bitcoin Reserve Agency printing hard-to-counterfeit promissory notes. Printing the key in invisible ink or under a scratch-off is clever, but I'm not sure it resolves the trust issues that a promissory note system has:
  • You have to trust that the private key will really be there when you go looking for it.
  • You have to trust that the private key will actually match the public key printed on the same note (if a public key is printed). This can be verified retroactively, but by then it's too late.
  • You have to trust that the money will really be linked to the private key.
  • You have to trust that the bill wasn't counterfeited.

All of these issues can be resolved if the issuer creates a hard-to-counterfeit note and maintains a good track record, but the important point is that printing the private key doesn't reduce the amount of trust necessary. All it does is make redemption easier.

Printing a private key also produces unique problems:
  • If some type of note is widely adopted, and then someone finds a new technique of reading the private key without altering the note, there could be an immediate financial crisis. (At best, businesses would have to stop accepting cash until the notes could be replaced).
  • Stolen cash can be immediately redeemed and then destroyed, making recovery difficult or impossible. Arguably this is a feature, not a bug, but it is a tough sell to someone used to the present system.

I've thought about this from a lot of angles, because I really like the idea of self-redeeming notes. But I really can't come up with a solution to these problems that isn't also a solution to the problems that central banks have in the first place. Maybe someone else can.

On the other hand, the scratch-off thing is plenty secure enough for a one-shot "check" that will be redeemed immediately by the recipient. So is a tamper-proof envelope, for that matter.
sr. member
Activity: 350
Merit: 252
probiwon.com
March 18, 2011, 05:55:14 PM
#77
Does it got error correction, like, could i replace a big part of it with an image of my choice and still have it work like how happens with QR code? And is it at least as easy to dentify and read by devices as QR code?

Yes. All the same, only the DataMatrix uses a little less space
hero member
Activity: 616
Merit: 500
Firstbits.com/1fg4i :)
March 18, 2011, 04:43:55 PM
#76
Does it got error correction, like, could i replace a big part of it with an image of my choice and still have it work like how happens with QR code? And is it at least as easy to dentify and read by devices as QR code?
sr. member
Activity: 350
Merit: 252
probiwon.com
March 17, 2011, 12:34:03 AM
#75
Encourage to use a DataMatrix!

QR-code is more proprietary than DataMatrix and DataMatrix fully implemented in very good open source library and utils called 'dmtx'.

Also DataMatrix supports real 8 bit encoding, but QR-code is really not:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=604882

QR-code has one advantage - it is recognizable by 'typical users'.


sr. member
Activity: 322
Merit: 250
March 13, 2011, 02:25:45 PM
#74
As I said above, I have provided the reader software online that I wrote. It isn't pretty, but you can get it working on the command-line as follows:
1. You will need Bazaar, Git, build essentials and libssl (sudo apt-get install bzr git build-essential libssl-dev).
2. See https://code.launchpad.net/~mgiuca/+junk/bitcoin-import, with further instructions here.
3. As instructed on my page, type: bzr branch lp:~mgiuca/+junk/bitcoin-import -- this will create a new directory called bitcoin-import wherever you are.
4. You also need Gavin's BitcoinTools if you haven't already got it. Type: git clone git://github.com/gavinandresen/bitcointools.git
5. Unfortunately, if you use Ubuntu, the supplied version of pycrypto will not work, so you need to get the full version here and set that up as per its installation instructions.
6. cd into bitcoin-import and type: make

Now the instructions for use, as given in privkeyimport.py:

1. Get the private key you wish to import in a text file. To do this, you either need to download the PDF of the printed money in a reader that can select the text and copy it, then paste it into a text file, OR get a QR code reader and paste the output text into a file. Whitespace is not important.
2. Run privkeyimport.py KEYFILE. This will write the key into your Bitcoin wallet. Use -n to just print without writing to the wallet.
3. Run bitcoin -rescan to ensure any transactions belonging to the imported key are added to the transaction list and balance.

As you can see, it requires a lot of technical fiddling, but no programming. Cleaner solutions will appear in time.
Thank you for the summary!
newbie
Activity: 25
Merit: 7
March 12, 2011, 09:28:36 PM
#73
I'm not a coder, or developer, and I am feeling lost here.  Sure, I downloaded stuff to install on linux that will enable me to print a certain amount of bitcoins in paper form, but I have not installed all these packages and run the python application.  Even if I did, is there another application for Reading a bill and then inserting the data into a wallet.dat?  If I manually insert data into a wallet.dat, how would I actually do it?  I've looked at the contents of my wallet.dat file, it's a confusing jumble of Hex stuff to me.  Until you developer types come up with an Easy tool to use to both print, and read, these Bitcoin bills, I think I'm going to be too lost to even attempt it.  Someone please develop a linux Package, that installs all the dependencies, or something.  Sheesh.
Software development takes time. The idea of printing bitcoins is just one idea that people are toying with, and this forum thread is the very first time someone has seriously attempted it. Accordingly, we have written some of the very first software that can read it back in, but it's just command-line tools. You can't expect us to polish it up into a proper user-friendly UI with a Linux package and so on, when really we are just experimenting with an idea that might not work.

As I said above, I have provided the reader software online that I wrote. It isn't pretty, but you can get it working on the command-line as follows:
1. You will need Bazaar, Git, build essentials and libssl (sudo apt-get install bzr git build-essential libssl-dev).
2. See https://code.launchpad.net/~mgiuca/+junk/bitcoin-import, with further instructions here.
3. As instructed on my page, type: bzr branch lp:~mgiuca/+junk/bitcoin-import -- this will create a new directory called bitcoin-import wherever you are.
4. You also need Gavin's BitcoinTools if you haven't already got it. Type: git clone git://github.com/gavinandresen/bitcointools.git
5. Unfortunately, if you use Ubuntu, the supplied version of pycrypto will not work, so you need to get the full version here and set that up as per its installation instructions.
6. cd into bitcoin-import and type: make

Now the instructions for use, as given in privkeyimport.py:

1. Get the private key you wish to import in a text file. To do this, you either need to download the PDF of the printed money in a reader that can select the text and copy it, then paste it into a text file, OR get a QR code reader and paste the output text into a file. Whitespace is not important.
2. Run privkeyimport.py KEYFILE. This will write the key into your Bitcoin wallet. Use -n to just print without writing to the wallet.
3. Run bitcoin -rescan to ensure any transactions belonging to the imported key are added to the transaction list and balance.

As you can see, it requires a lot of technical fiddling, but no programming. Cleaner solutions will appear in time.
member
Activity: 92
Merit: 10
March 08, 2011, 12:50:11 AM
#72
I'm not a coder, or developer, and I am feeling lost here.  Sure, I downloaded stuff to install on linux that will enable me to print a certain amount of bitcoins in paper form, but I have not installed all these packages and run the python application.  Even if I did, is there another application for Reading a bill and then inserting the data into a wallet.dat?  If I manually insert data into a wallet.dat, how would I actually do it?  I've looked at the contents of my wallet.dat file, it's a confusing jumble of Hex stuff to me.  Until you developer types come up with an Easy tool to use to both print, and read, these Bitcoin bills, I think I'm going to be too lost to even attempt it.  Someone please develop a linux Package, that installs all the dependencies, or something.  Sheesh.

I went to the website and uploaded a fresh wallet containing only .20 BTC, and it quickly gave me a PDF file, and some other file I don't know what to do with.  I like the PDF, and printed it.  Very cool. Smiley
Hal
vip
Activity: 314
Merit: 3803
February 24, 2011, 06:28:28 PM
#71
The online QR encoder at http://zxing.org/w/decode.jspx works on the 6.66 Bitcoin note above, while it failed on the earlier ones. Helps to encode less data probably. Here's what it decodes to:

   bitcoin:priv=4RPhNpsD95XcjXG4637DwTNgQLh2eqQ7r7hH5yeLA16F;amount=6.660000;

On the other thread, Mike and Gavin suggested an important optimization: Include an optional block number where the address first appears. Otherwise the recipient has to scan the entire block chain to find transactions for that address, which can reportedly take a couple of minutes on a slow machine. Including the starting block number means you only have to scan from there, which will be very fast assuming it's a relatively new address.
newbie
Activity: 25
Merit: 7
February 24, 2011, 06:46:47 AM
#70
Dang, someone just took the 6.66 BTC!  Congrats to the winner.  I'm working on some java code and will release after I can verify it works.
Ah, sorry Jolly. I just got it again. I was bugged that my previous attempt couldn't get public keys out of private keys. Spent another couple of hours working on it, and wrote a tool to take a 32-byte private key and turn it into the full 279-byte DER key.

Had to trawl through the OpenSSL codebase for hours to find out how to do this. There are almost zero comments in that code, and absolutely none in the headers. Insane.

I've put my code online here:
https://code.launchpad.net/~mgiuca/+junk/bitcoin-import

I'd be interested to see what your code does when you put it up. Does yours use the Bitcoin wallet, or are you making your own transactions?
newbie
Activity: 42
Merit: 0
February 24, 2011, 06:43:06 AM
#69
Dang, someone just took the 6.66 BTC!  Congrats to the winner.  I'm working on some java code and will release after I can verify it works.

that's bad style, but on the other hand, your fault for printing it plain text

better joke would be to "steal" just a few percent to lower the value a bit.
not to make it completely worthless

I didn't print anything in plain text... Smiley
Pages:
Jump to: