Bitcoin Forum
January 29, 2020, 09:20:02 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: .  (Read 4107 times)
ghdp
Newbie
*
Offline Offline

Activity: 3
Merit: 0



View Profile
.
July 01, 2014, 02:24:25 PM
Last edit: December 19, 2016, 10:03:32 PM by ghdp
 #1

.
1580332802
Hero Member
*
Offline Offline

Posts: 1580332802

View Profile Personal Message (Offline)

Ignore
1580332802
Reply with quote  #2

1580332802
Report to moderator
1580332802
Hero Member
*
Offline Offline

Posts: 1580332802

View Profile Personal Message (Offline)

Ignore
1580332802
Reply with quote  #2

1580332802
Report to moderator
1580332802
Hero Member
*
Offline Offline

Posts: 1580332802

View Profile Personal Message (Offline)

Ignore
1580332802
Reply with quote  #2

1580332802
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1580332802
Hero Member
*
Offline Offline

Posts: 1580332802

View Profile Personal Message (Offline)

Ignore
1580332802
Reply with quote  #2

1580332802
Report to moderator
1580332802
Hero Member
*
Offline Offline

Posts: 1580332802

View Profile Personal Message (Offline)

Ignore
1580332802
Reply with quote  #2

1580332802
Report to moderator
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 2436
Merit: 1142

Armory Developer


View Profile
July 03, 2014, 06:14:39 PM
 #2

Original seed is 256bits. If you know some Python it's rather easy:

https://github.com/etotheipi/BitcoinArmory/blob/master/armoryengine/ArmoryUtils.py#L1914

You can use that call to convert 128bits of entropy to an Armory backup string. Do it twice and you have created you own root key that you can then plug in the restore wallet function to create a wallet file out of it.

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 2436
Merit: 1142

Armory Developer


View Profile
July 03, 2014, 09:09:20 PM
 #3

You're on the right track so far.

There isn't a public seed per say. Address N+1 public and private components are derived from address N and a scalar which is created by hashing address N's public key and the chaincode.

The chaincode is an HMAC of the root key:

https://github.com/etotheipi/BitcoinArmory/blob/master/armoryengine/ArmoryUtils.py#L2941

You can read the derivation code here:

https://github.com/etotheipi/BitcoinArmory/blob/master/cppForSwig/EncryptionUtils.cpp#L681
https://github.com/etotheipi/BitcoinArmory/blob/master/cppForSwig/EncryptionUtils.cpp#L757

etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 03, 2014, 10:43:57 PM
 #4

My recommendation is to use a deck of cards.  Shuffle it to your heart's content, then type in the order of the cards into a string, such as "Ah9d3s3h...".  Hash that and use the resulting 32 bytes as your seed.  You can use armoryengine to do the conversions:  hash256() to hash the string, and "makeSixteenBytesEasy()" to convert each half of the string to a line that can be entered into the wallet restore window.

The order of a deck of cards has 225 bits of entropy, which is plenty big enough.  I tried the dice thing before, but it's a lot of dice rolls and it makes a lot of noise.  The deck of cards is much more pleasant Smiley


Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
TimS
Sr. Member
****
Offline Offline

Activity: 250
Merit: 252


View Profile WWW
July 04, 2014, 02:53:03 AM
 #5

My recommendation is to use a deck of cards.  Shuffle it to your heart's content, then type in the order of the cards into a string, such as "Ah9d3s3h...".  Hash that and use the resulting 32 bytes as your seed.  You can use armoryengine to do the conversions:  hash256() to hash the string, and "makeSixteenBytesEasy()" to convert each half of the string to a line that can be entered into the wallet restore window.

The order of a deck of cards has 225 bits of entropy, which is plenty big enough.  I tried the dice thing before, but it's a lot of dice rolls and it makes a lot of noise.  The deck of cards is much more pleasant Smiley


(highly scientific statement here Wink) Sometimes when I shuffle a deck, the cards are too similar to the original.
Dice sounds like a better method to me if you want a great real-world entropy source (and you have the time to spare), especially if you're not experienced at shuffling cards well.
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 04, 2014, 10:24:40 AM
 #6

You don't have to be good at shuffling:  just play 52-card pickup with yourself Smiley  Or less chaotic, just put all the cards on the floor or table and swirl them around for 60 seconds then put them back together.  The ordering of a deck of cards has 225 bits of entropy which is technically overkill anyway:  128 bits is generally accepted as forever-secure.  You'd have to be trying hard to "cheat" to end up with less.

Alternatively, you can roll a 6-sided die 50 times to get approximately 128 bits of entropy.  I'd recommend doing 160 to be safe, but 128 really is sufficient (technically a 256-bit private key has about 128 bits of entropy, anyway).

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 2436
Merit: 1142

Armory Developer


View Profile
July 04, 2014, 12:10:01 PM
 #7

I flip burgers for real life entropy. If the burger falls out of the pan, it counts as a 0, otherwise it's a 1. Each burger can only be flipped once. It maybe long and noisy, but it's delicious!

