{"id":139,"date":"2021-03-08T14:46:02","date_gmt":"2021-03-08T14:46:02","guid":{"rendered":"https:\/\/streetmindfood.com\/plutohash\/?p=139"},"modified":"2021-03-30T19:48:30","modified_gmt":"2021-03-30T19:48:30","slug":"bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python","status":"publish","type":"post","link":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/","title":{"rendered":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python"},"content":{"rendered":"\n

Hallo,<\/p>\n\n\n\n

for this tutorial we’ll see how to display information about a single block with PlutoHash Jupyter Notebook.<\/p>\n\n\n\n

First thing to do is to import BlockSci module.<\/p>\n\n\n\n

#import BlockSci module
import blocksci<\/pre>\n\n\n\n

The second thing we need to do is to instantiate the chain object:<\/p>\n\n\n\n

# instantiate the chain object
<\/code>chain = blocksci.Blockchain(\"\/BlockSci\/config_file\")<\/code><\/pre>\n\n\n\n

Now we select the year in which is contained the block or blocks we want to examine, for this example, we choose the year “2020”<\/p>\n\n\n\n

# instantiate the blocks of year 2020 in blocks:
%time blocks = chain.range(\"2020\")<\/pre>\n\n\n\n

Note that in this cell, before our command, there is %time. <\/p>\n\n\n\n

This will show CPU user time, sys, total, and Wall Time of the work done. It’s just performance check, it can be omitted. It can be useful to compare different algorythms performances and see if we can write a better one to do the analysis we want.<\/p>\n\n\n\n

Now we select the block at height 625332 within the blocks list of 2020:<\/p>\n\n\n\n

block = list(filter((lambda x: x.height == 625332), blocks.to_list()))<\/pre>\n\n\n\n

Now we’re ready to see some info of this block<\/p>\n\n\n\n

We can, obviously see the height of this block. We already know the height in this situation, as we typed it:<\/p>\n\n\n\n

print(\"block.height \", block[0].height)<\/pre>\n\n\n\n

We can see the total input and output count:<\/p>\n\n\n\n

print(\"Input Count: \", block[0].input_count)
print(\"Output Count:\", block[0].output_count)<\/pre>\n\n\n\n

We can see the Miner text, if present:<\/p>\n\n\n\n

print(\"Miner text (if present): \",block[0].miner())<\/pre>\n\n\n\n

As we can see in this block there is not. We can see the difficulty threshold:<\/p>\n\n\n\n

print(\"Difficulty threshold: \",block[0].bits)<\/pre>\n\n\n\n

This is the sum of the transactions fees of all the transactions:<\/p>\n\n\n\n

print(\"Fees: \",block[0].fee) <\/pre>\n\n\n\n

Which, togheter with the block_reward (12,5 btc at that time, before the halving to 6,25 happened in May 2020), composes the total reward for this block:<\/p>\n\n\n\n

print(\"Fees: \", block[0].revenue) <\/pre>\n\n\n\n

We can see the total size of all block data, expressed in bytes:<\/p>\n\n\n\n

print(\"Block size in byte: \",block[0].total_size) <\/pre>\n\n\n\n

And the total weight of the block<\/p>\n\n\n\n

And the total transactions value of this block:<\/p>\n\n\n\n

print(\"Transactions value: \", block[0].output_value\/1e8)<\/pre>\n\n\n\n

And we can see it’s pretty big. In fact in this block there is a 161,500 btc transaction, that, at the time it was executed, was worth $1,120,376,999.68<\/p>\n\n\n\n

At the time we write, it is the biggest transaction, in $ value, that has been ever made in Bitcoin history.<\/p>\n\n\n\n

See you at the next tutorial,<\/p>\n\n\n\n

and don’t forget to smile!<\/p>\n\n\n\n

Would you like to analyze the bitcoin blockchain using Python?<\/p>\n\n\n\n

Apply to our Beta Tester Program<\/strong>!<\/a><\/p>\n\n\n\n

You can also join our <\/a>developer channel<\/a>!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

Hallo, for this tutorial we’ll see how to display information about a single block with PlutoHash Jupyter Notebook. First thing to do is to import BlockSci module. #import BlockSci moduleimport blocksci The second thing we need to do is to instantiate the chain object: # instantiate the chain objectchain = blocksci.Blockchain(“\/BlockSci\/config_file”) Now we select the …<\/p>\n

Bitcoin Blockchain specific block data with Jupyter Notebook and Python<\/span> Read More »<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[5],"tags":[11,9,10,12,14,13],"yoast_head":"\nBitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash<\/title>\n<meta name=\"description\" content=\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash\" \/>\n<meta property=\"og:description\" content=\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/\" \/>\n<meta property=\"og:site_name\" content=\"PlutoHash\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PlutoHashcom\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-08T14:46:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-30T19:48:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746\" \/>\n\t<meta property=\"og:image:width\" content=\"657\" \/>\n\t<meta property=\"og:image:height\" content=\"746\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@plutohashcom\" \/>\n<meta name=\"twitter:site\" content=\"@plutohashcom\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Isaac\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.plutohash.com\/#organization\",\"name\":\"Plutohash\",\"url\":\"https:\/\/www.plutohash.com\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/PlutoHashcom\/\",\"https:\/\/www.instagram.com\/plutohashcom\/\",\"https:\/\/www.linkedin.com\/company\/plutohash\/?viewAsMember=true\",\"https:\/\/www.youtube.com\/channel\/UC2P2z4wHTCeH1PbPXU70F0w\",\"https:\/\/twitter.com\/plutohashcom\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.plutohash.com\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1\",\"width\":657,\"height\":746,\"caption\":\"Plutohash\"},\"image\":{\"@id\":\"https:\/\/www.plutohash.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.plutohash.com\/#website\",\"url\":\"https:\/\/www.plutohash.com\/\",\"name\":\"PlutoHash\",\"description\":\"Empowering Talents Worldwide\",\"publisher\":{\"@id\":\"https:\/\/www.plutohash.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.plutohash.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage\",\"url\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/\",\"name\":\"Bitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash\",\"isPartOf\":{\"@id\":\"https:\/\/www.plutohash.com\/#website\"},\"datePublished\":\"2021-03-08T14:46:02+00:00\",\"dateModified\":\"2021-03-30T19:48:30+00:00\",\"description\":\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\",\"breadcrumb\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.plutohash.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bitcoin Blockchain specific block data with Jupyter Notebook and Python\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.plutohash.com\/#\/schema\/person\/e61f4cda6af0a9451a2d2b3f300ccb4f\"},\"headline\":\"Bitcoin Blockchain specific block data with Jupyter Notebook and Python\",\"datePublished\":\"2021-03-08T14:46:02+00:00\",\"dateModified\":\"2021-03-30T19:48:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage\"},\"wordCount\":354,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.plutohash.com\/#organization\"},\"keywords\":[\"analysis\",\"bitcoin\",\"blockchain\",\"datascience\",\"programming\",\"python\"],\"articleSection\":[\"PlutoHash Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.plutohash.com\/#\/schema\/person\/e61f4cda6af0a9451a2d2b3f300ccb4f\",\"name\":\"Isaac\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.plutohash.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/6fe998d6ab02eb651823a22d8d6cbd01?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/0.gravatar.com\/avatar\/6fe998d6ab02eb651823a22d8d6cbd01?s=96&d=mm&r=g\",\"caption\":\"Isaac\"},\"url\":\"http:\/\/www.plutohash.com\/author\/isaacrallo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash","description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/","og_locale":"en_US","og_type":"article","og_title":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash","og_description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","og_url":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/","og_site_name":"PlutoHash","article_publisher":"https:\/\/www.facebook.com\/PlutoHashcom\/","article_published_time":"2021-03-08T14:46:02+00:00","article_modified_time":"2021-03-30T19:48:30+00:00","og_image":[{"width":657,"height":746,"url":"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_creator":"@plutohashcom","twitter_site":"@plutohashcom","twitter_misc":{"Written by":"Isaac","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.plutohash.com\/#organization","name":"Plutohash","url":"https:\/\/www.plutohash.com\/","sameAs":["https:\/\/www.facebook.com\/PlutoHashcom\/","https:\/\/www.instagram.com\/plutohashcom\/","https:\/\/www.linkedin.com\/company\/plutohash\/?viewAsMember=true","https:\/\/www.youtube.com\/channel\/UC2P2z4wHTCeH1PbPXU70F0w","https:\/\/twitter.com\/plutohashcom"],"logo":{"@type":"ImageObject","@id":"https:\/\/www.plutohash.com\/#logo","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1","width":657,"height":746,"caption":"Plutohash"},"image":{"@id":"https:\/\/www.plutohash.com\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.plutohash.com\/#website","url":"https:\/\/www.plutohash.com\/","name":"PlutoHash","description":"Empowering Talents Worldwide","publisher":{"@id":"https:\/\/www.plutohash.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.plutohash.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage","url":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/","name":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python - PlutoHash","isPartOf":{"@id":"https:\/\/www.plutohash.com\/#website"},"datePublished":"2021-03-08T14:46:02+00:00","dateModified":"2021-03-30T19:48:30+00:00","description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","breadcrumb":{"@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.plutohash.com\/"},{"@type":"ListItem","position":2,"name":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python"}]},{"@type":"Article","@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#article","isPartOf":{"@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage"},"author":{"@id":"https:\/\/www.plutohash.com\/#\/schema\/person\/e61f4cda6af0a9451a2d2b3f300ccb4f"},"headline":"Bitcoin Blockchain specific block data with Jupyter Notebook and Python","datePublished":"2021-03-08T14:46:02+00:00","dateModified":"2021-03-30T19:48:30+00:00","mainEntityOfPage":{"@id":"http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#webpage"},"wordCount":354,"commentCount":0,"publisher":{"@id":"https:\/\/www.plutohash.com\/#organization"},"keywords":["analysis","bitcoin","blockchain","datascience","programming","python"],"articleSection":["PlutoHash Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.plutohash.com\/2021\/03\/08\/bitcoin-blockchain-specific-block-data-with-jupyter-notebook-and-python\/#respond"]}]},{"@type":"Person","@id":"https:\/\/www.plutohash.com\/#\/schema\/person\/e61f4cda6af0a9451a2d2b3f300ccb4f","name":"Isaac","image":{"@type":"ImageObject","@id":"https:\/\/www.plutohash.com\/#personlogo","inLanguage":"en-US","url":"http:\/\/0.gravatar.com\/avatar\/6fe998d6ab02eb651823a22d8d6cbd01?s=96&d=mm&r=g","contentUrl":"http:\/\/0.gravatar.com\/avatar\/6fe998d6ab02eb651823a22d8d6cbd01?s=96&d=mm&r=g","caption":"Isaac"},"url":"http:\/\/www.plutohash.com\/author\/isaacrallo\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/139"}],"collection":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":1,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":140,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/139\/revisions\/140"}],"wp:attachment":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}