Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: wb3 on March 05, 2011, 09:13:07 AM



Title: Code Question?
Post by: wb3 on March 05, 2011, 09:13:07 AM
I haven't run through all the code yet, I figure I might save time if I ask an operation question here:

I have multiple machines running multiple instances of BitCoin, and generating:

Question:

Assuming just local LAN connections (no internet), if I send BTC to another instance: will the other instance receive it ?

Assuming one of the machines finds a block, will that transmission be encapsulated ?

And if this happens several times for multiple blocks, And when Internet comes back, will the blocks be added to the chain ?


I am assuming yes to all of these, because the app will think the LAN is the Internet. (the LAN spans multiple IPs).

Or basically is it truly a distributed P2P?


The reason I am asking is that I think I found something interesting in the .dat hexfile and am going to try a white hat attack.



Title: Re: Code Question?
Post by: tcatm on March 05, 2011, 11:01:30 AM
> Assuming just local LAN connections (no internet), if I send BTC to another instance: will the other instance receive it ?
yes (assuming they're connected to each other)

> Assuming one of the machines finds a block, will that transmission be encapsulated ?
yes, the transaction will be included in that block

> And if this happens several times for multiple blocks, And when Internet comes back, will the blocks be added to the chain ?
only if your chain is longer than the "other" chain. If it's shorter, the transactions will be ripped from your blocks and included in future blocks (as long as the transactions are still valid)


Title: Re: Code Question?
Post by: TiagoTiago on March 05, 2011, 11:06:16 AM
If i'm not mistaken, only coins generated by solving blocks that were also solved in the rest of the Internet will go away.


Title: Re: Code Question?
Post by: wb3 on March 06, 2011, 11:37:03 PM
> Assuming just local LAN connections (no internet), if I send BTC to another instance: will the other instance receive it ?
yes (assuming they're connected to each other)

> Assuming one of the machines finds a block, will that transmission be encapsulated ?
yes, the transaction will be included in that block

> And if this happens several times for multiple blocks, And when Internet comes back, will the blocks be added to the chain ?
only if your chain is longer than the "other" chain. If it's shorter, the transactions will be ripped from your blocks and included in future blocks (as long as the transactions are still valid)

Very Helpful,

So if Lets call it Inet2 (of grid LAN,WAN), generates more Blocks than the Real BitCoin Blocks, then the Inet Blocks will be stripped and added to my chain.

Last question, Considering a fresh start of BitCoin on these machines in Inet2, What would the difficulty be in generating Blocks? Will it be as if it was a fresh start?

If so, the first proposal will be to do Inet2, and then Inet3, combine the blocks, and start Inet3 again, until blocks are larger than the real Inet. I should also be reaping the benefit of easier block creation.

Second,

It is then theoretically possible to create two BitCoin Inets running seperately until it is maxed out at 21 Million and then expose them to each other for a total of 42 Million BitCoins. Is this correct?




Title: Re: Code Question?
Post by: dirtyfilthy on March 07, 2011, 12:11:29 AM

So if Lets call it Inet2 (of grid LAN,WAN), generates more Blocks than the Real BitCoin Blocks, then the Inet Blocks will be stripped and added to my chain.

Last question, Considering a fresh start of BitCoin on these machines in Inet2, What would the difficulty be in generating Blocks? Will it be as if it was a fresh start?

If so, the first proposal will be to do Inet2, and then Inet3, combine the blocks, and start Inet3 again, until blocks are larger than the real Inet.

Second,

It is then theoretically possible to create two BitCoin Inets running seperately until it is maxed out at 21 Million and then expose them to each other for a total of 42 Million BitCoins. Is this correct?


It's not a case of "more blocks"  but total difficulty. A block with a difficulty of 10 counts for five blocks of difficulty 2. So it's very unlikely you'll overtake the main chain starting from scratch.


Title: Re: Code Question?
Post by: wb3 on March 07, 2011, 12:38:56 AM

So if Lets call it Inet2 (of grid LAN,WAN), generates more Blocks than the Real BitCoin Blocks, then the Inet Blocks will be stripped and added to my chain.

Last question, Considering a fresh start of BitCoin on these machines in Inet2, What would the difficulty be in generating Blocks? Will it be as if it was a fresh start?

If so, the first proposal will be to do Inet2, and then Inet3, combine the blocks, and start Inet3 again, until blocks are larger than the real Inet.

Second,

It is then theoretically possible to create two BitCoin Inets running seperately until it is maxed out at 21 Million and then expose them to each other for a total of 42 Million BitCoins. Is this correct?


It's not a case of "more blocks"  but total difficulty. A block with a difficulty of 10 counts for five blocks of difficulty 2. So it's very unlikely you'll overtake the main chain starting from scratch.

OK,

That make more sense, I do like "unlikely" problems. 

The BitCoin's earned for those blocks will still be with in the clients though, when added to the Inet chain. Keeping the difficulty to where one earns 50BTC for a block and then confirmed. Or will they be stripped, and given to the other clients that generate new blocks?

If so, I really like "unlikely" problems. If not, then I should still reap rewards from lessor difficulty mining before adding to the main chain and start over by sending 0.01 BTC between clients and waiting for the Block.

The whole key to this was starting at least one client off grid with at least 0.01 BTC. The 0.01 BTC is a confirmed transaction from the real chain.


Title: Re: Code Question?
Post by: theymos on March 07, 2011, 02:56:54 AM
When the two networks combine, the generations in the smaller network become invalid. All transactions based on those generated coins also become invalid.


Title: * Bigger LAN scenario
Post by: we6jbo on March 07, 2011, 04:04:06 AM
I might just be confusing the topic but what would happen if you had a LAN with more machines running bitcoin than all the machines running bitcoin on the Internet? In that case, would the LAN overtake the Internet?


Title: Re: * Bigger LAN scenario
Post by: theymos on March 07, 2011, 04:19:34 AM
I might just be confusing the topic but what would happen if you had a LAN with more machines running bitcoin than all the machines running bitcoin on the Internet? In that case, would the LAN overtake the Internet?

Only if the LAN has more CPU power.


Title: Re: * Bigger LAN scenario
Post by: Garrett Burgwardt on March 07, 2011, 05:05:41 AM
I might just be confusing the topic but what would happen if you had a LAN with more machines running bitcoin than all the machines running bitcoin on the Internet? In that case, would the LAN overtake the Internet?

Only if the LAN has more CPU power.

http://www.spectacularry.com/wp-content/uploads/2010/03/ghostbusters-twinkie.jpg

That's a big LAN


Title: Re: Code Question?
Post by: wb3 on March 07, 2011, 05:36:15 AM
When the two networks combine, the generations in the smaller network become invalid. All transactions based on those generated coins also become invalid.

So to take down the BitCoin network, generate a larger chain with a harder difficulty rating off the grid, and then when the blocks combine, all transactions based from the reward BTC (50,25,12.5, etc...) from the first network get voided, but the BTC Rewards from the off the grid BTC will continue. First Block on off grid matches Date, Time, etc of First Block on grid.

Ok, kind of hard from a LAN (even a significant one), but a Government (don't know). I think a couple of supper computers could do it relatively quickly. Currently China would be in the lead to take it down with 9.739 petaflops computer at hand.


I was hoping the first Block was an Anchor to which all others must be attached, with other anchors being added randomly.


Title: Re: Code Question?
Post by: bfever on March 07, 2011, 06:01:50 AM
The standard client has some built-in checks of the current block chain, so those will not accept another chain up to that point.

See the code in main.cpp:
Code:
    if (!fTestNet)
        if ((nHeight == 11111 && hash != uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")) ||
            (nHeight == 33333 && hash != uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")) ||
            (nHeight == 68555 && hash != uint256("0x00000000001e1b4903550a0b96e9a9405c8a95f387162e4944e8d9fbe501cd6a")) ||
            (nHeight == 70567 && hash != uint256("0x00000000006a49b14bcf27462068f1264c961f11fa2e0eddd2be0791e1d4124a")) ||
            (nHeight == 74000 && hash != uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")))
            return error("AcceptBlock() : rejected by checkpoint lockin at %d", nHeight);

So everything up to block 74000 is locked. I presume other checks will be added with next versions of the client to prevent some "hostile takeover" of the main block chain.



Title: Re: Code Question?
Post by: theymos on March 07, 2011, 06:05:42 AM
0.3.20.2 includes another checkpoint at 105,000.


Title: Re: Code Question?
Post by: marcus_of_augustus on March 07, 2011, 08:29:40 AM
Quote
Currently China would be in the lead to take it down with 9.739 petaflops computer at hand.

Yes, but petaflops does not translate well into hashes ... flops are floating point ops, hashes are purely integer ops ... you'll have to go classified to get relevant numbers on hashing power that could threaten bitcoin network. A worthy exercise if you're of the sleuthing mindset.