TimS
Sr. Member
****
Offline Offline

Activity: 250
Merit: 252


View Profile WWW
July 05, 2014, 12:22:37 PM
 #8

I made a few tests this morning : with 5 dices it takes less than five minutes to generate a 256 bits key. And not so much noise.
The disturbing thing is that the dices don't "look" random. I can see a lot of "patterns" in them : 23423 23451 ...
I think it's my imagination...
It's (almost definitely) your imagination. Humans are great at seeing patterns in random data, even when it's just that: random. Compare your data to a true-randomness-generated list at http://www.random.org/dice/?num=50 (this site has high quality true random numbers, not pseudo-random, but it's not a secure thing, so don't try to use it for your crypto/private key)
Is there any test to make on the root key before using it ?
Are some of them bad/weak ?
To the best of my knowledge, the only weak keys are ones whose addresses happen to correspond to ones with easily-guessed private keys. (e.g. because the private key is 0x000...0002, or comes from a brainwallet passphrase "duck", or from a poor PRNG) The probability of you hitting one of these accidentally is so small it's not practical to worry about it.
fallinglantern
Sr. Member
****
Offline Offline

Activity: 259
Merit: 251


View Profile
July 06, 2014, 01:11:50 AM
 #9

The disturbing thing is that the dices don't "look" random. I can see a lot of "patterns" in them : 23423 23451 ...

True random numbers often look off. Additionally, cheap dice typically aren't evenly distributed because the actual dimples cut out will create a weight imbalance which biases higher numbers. You can measure this by doing a few hundred rolls and drawing a histogram.

Since we're on the topic of using dice for generating encryption keys, you may find this interesting reading: http://world.std.com/~reinhold/diceware.html
CoinRocka
Sr. Member
****
Offline Offline

Activity: 250
Merit: 250


View Profile
July 09, 2014, 01:11:48 AM
 #10

What percentage of Armory users use dice/cards versus trusting the developer?
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 09, 2014, 02:46:45 PM
 #11

The question is not to trust or not trust the developers.
The question is how to remove the need for trust, not only in the developers, but also on the hardware.

A bad PRNG may come from :
- bad hardware, or badly used hardware (a fully offline computer gathers little entropy)
- mistakes in implementations

The first step was to generate a wallet without relying on any PRNG by using real dices. I consider this step done.
I am still relying on the official armory code to convert the "paper backup format" into a functional wallet (full wallet + watch only wallet).

The next step should be to generate the watch only wallet using only easily auditable code.

Armory has a backup tester specifically for this.  Technically, it does exactly what Armory would do when restoring a wallet from backup, but some people won't trust it unless they actually restore the wallet.  So either use the backup tester, or create the wallet you plan to use, create your single/fragmented backup and then wipe everything and restore it on a fresh version of Armory.  For the watch-only wallet, you can generate the first X addresses on the offline/full wallet, and then import the watch-only wallet to the online computer and verify it generates the same X addresses.  Technically, you only need 2 addresses since the equation is the same for generating subsequent addresses, but again people won't trust it unless they see it work a dozen times.  Compare 1,000 addresses if you have the patience to do so.


Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 09, 2014, 03:16:44 PM
 #12

Armory has a backup tester specifically for this.  Technically, it does exactly what Armory would do when restoring a wallet from backup, but some people won't trust it unless they actually restore the wallet.  So either use the backup tester, or create the wallet you plan to use, create your single/fragmented backup and then wipe everything and restore it on a fresh version of Armory.  For the watch-only wallet, you can generate the first X addresses on the offline/full wallet, and then import the watch-only wallet to the online computer and verify it generates the same X addresses.  Technically, you only need 2 addresses since the equation is the same for generating subsequent addresses, but again people won't trust it unless they see it work a dozen times.  Compare 1,000 addresses if you have the patience to do so.

I do "trust" that Armory works. And I did that (comparing addresses generated on the online vs offline computer).

What I don't know (and I don't want to fully "trust" you on this) is :
- how are the public keys calculated,
- what exactly is stored inside the watch only wallet file.

I admit I do not currently fully understand the part of the source code you pointed above. So I must do my homework and when I will be able to generate the watch only wallet myself I will be fully happy.


The logic is in EncryptionUtils::ComputeChainedPrivateKey and EncryptionUtils::ComputeChainedPublicKey.

Simply put, publicKey(i+1) is computed from publicKey(i) using:

Code:
multiplier(i) = hash256(PubKey(i)) XOR chaincode
PubKey(i+1) = PubKey(i) * multiplier(i)

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 09, 2014, 03:59:27 PM
 #13

I admit I do not currently fully understand the part of the source code you pointed above. So I must do my homework and when I will be able to generate the watch only wallet myself I will be fully happy.


The logic is in EncryptionUtils::ComputeChainedPrivateKey and EncryptionUtils::ComputeChainedPublicKey.

Simply put, publicKey(i+1) is computed from publicKey(i) using:

