Pages:
Author

Topic: Avoiding Two Bitcoin Pitfalls (Read 1939 times)

legendary
Activity: 3472
Merit: 4801
April 12, 2013, 11:38:39 AM
#35
Mining cannot be done offline since every ten minutes you start searching for a different nonce.  Is that correct?

You need to supply the miner with a blockheader.  Building the blockheader requires, at a minimum, knowing what the hash of the most recently solved block was.  If you have a way to transmit this hash to the "offline" machine, then I suppose that the miner could do the searching for the nonce offline.  If the miner successfully finds a nonce that causes the block header to hash to a value that less than the target, then you'd need a way to transmit this nonce back to a machine that could broadcast the block to the network.

Note that the time to find a nonce is random.  It won't always be 10 minutes.  You can end up with two consecutive blocks found within seconds of each other. You can also have a couple hours between blocks.  The difficulty is adjusted to try to keep the average time between blocks close to 10 minutes over a period of 2016 blocks.

And if you find a nonce seconds after someone else you will most likely not get the reward because the majority of miners will start searching for the nonce following the block of the person that got there just before you. 

Correct.  The longer the elapsed time, the more widespread the other block will have been relayed.

Seems like there is a high frequency trading strategy here.  If you find a nonce, you are better off if you can propagate it faster than everyone else.

Correct. For this reason, mining pools will generally try to remain connected to a very large number of peers.
full member
Activity: 235
Merit: 250
April 12, 2013, 07:36:08 AM
#34
anybodies open on "zerocoin"?
newbie
Activity: 14
Merit: 0
April 12, 2013, 07:29:11 AM
#33
This is very helpful.  Thank you.

So it seems machines mine for nonces and get rewarded bitcoins. Once a nonce is found, the block is created which always has the new reward bitcoins and other transactions and the search for a new nonce begins. 

Mining cannot be done offline since every ten minutes you start searching for a different nonce.  Is that correct?

And if you find a nonce seconds after someone else you will most likely not get the reward because the majority of miners will start searching for the nonce following the block of the person that got there just before you.   Seems like there is a high frequency trading strategy here.  If you find a nonce, you are better off if you can propagate it faster than everyone else.
legendary
Activity: 1470
Merit: 1007
April 12, 2013, 05:27:31 AM
#32
Many people in here are helpful, but the first transaction I'm going to make once I have my first "real" wallet will be to send a tip to Mr. DannyHamilton
rpm
newbie
Activity: 11
Merit: 0
April 12, 2013, 03:01:03 AM
#31
Thank you for the information. It greatly heightened my understanding on the wallet/keys.
legendary
Activity: 3472
Merit: 4801
April 12, 2013, 02:36:02 AM
#30
Why arent bitcoins that solve more difficult problems worth more?

Bitcoins don't solve problems.  Bitcoins are given to miners for solving a block as a way of providing an incentive to perform the mining, and as a way to fairly issue the currency to the community.

Or the first bitcoin, that should be worth more.  I would rather have one millionth of the first bitcoin or the last bitcoin than one in the middle.

Due to a quirk in the way bitcoin was created, the first 50 bitcoin are unspendable.  They will most likely remain forever trapped, unspent, in the first block created.
legendary
Activity: 3472
Merit: 4801
April 12, 2013, 02:33:22 AM
#29
All bitcoins solve the same problem but with increasing levels of difficulty , is at correct?

Bitcoins don't solve anything.  Bitcoins are an abstraction that we humans use to make discussion of value easier.  In reality there is nothing that can be pointed to and say "that's a bitcoin".  Bitcoins are simply the sum total of the "value" fields of all unspent outputs associated with an address.

All miners solve a SHA-256 hash of the block header looking for a hash that has a value lower than a target difficulty.  When they find that hash, they publish the block.  In the block is a transaction with no inputs and outputs assigning block subsidy and transaction fees to the miner(s).

If I mine a bitcoin today that barely solves the problem, I should immediately put it in a block and take ownship.  But if I mine a bitcoin that solves the problem by a wide margin, I can sit on it because even when the difficulty goes up my coin will still be valid.  Is that correct?

