Bitcoin Forum
March 19, 2024, 06:51:38 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: [BOUNTY] Project: Private Key Label Printer for BitAddress.org  (Read 5565 times)
piit79
Sr. Member
****
Offline Offline

Activity: 336
Merit: 250


Time for Plan ฿


View Profile
June 16, 2013, 02:35:36 PM
 #21

I see, that's great. They do have templates on the website but not full specs. I guess I will order a few sheets to start with and measure and supply the required info.
1710831098
Hero Member
*
Offline Offline

Posts: 1710831098

View Profile Personal Message (Offline)

Ignore
1710831098
Reply with quote  #2

1710831098
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 16, 2013, 02:40:08 PM
 #22

I see, that's great. They do have templates on the website but not full specs. I guess I will order a few sheets to start with and measure and supply the required info.

Or just contact the company and ask for them?
BitKoot
Member
**
Offline Offline

Activity: 113
Merit: 10



View Profile
June 16, 2013, 03:06:41 PM
 #23

There is one problem with presets; every browser and every printer prints pages differently (especially the margins are different, and the DPI of the printer will also have an effect because CSS assumes a default DPI of 96).

It's better to give users enough control so they can try to find the right parameters with a few blank normal paper pages before printing on the sticker pages.
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 16, 2013, 03:24:39 PM
 #24

There is one problem with presets; every browser and every printer prints pages differently (especially the margins are different, and the DPI of the printer will also have an effect because CSS assumes a default DPI of 96).

It's better to give users enough control so they can try to find the right parameters with a few blank normal paper pages before printing on the sticker pages.

Mine uses PDFs so you just print it as actual size with the correct paper size and it will come out the same on every printer.
casascius (OP)
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1135


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 16, 2013, 06:00:30 PM
 #25

The 29mm labels are going to be the best fit on the coins but probably going to be harder to find in the US where 1 inch (25.4mm) is far more common unless someone wants to pay expensive shipping from outside US.  Ideally it should work with any labels - someone should be able to figure out the numbers for their particular labels and then hit print.

The send many command also needs to send to the Bitcoin address not the private key (starts with 1 not 5) and also needs to be a comma and space after the amount.

Also this would work so much better if it could generate the 30 character minikey and not the full length 51 char privkey. Mini keys are easy to generate, just generate 'S' plus 29 random alphanumerics in the base58 set, do a quick sha256 test on it+'?' (only 1 in 256 codes will pass the test), and increment or regenerate the code until you get one that passes. When you have one that passes just take sha256 of the string and use it as a private key. Minikey is described on the Bitcoin wiki and redemption is well established since I use it in Casascius Coins. I am willing to pay this bounty out more than once and would love to see bitaddress modified to make minikeys.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
BitKoot
Member
**
Offline Offline

Activity: 113
Merit: 10



View Profile
June 16, 2013, 06:35:04 PM
 #26

I have made it possible to choose the units you want to enter the measurements in (inches, milimeters and pixels). As a quick check to see if you have the right numbers the width and height of the sheet in the chosen units are shown. That should allow anyone anywere to get the right dimensions for the generated labels in their preferred units.

