Bitcoin Forum
May 06, 2024, 07:39:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Mining / Re: Create a block first offline and submit it to be the winner - possible? on: January 22, 2019, 04:45:28 PM
I thought I understood - but need clarification.  The response earlier suggested that the difficult hash function has nothing to do with the transactions in the block - so is that a common misunderstanding?  I have browsed several explanations e.g. https://medium.freecodecamp.org/how-bitcoin-mining-really-works-38563ec38c87.  Here is says that block header is:

The version of software the Bitcoin client is running
The timestamp of the block
The root of its containing transactions' merkle tree
The hash of the block before it
A nonce
The target

In my illustration when I was saying "current transactions" I was referring to the merkle tree as well.  So this is saying the same thing that the input is basically current transactions in my block (merkle tree) and hash of  previous etc + nonce.

So apologize for repeating the question that if I start my effort early, why would it not give me a head start?  Isnt the rough logic of a miner

Code:
while ( accumBlockSize < myMaxBlockSize && maxTimeIwantHasNotPassed )
{
    takeTransctionFromPoolAndAdd
    accumBlockSize += sizeOfNewTransaction
}

// Now I have enough lets hope I can create a good Header
for ( ;; )
{
    myHash = getHash ( all inputs, merkelRoot (transactions), nonce )
    if ( myHash is valid per rules )
        break;
    nonce++
}

// If I am here I have a valid block
broadCastAndPrayItIsAccepted();

vs

Code:
fork ( sinceBlockHeaderHasNothingToDoWithTransactionsCreateNewBlockHeader)

while ( .... )
{
    accumate Transactions
    waitFotThreadToCompleteAsync
    {
        if I completed - dont care how many transactions- just broadcast
    }
}

Per earlier responses I understood that generally miners execute second type of logic so head-start wont matter.  On my laptop with 0 transactions it will take 10+ minutes to get the hash output so no point even playing the game.

But per lots of posts it seems to be the former hence re-ask.

With today's difficulty, is there a website or something where I can see how long it will take to get the hash function output that is valid?  Will it take > 10 minutes on most personal computers?

Thanks again and no flames please!
2  Bitcoin / Mining / Re: Create a block first offline and submit it to be the winner - possible? on: January 17, 2019, 09:46:00 PM
Actually makes perfect sense.  Thanks

The analogy of "followup question" clarifies it.
3  Bitcoin / Mining / Re: Create a block first offline and submit it to be the winner - possible? on: January 17, 2019, 08:20:39 PM
Appreciate your time; and I assume that I am misunderstaning something so I want to see how the prtocol defends against it.  What I undersatnd is that a block is approximately as follows:

1. hash of previous block which I get only once previous block is broadcast.  I assume that was by someone else
2. Some representation of 1500 transactions
3. A new hash made up by #1 and #2 which is expensive to get.

So first mistake I probably made is that I underestimated the difficulty of #3.  Maybe for simple hardware it is in order of hours - so lets change the problem statement a bit - I get specialized hardware; now I just want to win against other specialized hardware to recoup the cost.

If my understanding that new block is made of #1, #2, and #3 - then

If #2 becomes true roughly 5 minutes after last block (3 trx/second 1500 trx/block) then if I get that 5 minute headstart (because I have not pushed those 1500 transactions yet).  So at some time later I compute #3.  Now I have a full valid block that I am ready to broadcast.

Now I first broadcast the 1500 transactions - that should not take much time.
And immediately follow up with the broadcast of my block that includes those 1500 transactions.

Now the question is that majority of the miners should somehow reject my block - and that is what I am trying to determine - what is the algorithm that tells them to not accept this block.
4  Bitcoin / Mining / Create a block first offline and submit it to be the winner - possible? on: January 17, 2019, 05:55:45 PM
Lets say I create two addresses and transfer between them - there is nothing wrong with this transaction right?  eventually there is no reason for the ledger to consider it invalid.

Both addresses are mine so I am sure that there is no transaction that will appear in the ledger while I am doing this.

So as soon as a block is added, I take that key and construct a block myself first as it should.  Then I push my transactions first (which are enough to make a full block - I know that already) and immediately declare that I have a block as well.

Currently the average is < 5 transactions per second.  

Using my sub-par hardware I still manage to generate the key for the block.  Roughly 1500 are needed to make a block.  So approximately at present rate a miner starts working on the hash about 300 seconds after completion of previous block.  I will start immediately after so I will get several second head-start.  Will I not win and with valid transactions?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!