Bitcoin Forum
November 24, 2017, 04:35:21 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: Python Blockchain  (Read 3074 times)
BlockXchain
Newbie
*
Offline Offline

Activity: 11


View Profile WWW
June 24, 2017, 09:35:34 PM
 #1

Hi, can anyone point me in the direction of how to build a blockchain using python? I can do everything except the networking based on this guide: http://blockxchain.org/2017/06/04/building-a-blockchain-with-python-1/

BlockXchain.org
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
Join ICO Now Coinlancer is Disrupting the Freelance marketplace!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
1511498121
Hero Member
*
Offline Offline

Posts: 1511498121

View Profile Personal Message (Offline)

Ignore
1511498121
Reply with quote  #2

1511498121
Report to moderator
Velkro
Legendary
*
Offline Offline

Activity: 1260


<3 Vanity Addresses :)


View Profile
June 24, 2017, 11:05:17 PM
 #2

Hi, can anyone point me in the direction of how to build a blockchain using python? I can do everything except the networking based on this guide: http://blockxchain.org/2017/06/04/building-a-blockchain-with-python-1/
You want develope your own coin using python?
If not, its easier to just run binaries and write your application in whatever language you like Smiley

mrblockchain
Member
**
Offline Offline

Activity: 79


View Profile
June 25, 2017, 04:16:03 PM
 #3

I'd be interested in learning more about building Blockchains in Python too.

Are you wanting to do this for projects unrelated to a coin currency?

BlockXchain
Newbie
*
Offline Offline

Activity: 11


View Profile WWW
June 25, 2017, 09:11:01 PM
 #4

Yes I would just like to understand blockchain a bit better, and Python is what I'm most comfortable with.

BlockXchain.org
mrblockchain
Member
**
Offline Offline

Activity: 79


View Profile
June 27, 2017, 02:04:55 AM
 #5

Have you checked Libraries.io or Github to see if there is anything that works for what you need?

NiHaoMike
Full Member
***
Offline Offline

Activity: 238


View Profile
June 27, 2017, 02:53:22 AM
 #6

https://docs.python.org/2/library/hashlib.html
Let's start by taking something (anything that can be hashed, try the string "Bitcoin Rocks!" if you can't think of anything else) and finding the SHA256 of it. You'll get a long string of hex digits. Then take the SHA256 of that and you'll get another long string of hex digits. You can keep doing that as many times as you like, keeping in mind that because the space of 256 bits is so vast, you'll have a better chance of winning the jackpot 10 times in a row than you would getting back to a sequence you have already seen. That's what is known as a hash chain. (BTW, I very recently used that technique to come up with pseudorandom numbers in some testing code I wrote!)

Now let's make a slight change. Instead of hashing the last hash by itself, let's concatenate some other data first. And part of that "other data" is a number known as a nonce. We'll also instead of just accepting any hash value, require that for a hash to be accepted, there must be some criteria like the first few digits have to be zeros, having to brute force a nonce that makes that happen. (If you want to try it for yourself, keep it reasonable like the first two hex digits (8 bits) have to be zero, otherwise you'll be waiting a long time!)

That is a very simplified explanation of how a block chain works.

Those who have/had free electricity have wanted a way to turn that into money. With cryptocurrency, that has become a reality, but there's still no free lunch.
BlockXchain
Newbie
*
Offline Offline

Activity: 11


View Profile WWW
June 27, 2017, 07:21:59 PM
 #7

Thanks for the replies! I am fairly comfortable with what a blockchain is as a data structure, but I cannot manage to build a peer-to-peer network in python that allows for consensus and such. Any suggestions? Niavechain was the closest thing to it.

BlockXchain.org
redigaffi
Jr. Member
*
Offline Offline

Activity: 41


View Profile
June 27, 2017, 07:24:55 PM
 #8

Im interested in this too.

I've opened a thread that mya could help you:

https://bitcointalk.org/index.php?topic=1988151.0

Between what is exactly your question ?
head.arrow
Full Member
***
Offline Offline

Activity: 123

CareerXon - PRESALE ON 4TH NOV 50% BONUS


View Profile WWW
July 02, 2017, 04:56:20 PM
 #9

check bitcointalk services section
you might get help there

tspacepilot
Legendary
*
Offline Offline

Activity: 1400


I may write code in exchange for bitcoins.


View Profile
July 03, 2017, 06:02:26 PM
 #10

Thanks for the replies! I am fairly comfortable with what a blockchain is as a data structure, but I cannot manage to build a peer-to-peer network in python that allows for consensus and such. Any suggestions? Niavechain was the closest thing to it.

Can you provide more detail about where you are stuck?  You're familiar with the blockchain data structure, but you're not managing to build a peer-to-peer network.  Is it your understanding of the consensus algorithm or is implementation detail that's holding you up.  This is the technical discussion section of the forum, don't be afraid to be technical.  Let us know where you ran aground.

BlockXchain
Newbie
*
Offline Offline

Activity: 11


View Profile WWW
July 06, 2017, 01:53:56 AM
 #11

Thanks for the replies! I am fairly comfortable with what a blockchain is as a data structure, but I cannot manage to build a peer-to-peer network in python that allows for consensus and such. Any suggestions? Niavechain was the closest thing to it.

Can you provide more detail about where you are stuck?  You're familiar with the blockchain data structure, but you're not managing to build a peer-to-peer network.  Is it your understanding of the consensus algorithm or is implementation detail that's holding you up.  This is the technical discussion section of the forum, don't be afraid to be technical.  Let us know where you ran aground.


It's the implementation. I know very little about networking. I understand the consensus algorithm, but am failing implement a way to open connections with peers, and send and receive information. I've been playing around with sockets, but would love any advice!

BlockXchain.org
frankenmint
Legendary
*
Offline Offline

Activity: 1064


HoneybadgerOfMoney.com Weed4bitcoin.com


View Profile WWW
July 06, 2017, 02:16:19 AM
 #12

I would suggest that you build a structure that the parent program reads (the client).  You would need to pass off chunks of those hashed blocks to other peers that listen in on your node.  When pinged for blockreigons, your node would uplink chunks of those block reaigons.

https://stackoverflow.com/questions/23267305/python-sockets-peer-to-peer#23267582

You need websockets imo.  Your server will connect to their server then from there the procedure would be sync blockchains so that the one with the longest tip replicated.

tspacepilot
Legendary
*
Offline Offline

Activity: 1400


I may write code in exchange for bitcoins.


View Profile
July 06, 2017, 06:37:07 PM
 #13

Thanks for the replies! I am fairly comfortable with what a blockchain is as a data structure, but I cannot manage to build a peer-to-peer network in python that allows for consensus and such. Any suggestions? Niavechain was the closest thing to it.

Can you provide more detail about where you are stuck?  You're familiar with the blockchain data structure, but you're not managing to build a peer-to-peer network.  Is it your understanding of the consensus algorithm or is implementation detail that's holding you up.  This is the technical discussion section of the forum, don't be afraid to be technical.  Let us know where you ran aground.


It's the implementation. I know very little about networking. I understand the consensus algorithm, but am failing implement a way to open connections with peers, and send and receive information. I've been playing around with sockets, but would love any advice!

The 'select' module, if I recall correctly, does asynchronous I/O in python, that may be useful since you're going to want to write handlers that respond to events on your network.  I haven't played around enough to advise you generally, but if you are encountering errors, you could post them here and people will probably be able to help you debug them rather quickly.   I think you'll find this forum more useful the more detail you provide about your issue.

tleilaxu_eyes
Full Member
***
Offline Offline

Activity: 149



View Profile
July 13, 2017, 12:40:32 AM
 #14

How about blockchain free? https://news.ycombinator.com/item?id=14730354

https://coinfo.me/ - All the information, one location.
vv181
Sr. Member
****
Offline Offline

Activity: 294


★Bitvest.io★ Play Plinko or Invest!


View Profile
July 13, 2017, 07:14:58 AM
 #15

maybe you want look at this https://github.com/hclivess/Bismuth



BITVEST DICE
HAS BEEN RELEASED!


▄████████████████████▄
██████████████████████
██████████▀▀██████████
█████████░░░░█████████
██████████▄▄██████████
███████▀▀████▀▀███████
██████░░░░██░░░░██████
███████▄▄████▄▄███████
████▀▀████▀▀████▀▀████
███░░░░██░░░░██░░░░███
████▄▄████▄▄████▄▄████
██████████████████████
▀████████████████████▀
▄████████████████████▄
██████████████████████
█████▀▀█▀▀▀▀▀▀██▀▀████
█████░░░░░░░░░░░░░▄███
█████░░░░░░░░░░░░▄████
█████░░▄███▄░░░░██████
█████▄▄███▀░░░░▄██████
█████████░░░░░░███████
████████░░░░░░░███████
███████░░░░░░░░███████
███████▄▄▄▄▄▄▄▄███████
██████████████████████
▀████████████████████▀
▄████████████████████▄
███████████████▀▀▀▀▀▀▀
███████████▀▀▄▄█░░░░░█
█████████▀░░█████░░░░█
███████▀░░░░░████▀░░░▀
██████░░░░░░░░▀▄▄█████
█████░▄░░░░░▄██████▀▀█
████░████▄░███████░░░░
███░█████░█████████░░█
███░░░▀█░██████████░░█
███░░░░░░████▀▀██▀░░░░
███░░░░░░███░░░░░░░░░░
▀██░▄▄▄▄░████▄▄██▄░░░░
▄████████████▀▀▀▀▀▀▀██▄
█████████████░█▀▀▀█░███
██████████▀▀░█▀░░░▀█░▀▀
███████▀░▄▄█░█░░░░░█░█▄
████▀░▄▄████░▀█░░░█▀░██
███░▄████▀▀░▄░▀█░█▀░▄░▀
█▀░███▀▀▀░░███░▀█▀░███░
▀░███▀░░░░░████▄░▄████░
░███▀░░░░░░░█████████░░
░███░░░░░░░░░███████░░░
███▀░██░░░░░░▀░▄▄▄░▀░░░
███░██████▄▄░▄█████▄░▄▄
▀██░████████░███████░█▀
▄████████████████████▄
████████▀▀░░░▀▀███████
███▀▀░░░░░▄▄▄░░░░▀▀▀██
██░▀▀▄▄░░░▀▀▀░░░▄▄▀▀██
██░▄▄░░▀▀▄▄░▄▄▀▀░░░░██
██░▀▀░░░░░░█░░░░░██░██
██░░░▄▄░░░░█░██░░░░░██
██░░░▀▀░░░░█░░░░░░░░██
██░░░░░▄▄░░█░░░░░██░██
██▄░░░░▀▀░░█░██░░░░░██
█████▄▄░░░░█░░░░▄▄████
█████████▄▄█▄▄████████
▀████████████████████▀




Rainbot
Daily Quests
Faucet
kekcoindev
Jr. Member
*
Offline Offline

Activity: 59


View Profile WWW
July 15, 2017, 06:10:36 PM
 #16

I would be very impressed if a scalable blockchain was built using Python! I would assume Python is more suited to higher-layer blockchain development, side chains, blockchain related apps etc.
buddabudda
Newbie
*
Offline Offline

Activity: 16


View Profile
August 01, 2017, 02:07:09 PM
 #17

I would be interested in learning this too.
quantum
Full Member
***
Offline Offline

Activity: 210



View Profile
August 01, 2017, 02:40:07 PM
 #18

Nice article, thanks for sharing. Loking forward for the second part

totosha
Newbie
*
Offline Offline

Activity: 2


View Profile
August 03, 2017, 07:55:34 AM
 #19

Nice topic.

May be somebody can advice me with python libs for blockchain creation? I wanna use it for my students, not for production.

Im newbie on bicointalk, moderator can correct me if I choose wrong topic for practice education side of blockchain.
xcbtrader
Hero Member
*****
Offline Offline

Activity: 842


View Profile
August 03, 2017, 09:38:04 AM
 #20

Nice topic.

May be somebody can advice me with python libs for blockchain creation? I wanna use it for my students, not for production.

Im newbie on bicointalk, moderator can correct me if I choose wrong topic for practice education side of blockchain.

i found this:

https://github.com/tenthirtyone/blocktools

Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!