I have fixed the send many string (added comma and put in the public adres (painfull mistake Smiley).

I will have a look at the mini key specification tomorrow if time permits. Sounds like a good solution if the user wants some custom text added to the label.

Units in milimeters:


Units in pixels:
casascius (OP)
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1135


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 16, 2013, 06:36:55 PM
 #27

I plan to pay this bounty out more than once so please don't worry about your "competition", please feel free to "steal" one another's ideas, as ultimately the most desirable end result is one fork that has every benefit that's been thought of here.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 16, 2013, 06:57:14 PM
 #28

The 29mm labels are going to be the best fit on the coins but probably going to be harder to find in the US where 1 inch (25.4mm) is far more common unless someone wants to pay expensive shipping from outside US.  Ideally it should work with any labels - someone should be able to figure out the numbers for their particular labels and then hit print.

The send many command also needs to send to the Bitcoin address not the private key (starts with 1 not 5) and also needs to be a comma and space after the amount.

Also this would work so much better if it could generate the 30 character minikey and not the full length 51 char privkey. Mini keys are easy to generate, just generate 'S' plus 29 random alphanumerics in the base58 set, do a quick sha256 test on it+'?' (only 1 in 256 codes will pass the test), and increment or regenerate the code until you get one that passes. When you have one that passes just take sha256 of the string and use it as a private key. Minikey is described on the Bitcoin wiki and redemption is well established since I use it in Casascius Coins. I am willing to pay this bounty out more than once and would love to see bitaddress modified to make minikeys.


Just generating 256 takes 9 seconds on my computer so a whole sheet would take about 10 minutes!

I will give it a go but its going to be slow.
JohnGalt
Full Member
***
Offline Offline

Activity: 249
Merit: 114


Who is John Galt?


View Profile
June 16, 2013, 07:46:23 PM
 #29

I used 1.125" labels from sheet-labels.com for my coins. The part number is SL266. The labels are slightly smaller than the space on the coin so that you don't have worry as much about aligning them perfectly.

Also, because my printer doesn't have good registration, I had to add quite a bit of buffer around the edge of the labels in case the paper wasn't aligned perfectly.

I used the minikey format to generate the QR code. I chose the Q error correction level (30% maybe?). Fewer bits with more error correction makes the QR code more durable and requires less camera resolution to read the code. Take a look at the difference.

Here is a minikey with Q error correction:


Here is a base-58 key with Q error correction:

Trade physical bitcoins: Economy > Marketplace > Goods > Collectibles
My signing address: 19mzFU4zFrZHkAkHSUta6LapJ6fTFJyhiH
casascius (OP)
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1135


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 16, 2013, 10:08:41 PM
 #30

Just generating 256 takes 9 seconds on my computer so a whole sheet would take about 10 minutes!

I will give it a go but its going to be slow.

Chrome seems to run javascript the fastest by far.

Generating minikeys requires a fair bit of throwing away possible candidates.  If those candidates are being generated randomly each time, the random number generation might be an easily removed bottleneck.  Simply generate ONE random candidate, and if it's not valid, increment it until it is.  The act of incrementing it is likely to be much faster than redoing the entire random generation.  Obviously, once you find a candidate, the next one must be random.

By "increment", I simply mean the following: look at the last character of the candidate, and increment it, UNLESS it was: H,N,k (in this case, increment it twice to skip illegal characters I,O,l), OR if it was 9 make it an A, OR if it was Z make it a (lowercase) a, OR if it was a z, then make it a 2 and repeat the incrementing process on the preceding character.  (Yes ordinarily it should be a 1, but I'm biased against the number 1 appearing in minikeys since they are the #1 cause of complaints when people type them as "l" and I have therefore eliminated them from all my series 2 coins, but they are otherwise still legal for minikeys)


Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
LAMarcellus
Full Member
***
Offline Offline

Activity: 180
Merit: 100


View Profile
June 17, 2013, 02:32:48 PM
 #31

I have a similar need.
See https://bitcointalk.org/index.php?topic=236521.new#new
Thank you!

The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion. – Albert Camus
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 17, 2013, 04:40:27 PM
 #32

This makes mini keys but uses the javascript random number generator which is not good for cryptography i tried using the BitAddress SecureRandom function but i cant understand how it works. Can someone have a look at this?

Code:
//This code unsuitable for cryptographic purposes due to the use of Math.random();
//Bitcoin Grid - bitcoingrid.com
generateMiniKey: function (){
var possible = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
do{
var key = "S";
for( var i=0; i < 29; i++ ){
key += possible.charAt(Math.floor(Math.random() * possible.length));
}
} while (!Bitcoin.ECKey.isMiniFormat(key));
return key;
}
BitKoot
Member
**
Offline Offline

Activity: 113
Merit: 10



View Profile
June 17, 2013, 05:48:07 PM
Last edit: June 18, 2013, 09:03:43 AM by BitKoot
 #33

Ok, let's work together on this Smiley

This should do the trick using the SecureRandom random number generator from BitAddress:

[edit 18-06]: Added the incremental key altering suggested by casascius to make finding valid keys faster. Firefox and IE only take 8 seconds for a full sheet now, Chrome is even faster.

Code:
generateMiniKey: function () {
  var rng = new SecureRandom();
  var possible = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
  var key = "S";
  
  for(var i = 0; i < 29; i++) {
    // Get a secure random number. The first argument to the BigInteger constructor
    // is the maximum number of bits to use, the second argument is the random number generator.
    var randomNumber = this.getSecureRandomNumber(rng, 0, possible.length - 1);
    key += possible.charAt(randomNumber);
  }
  
  // Replace random characters at random positions in the key until we found a valid minikey        
  do {
    var keyIndex = this.getSecureRandomNumber(rng, 1, key.length - 1);
    var replacementChar = possible[this.getSecureRandomNumber(rng, 0, possible.length - 1)];
    key = key.replaceAt(keyIndex, replacementChar);
  } while (!Bitcoin.ECKey.isMiniFormat(key));
  return key;
},

getSecureRandomNumber: function(rng, lowerBound, upperBound) {
  var randomNumber = lowerBound - 1;
  
  do {
    randomNumber = new BigInteger(upperBound.toString(2).length, rng);
  }
  // Filter out any numbers which have the right amount of bits, but are outside the upperBound.
  while(randomNumber < lowerBound || randomNumber > upperBound);
  
  return randomNumber.intValue();
},

You'll also need this string prototype function:
Code:
String.prototype.replaceAt=function(index, character) {
  return this.substr(0, index) + character + this.substr(index+character.length);
};

Added minikey generation (works with QR and text) and the ability to add one row of custom text:



Now I need to improve the positioning and scaling of the text and QR codes, because I'm not completely satified yet.
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 18, 2013, 03:56:40 PM
 #34

My version is done, it runs best in chrome.

Javascript Casascius Aluminium Coins Printer (All JS In One File)

Source split in to separate files (As ZIP)
dave3k
Full Member
***
Offline Offline

Activity: 147
Merit: 100


Realbitcoin.info


View Profile WWW
June 18, 2013, 04:56:34 PM
 #35


Great work!

Was testing, then my printer run out off ink on the first sheet!  Angry
In other news, you finished the job faster then it took me to get the labels!

Please let me know your public key so I can 'buy' you some labels!  Tongue
Same goes for the next person to finish.

The one problem I did run across was the "change your paper size" text was acros the labels if using small margins,
but these could be edited out.

Realbitcoin.info
Bitcoin Grid
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile WWW
June 18, 2013, 05:28:16 PM
 #36


Great work!

Was testing, then my printer run out off ink on the first sheet!  Angry
In other news, you finished the job faster then it took me to get the labels!

Please let me know your public key so I can 'buy' you some labels!  Tongue
Same goes for the next person to finish.

The one problem I did run across was the "change your paper size" text was acros the labels if using small margins,
but these could be edited out.

Just delete line 10401 or do a ctrl-f for this and just remove it
Code:
doc.text(10,4,'When printing use the "actual size" option and change your paper size to '+ base.format);

I will make it smaller in v0.2
BitKoot
Member
**
Offline Offline

Activity: 113
Merit: 10



View Profile
June 18, 2013, 07:49:35 PM
Last edit: June 21, 2013, 12:26:55 PM by BitKoot
 #37

My version is done as well. I finaly managed to get the label and QR code placement better.  Chrome is the way to go. IE and Firefox struggle with the key generation which takes a lot longer than Chrome.

Link: BitAddress fork 0.1

I would like to hear some feedback. But please, try it on 'normal' paper first before trying it on actual sticker sheets Wink.

My version is done, it runs best in chrome.

Nice work Bitcoin Grid! I like the countdown when generating labels, and the fact that you made everything configurable. I have opted to try and find a best fit for the QR code and font sizes during code generation based on the label width.

Edit 21-06: Uploaded v 0.2. Sometimes the QR codes would come out blurry. This happened if the number of modules in the QR code was not a multiple of the number of pixels in the QR code width. Now by default the QR code width in pixels is a multiple of the modules in the QR code. If you want the code to be stretched to the maximum available width of the label, you can still do so by ticking the 'Allow QR scaling' checkbox.

I have also included jQuery. This will allow me to do more positioning and scaling improvements much more easily in the future (I plan on rewriting some of the old code to jQuery as well).

Link: BitAddress fork 0.2
dave3k
Full Member
***
Offline Offline

Activity: 147
Merit: 100


Realbitcoin.info


View Profile WWW
June 21, 2013, 04:43:39 PM
Last edit: June 21, 2013, 08:51:36 PM by dave3k
 #38

 Still waiting for my labels, but everything is working well.

Thanks again guys.
I have sent Bitkook And Bitcoin Grid 0.2 Btc

ba427a040ebdf74c4afddb62cdd214b537603a04d2ea382be3bdaafc8a639b4b
e75a3e4dad2fed5cd3a8778d24f1ef1d64581ddfd4fc2607f88019d8348f6236

Realbitcoin.info
piit79
Sr. Member
****
Offline Offline

Activity: 336
Merit: 250


Time for Plan ฿


View Profile
June 21, 2013, 07:13:11 PM
 #39

Great work! Kudos to you both. I will send specs of the round labels that can be purchased here in the UK soon when I get them.
casascius (OP)
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1135


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 21, 2013, 08:48:55 PM
 #40


So far, looks great!

Is there a way to not print the black circles?  (e.g. perhaps the CSS can be set such that the circle itself only appears on screen but not the paper)

Also is there a way to set the denomination as it appears in the sendmany command?  (it seems like perhaps it's hardcoded at 0.01)


This looks great too!  Same on the circles, any way to not print them?

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
Pages: « 1 [2] 3 »  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!