Bitcoin Forum
May 04, 2024, 10:47:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is the current difficulty included in blockchain?  (Read 657 times)
AmDD (OP)
Legendary
*
Offline Offline

Activity: 1027
Merit: 1005



View Profile
March 03, 2016, 06:15:50 PM
 #1

For example, if I lookup block 1492 is there any information included with the block in the blockchain that would give the difficulty at the time the block was mined?

BTC tip jar: 18EKpbrcXxbpzAZv3T58ccGcVis7W7JR9w
LTC tip jar: Lgp8ERykAgx6Q8NdMqpi5vnVoUMD2hYn2a
1714862876
Hero Member
*
Offline Offline

Posts: 1714862876

View Profile Personal Message (Offline)

Ignore
1714862876
Reply with quote  #2

1714862876
Report to moderator
1714862876
Hero Member
*
Offline Offline

Posts: 1714862876

View Profile Personal Message (Offline)

Ignore
1714862876
Reply with quote  #2

1714862876
Report to moderator
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714862876
Hero Member
*
Offline Offline

Posts: 1714862876

View Profile Personal Message (Offline)

Ignore
1714862876
Reply with quote  #2

1714862876
Report to moderator
--Encrypted--
Copper Member
Legendary
*
Offline Offline

Activity: 924
Merit: 1007

hee-ho.


View Profile
March 03, 2016, 06:17:30 PM
 #2

For example, if I lookup block 1492 is there any information included with the block in the blockchain that would give the difficulty at the time the block was mined?

https://blockchain.info/block/000000002590c6bd1c26c7afffb1dfb621950be4a6d9b89d019455c982997368

yes. it's not so hard to check.
jonnybravo0311
Legendary
*
Offline Offline

Activity: 1344
Merit: 1023


Mine at Jonny's Pool


View Profile WWW
March 03, 2016, 06:48:12 PM
 #3

Using the bitcoin client...

Code:
>bitcoin-cli getblockhash 1492
000000002590c6bd1c26c7afffb1dfb621950be4a6d9b89d019455c982997368

>bitcoin-cli getblock "000000002590c6bd1c26c7afffb1dfb621950be4a6d9b89d019455c982997368" true
{
  "hash": "000000002590c6bd1c26c7afffb1dfb621950be4a6d9b89d019455c982997368",
  "confirmations": 399504,
  "size": 216,
  "height": 1492,
  "version": 1,
  "merkleroot": "5c24d1f94f5315b8d9808f83e18a1dfce2dcfd1c4f3cae1241f38647908b1a76",
  "tx": [
    "5c24d1f94f5315b8d9808f83e18a1dfce2dcfd1c4f3cae1241f38647908b1a76"
  ],
  "time": 1232763992,
  "mediantime": 1232762084,
  "nonce": 3780540712,
  "bits": "1d00ffff",
  "difficulty": 1,
  "chainwork": "000000000000000000000000000000000000000000000000000005d505d505d5",
  "previousblockhash": "00000000b7f525ddd961b69117ec21f5fc253af5a60be885a72cab6cc65b4adc",
  "nextblockhash": "00000000c3a7bc56d1eaace7a174de16999db9e747aeec41ab62318f812b2678"
}

Hope this helps Smiley

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
AmDD (OP)
Legendary
*
Offline Offline

Activity: 1027
Merit: 1005



View Profile
March 03, 2016, 08:05:25 PM
 #4

Awesome, thanks! I knew some block explorers would show this but I didnt know if they collected the info manually (checking the difficulty in realtime with each block) or if it was actually recorded with the blockchain.

Thank you both

BTC tip jar: 18EKpbrcXxbpzAZv3T58ccGcVis7W7JR9w
LTC tip jar: Lgp8ERykAgx6Q8NdMqpi5vnVoUMD2hYn2a
watashi-kokoto
Sr. Member
****
Offline Offline

Activity: 682
Merit: 268



View Profile
March 03, 2016, 09:32:54 PM
 #5

Thank you both

Yes difficulty is part of block header.

This way node can just from seeing the header know if it satisfies the difficulty.

But the node also checks if the difficulty itself is not fake (lower) by calculating the current difficulty from whole blockchain.
Pages: [1]
  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!