I made a simple cryptocurrency to learn how Bitcoin works
47 comments · 93% upvoted · source · other discussions
47 comments · 93% upvoted · source · other discussions
When can I buy it on Binance?
How does PEER_NODES get propagated?
For now, they don't. You must add them by hand. I'm still working on a simple way of doing it. If you have any idea feel free to let me know.
No, that was actually the one thing that I never understood about other cryptocurrencies. I was hoping you could clear it up for me. ;)
Once you know about another node/peer, you can exchange the blockchain with it, and ask it about the nodes it knows. Then it creates a chain and continue propagating when new nodes are added.
So you do need to know how to connect to at least one other node manually to start, and hope that node knows about other nodes.
Bitcoin has a hardcoded list of "seed" nodes to connect to:
https://github.com/bitcoin/bitcoin/blob/master/src/chainparamsseeds.h
Thanks, that makes it all clear.
I have also been playing about with a self-made blockchain and I used gossip for peer discovery. I guess there is a python implemention you can just plug in. Might be worth a look.
Essentially you just need to give a new node some seed nodes to talk to and it will eventually become aware of all other peers. If peers drop in or out it doesn't really matter (unlike things like raft where it expects the peer to come back at some point).
any plan to add a https://en.wikipedia.org/wiki/Merkle_tree ?
Merkle tree
In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node is labelled with the hash of a data block and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure verification of the contents of large data structures. Hash trees are a generalization of hash lists and hash chains.
Demonstrating that a leaf node is a part of a given binary hash tree requires computing a number of hashes proportional to the logarithm of the number of leaf nodes of the tree; this contrasts with hash lists, where the number is proportional to the number of leaf nodes itself.
[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source | Donate ] Downvote to remove | v0.28
Page 5: https://bitcoin.org/bitcoin.pdf Each transaction is encoded in a Merkle tree with the root stored in the block for easy transaction verification. Ethereum additionally stores all of the account balances in a merkle tree
Good job, code looks great as well! Tnx for sharing
i'll have to try this out. i had an idea for a "pseudocurrency" that would be tied to a particular application, but not traded against cash or cryptocoins, kind of a "local currency" used within instances of the app. every time i tried building code for it using ports of bitcoin code, etc... it either refused to build, or if it worked, wouldn't make a genesis block.
question: since this is a python script, then is it possible to run multiple instances of this on one machine, and so the whole mining network would be "self contained" on one machine? for instance, i would edit the code, so it would be making, let's say, unclejedcoin, and have 3 nodes running in terminals on the same machine mining UJC.
this definitely looks like a fun project
I'll take a look at this this weekend, thanks a lot for sharing your work :)
What's hodl?
It's hold typed in a panicked rush. Usually during a correction.
Nice work. Good to understand basic of blockchain. Maybe try to turn it into PyCoin? haha
where does the miner and wallet store data?
The only one that needs to store data is the miner and its stored in memory, so as soon as you close "the node", the blockchain will be lost (if there are other nodes running, the blockchain will stay alive). Im planning to store it locally but not sure how to do it by keeping it simple.
Why is this not valued at $10k yet? /sarc
Nice, man!
You should think about using the cmd module for wallet.py, will look much cleaner and will help you with testability and stuff.
Really cool
this is awesome man. I hope to learn something from this.
You should get this straight to market, ASAP. The people over at /r/CryptoCurrency are already talking IPO here.
OMG When's the ICO? How can I get some??? This is the Bitcoin killer for sure! Some guy on Youtube said it will be at least $100k by the end of the year.
When is going to be the public sell of this ICO?
Real talk I bought my first crypto currency yesterday 😐
I just invested my life savings, so if this doesn't take off over night I'm burning down your house.
[deleted] 91 points · Jan 2018
[removed]
randomizethis 63 points · Jan 2018
Lambos all around. I expect SimpleCoin to be $1000 by the end of year. Just put a mortgage on my house/car/dog/wife and sunk it all into SimpleCoin. Already on HitBTC, expecting for it to be on KuCoin, Cryptopia, and even Coinbase in a month.
pkeerthi 14 points · Jan 2018
I suspect some people out there right now wouldn't get the sarcasm take this at facevalue :|
randomizethis 7 points · Jan 2018
Whoops, should've added /s... Or was I just setting up a trap? Let the Darwin Awards commence!
Lj101 1 points · Jan 2018
Stop preemptively babifying comments, no one is going to miss the joke here.
I-Downloaded-a-Car 5 points · Jan 2018
Convince people of this and you've got a classic pump and dump
randomizethis 1 points · Jan 2018
Damn dawg, don't do me like that... I ain't no CryptoNick 🔥🔥🔥
cayne 1 points · Jan 2018
We have to go with the shitcoin meme. Like:
:)
gadget_uk 6 points · Jan 2018
I've checked the TA. Expect the new flippening by midnight.