Code:
multiplier(i) = hash256(PubKey(i)) XOR chaincode
PubKey(i+1) = PubKey(i) * multiplier(i)


Yep, that's what I do not (yet) fully understand :
- how from a "Root Key" (the one on the paper backup) I get PrivKey(0) and Pubkey(0) (with what knowledge of PrivKey(0) ?)
- what information is stored in the watch only wallet
- and why it is secure to calculate the pubkey chain this way


You're walking down the math-heavy path of elliptic curve calculations.   It is described dozens of times elsewhere throughout the forum.  Look up "Type 2 deterministic wallets" originally conceived by gmaxwell. The watch-only wallet is an exact copy of the regular wallet without any private key data.  If you are uncomfortable, you can manually inspect the binary file and confirm that the private key fields are all 0x00 bytes.  

I forgot to mention above that the private keys are computed the same way.  I should've had.

Code:
multiplier(i) = hash256(PubKey(i)) XOR chaincode
PubKey(i+1) = PubKey(i) * multiplier(i)
PrivKey(i+1) = PrivKey(i) * multiplier(i)

Yes, you can derive the same chain of public keys using only the root public key, as the private keys derived the same way from the root private key.  This is the basic math behind "Type 2 deterministic" wallets and the basis for HD Wallets/BIP32 which is in-process of being adopted by all major wallets.  Armory and Electrum both demonstrated the power of type2 det wallets and have used them for years.  Now everyone else will be, too (however, Armory's deterministic wallets use a different type2 algorithm that I created before BIP32 existed, but it still has all the same security and privacy properties)

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Nyterax
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile WWW
July 14, 2014, 09:36:32 PM
 #14

Has it been considered to use a bunch of human mouse movements as seed, like TrueCrypt did?

@Nyterax
BTC: 1McgGk69g82epdnxAdDQfMSXtUygZfL4vZ
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 14, 2014, 09:38:23 PM
 #15

Has it been considered to use a bunch of human mouse movements as seed, like TrueCrypt did?

Armory already collects real world entropy, including mouse movements, clicks, key presses, and hashes of system files, when creating the wallet.  It bundles in that extra entropy with the Crypto++ RNG.  That extra entropy alone should be well in excess of 256 bits.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Nyterax
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile WWW
July 15, 2014, 03:00:56 AM
 #16

Has it been considered to use a bunch of human mouse movements as seed, like TrueCrypt did?

Armory already collects real world entropy, including mouse movements, clicks, key presses, and hashes of system files, when creating the wallet.  It bundles in that extra entropy with the Crypto++ RNG.  That extra entropy alone should be well in excess of 256 bits.
Oh, my bad. And then I fail to see how could that not be enough in any conceivable case.

@Nyterax
BTC: 1McgGk69g82epdnxAdDQfMSXtUygZfL4vZ
Perlover
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
July 24, 2014, 11:46:21 AM
 #17

Code:
multiplier(i) = hash256(PubKey(i)) XOR chaincode
PubKey(i+1) = PubKey(i) * multiplier(i)
As i understand if anybody knows my "i+1" public address and "i" address he can easy calculate chaincode?
Yes?
And same chaincode used in for generation of next private key?
So if anybody will define (i don't how it's gypotetical question) private key i+100, and he knows "i+1" and "i" public keys (for example i am shop and one customer bought 2 orders: one order -> two order and after he knows my chaincode?) he will know next private key and so on?
May be here is some vulnarabilities?
Perlover
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
July 24, 2014, 12:34:50 PM
 #18

Sorry, my mistake may be
I see now that multiplier is EC function.
I don't know how it works but now i think if anybody knows publicAddress(i+1) and publicAddress(i) he cannot find chaincode?
Perlover
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
July 24, 2014, 12:51:39 PM
 #19

Has it been considered to use a bunch of human mouse movements as seed, like TrueCrypt did?

Armory already collects real world entropy, including mouse movements, clicks, key presses, and hashes of system files, when creating the wallet.  It bundles in that extra entropy with the Crypto++ RNG.  That extra entropy alone should be well in excess of 256 bits.
One question please: data are collected in moment only when i press button "Create" or before?
I don't see any messages like "To move mouse, to press some keys" and don't understand where start and end time for real world  entropy?
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1005


Core Armory Developer


View Profile WWW
July 24, 2014, 02:28:45 PM
 #20

Has it been considered to use a bunch of human mouse movements as seed, like TrueCrypt did?

Armory already collects real world entropy, including mouse movements, clicks, key presses, and hashes of system files, when creating the wallet.  It bundles in that extra entropy with the Crypto++ RNG.  That extra entropy alone should be well in excess of 256 bits.
One question please: data are collected in moment only when i press button "Create" or before?
I don't see any messages like "To move mouse, to press some keys" and don't understand where start and end time for real world  entropy?

It's collected in the background as you go through the create-wallet process.  Only 32-bytes of entropy is needed, and the whole process collects far more than that, so there's no need to explicitly request the user do stuff.  Though, from a marketing perspective, it's probably better to make the user aware that it's happening.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!