Another way to put it is I could mine a coin that would have been a  slid bitcoin 6 months ago, but because the bar has been raised, it is not a bit coin today.  Today it is worthless.


No. Hopefully my previous post, and previous comment in this post, have clarified this.
legendary
Activity: 3472
Merit: 4801
April 12, 2013, 02:23:32 AM
#28
1- addresses have public and private keys, they can be easily generated but doesn't seem like there is any reason you couldn't have duplicate addresses, other than highly improbable.

highly, Highly, HIGHLY improbable.

Ok, new data, will recalc everything:

  • probability of getting struck by lightning in any given year: 1/280000.
  • probability of taking a shit at any given point in time: 1/(60*24) = 1/1440 (assuming you take a crap every day and the actual process takes 1 minute)
  • probability of getting struck by lightning while taking a crap in any given year: 1/(280000*1440) = 1/1.47E11 = 2.48E-9
  • probability of taking a crap while being in a situation where being struck by lightning can actually occur = 1/1440 = 0.25 = 1.74E-4
  • probability of finding a collision: 1E-65
  • getting hit by lightning while taking a crap for how many years in a row is equally probable as finding a collision: log(1E-65) / log(1.74E-4) = 17.3

is my math roughly correct now?

If so, I can say: "Finding a collision is about as likely as being struck by lightning while taking a crap every year for 17 years in a row".


2- the nonce within a block.  It seems like this has to be found like mining.

That's why they call it mining.

Do most miners mine for nonces?

All miners mine for nonces.  That's why they call it mining.

Once someone discovers the nonce for the current block the block is finalized and search for a new nonce begins.

Correct.

3- bitcoins themselves.  These seem to be some other key that miners search for and seems to be independent of the nonce.

Here you are mistaken.  New bitcoins value is simply freely assigned to the address of the miner in a special transaction (called a "coinbase" transaction) in the block.  This is the only transaction in the block that is allowed to exist without any inputs.

Once a coin is discovered (mined) it is put in a block so the miner has ownership, it is assigned to the miners address.

The miner builds the coinbase transaction before they start mining.  The coinbase transaction is just another transaction in the block.

Does each new block contain one and only one new bitcoin along with a bunch of other transactions?

No.  Each new block right now contains 25 new bitcoin (plus the transaction fees from the transactions in the block) in a single transaction, along with a bunch of other transactions.


