Bitcoin Forum
March 28, 2024, 10:17:23 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Avoiding Two Bitcoin Pitfalls  (Read 1878 times)
xerafoo
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
April 12, 2013, 12:48:17 AM
 #21

Smiley
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711664243
Hero Member
*
Offline Offline

Posts: 1711664243

View Profile Personal Message (Offline)

Ignore
1711664243
Reply with quote  #2

1711664243
Report to moderator
BitCloud
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile
April 12, 2013, 12:55:14 AM
 #22

Danny: thanks, excellent explanation regarding the "change" being sent back - this should be added to the .it wiki
Undercover
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 12, 2013, 02:48:33 AM
 #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?
Undercover
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 12, 2013, 03:50:37 AM
 #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.

Undercover
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 12, 2013, 04:00:11 AM
 #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.
Crenel84
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile WWW
April 12, 2013, 06: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.
XaYdEk
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
April 12, 2013, 07:15:03 AM
 #27

+1 Thank you for the info.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
April 12, 2013, 07: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
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
April 12, 2013, 07: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.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
April 12, 2013, 07: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.
rpm
Newbie
*
Offline Offline

Activity: 11
Merit: 0


View Profile
April 12, 2013, 08:01:03 AM
 #31

Thank you for the information. It greatly heightened my understanding on the wallet/keys.
oda.krell
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
April 12, 2013, 10: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

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
Undercover
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 12, 2013, 12:29:11 PM
 #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.
btcforall777
Full Member
***
Offline Offline

Activity: 235
Merit: 250


View Profile
April 12, 2013, 12:36:08 PM
 #34

anybodies open on "zerocoin"?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
April 12, 2013, 04:38:39 PM
 #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.
Pages: « 1 [2]  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!