Cryptographic entities I can think of at the moment:

  • Private key (and it's ECDSA public key counterpart)
  • SHA-256 hash of public key as a step towards generating public address
  • RIPEMD-160 hash of public key as a step towards generating public address
  • SHA-256 hash of transaction used as a transactionID
  • SHA-256 hash of block used as proof-of-work
  • Merkle-Root of chain of block transactions in the block header
  • ECDSA signature of transaction proving ownership of inputs
newbie
Activity: 6
Merit: 0
April 12, 2013, 02:15:03 AM
#27
+1 Thank you for the info.
newbie
Activity: 50
Merit: 0
April 12, 2013, 01:29:20 AM
#26
No need to apologize.  Asking about the things you don't understand is a good way to learn.  This is the Newbie forum after all.

Thank you for taking the time to provide in-depth answers. Although I'm not entirely new to Bitcoin, this thread has helped clarify some things and solidify my understanding. Your helpfulness is sincerely appreciated, as is your attitude regarding this being the Newbie forum.

By contrast...

But to store your privkeys in a wallet instead of knowing them is the height of foolishness.

If you don't know what a private key is, please don't use bitcoin.

Wow, what elitist crap. The height of foolishness? Don't use Bitcoin if you don't understand the technical underpinnings? And these comments are directed to people who are most likely new to Bitcoin! We all start life completely ignorant, and leave it almost as ignorant as we started. We learn some things along the paths of our lives but there is much more that we will never learn than what we do manage to learn. Everybody (other than the original architect(s)) had to learn about Bitcoin at some point. Treating new people as if their ignorance is "foolish" -- and disqualifies them from using Bitcoin! -- will do nothing to increase the adoption or correct (secure) use of Bitcoin.
newbie
Activity: 14
Merit: 0
April 11, 2013, 11:00:11 PM
#25
More questions

Why arent bitcoins that solve more difficult problems worth more?
Or the first bitcoin, that should be worth more.  I would rather have one millionth of the first bitcoin or the last bitcoin than one in the middle.
newbie
Activity: 14
Merit: 0
April 11, 2013, 10:50:37 PM
#24
More questions

All bitcoins solve the same problem but with increasing levels of difficulty , is at correct?

If I mine a bitcoin today that barely solves the problem, I should immediately put it in a block and take ownship.  But if I mine a bitcoin that solves the problem by a wide margin, I can sit on it because even when the difficulty goes up my coin will still be valid.  Is that correct?

Another way to put it is I could mine a coin that would have been a  slid bitcoin 6 months ago, but because the bar has been raised, it is not a bit coin today.  Today it is worthless.

newbie
Activity: 14
Merit: 0
April 11, 2013, 09:48:33 PM
#23
Yes this has been very informative.  New questions:

There seems to be at least 3 cryptographic elements

1- addresses have public and private keys, they can be easily generated but doesn't seem like there is any reason you couldn't have duplicate addresses, other than highly improbable.

2- the nonce within a block.  It seems like this has to be found like mining.  Do most miners mine for nonces?  Once someone discovers the nonce for the current block the block is finalized and search for a new nonce begins.

3- bitcoins themselves.  These seem to be some other key that miners search for and seems to be independent of the nonce.  Once a coin is discovered (mined) it is put in a block so the miner has ownership, it is assigned to the miners address.

Does each new block contain one and only one new bitcoin along with a bunch of other transactions?
newbie
Activity: 48
Merit: 0
April 11, 2013, 07:55:14 PM
#22
Danny: thanks, excellent explanation regarding the "change" being sent back - this should be added to the .it wiki
newbie
Activity: 16
Merit: 0
April 11, 2013, 07:48:17 PM
#21
Smiley
sr. member
Activity: 354
Merit: 250
April 11, 2013, 07:45:17 PM
#20
Holly shit. I've been trading these things for about two weeks now, and this thread is the first concise but still somewhat detailed explanation of bitcoins and transactions that I have seen. Thank you. This has really helped me.
legendary
Activity: 3472
Merit: 4801
April 11, 2013, 02:03:55 PM
#19
Thanks. Extremely interesting and very accessible the way you explain it. If you're not tired of my questions yet, could you explain what validation is vs what confirmation is (I used both terms interchangeable, and therefore incorrect, as it seems)

I'm not sure if there is a generally recognized meaning for "validation" and/or "verification", but the way I typically see them used:

"validation" and "verification" tend to be used interchangeably.  Every peer makes sure that anything they accept and relay (such as transactions and blocks) meet certain minimum requirements.  I'm not sure what the entire list of requirements is, but some of the key points are:

  • A reference hash is supplied for each input
  • A proper scriptSig is supplied for each input
  • None of the inputs have been spent in the blockchain yet.
  • None of the inputs have been spent in a currently known unconfirmed transaction.
  • The sum of the "values" of the inputs is greater than or equal to the sum of the "values" of the outputs
  • The transaction has the appropriate fee if necessary

If any of these verifications fails, the transaction won't be accepted by the peer and therefore won't be relayed to any other peers.

The first "confirmation" is the act of a miner broadcasting a properly solved block that includes the transaction.  Any peer that has a conflicting transaction in their list of "unconfirmed" transactions will accept the "confirmed" transaction as "official" and will remove the conflicting transaction from its memory.

Additional "confirmations" simply mean that additional blocks have been added to the blockchain after the block that contains the transaction.
hero member
Activity: 617
Merit: 559
April 11, 2013, 02:02:26 PM
#18
Thanks for hammering this message through to the newbies. I will be putting my crypto into cold storage soon with the private keys safely stored away in multiple places.

legendary
Activity: 1470
Merit: 1007
April 11, 2013, 01:35:32 PM
#17
Thanks. Extremely interesting and very accessible the way you explain it. If you're not tired of my questions yet, could you explain what validation is vs what confirmation is (I used both terms interchangeable, and therefore incorrect, as it seems)
newbie
Activity: 7
Merit: 0
April 11, 2013, 01:28:55 PM
#16
Thanks
Pages:
Jump to: