Live data from Hacker News

BasicCoin, a cryptocurrency in less than 600 lines of Python

github.com

31–40 of 40 posts

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#31
post #22

Basically unreadable. Not sure what you were going for, but I think it was the wrong thing. Off the top of my head: 1.) There's no reason not to use newlines. They have no chance of introducing bugs in any reasonable language and they aid readability. 2.) You're using closures all over place and I haven't checked every occurrence, but I strongly suspect that almost all of them are unnecessary and unhelpful. Closures…

1) newlines reduce the amount of code that you can see on the page at a time. Skipping newlines is identical to purchasing a bigger monitor.

2) Some people group similar functions into classes. I dislike classes and prefer grouping code this way.

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#33
post #11

Unless I'm missing something, the only advantage of it being only 600 lines of code is for educational purposes. But condensing the code in such way to reduce line count goes against such objective. Any other reason to advertise brevity in LoC?

It just happens to be 600 lines right now, and it is now functioning properly. I am hoping that it's small size will make people less afraid to take part.

I am not trying to do it in the minimal lines possible. It just happens to be that short.

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#34
post #12

Earlier quoted context omitted.

Fewer points of failure for consensus. Of course, being written in a dynamic interpretive language goes against that.

We'll do it in 600 lines of assembler!

That would be vastly better.

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#35
post #29
post #28

Can anyone figure out where in this code it determines the addresses of other peers?

tools.py it uses pybitcointools library.

Hmm... I still don't understand...

There has to be some place(s) online where peers register their existence, to find others to connect with.

Near as I can tell, this app doesn't have a feature for this yet. I'd argue it isn't a cryptocurrency unless there's a mechanism for finding other peers included in the code.

(That said, this is still an awesome proof of concept, and I'm going to work through all the source code carefully.)

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#37
post #31
post #22

Basically unreadable. Not sure what you were going for, but I think it was the wrong thing. Off the top of my head: 1.) There's no reason not to use newlines. They have no chance of introducing bugs in any reasonable language and they aid readability. 2.) You're using closures all over place and I haven't checked every occurrence, but I strongly suspect that almost all of them are unnecessary and unhelpful. Closures…

1) newlines reduce the amount of code that you can see on the page at a time. Skipping newlines is identical to purchasing a bigger monitor. 2) Some people group similar functions into classes. I dislike classes and prefer grouping code this way.

> Skipping newlines is identical to purchasing a bigger monitor.

Wat.

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#38
post #35
post #29

Earlier quoted context omitted.

tools.py it uses pybitcointools library.

Hmm... I still don't understand... There has to be some place(s) online where peers register their existence, to find others to connect with. Near as I can tell, this app doesn't have a feature for this yet. I'd argue it isn't a cryptocurrency unless there's a mechanism for finding other peers included in the code. (That said, this is still an awesome proof of concept, and I'm going to work through all the source cod…

You are correct. This is the basic platform for building currencies upon. I have not launched any genesis blocks yet.

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#39
post #24
post #21

Wouldn't it be even easier to just use Git for most of the heavy lifting? - Ledger is a file in a Git repo - Blocks are confirmed by committing them with a SHA1 with sufficiently many leading zeros (adjust a nonce in the commit msg until it fits) - Some bot accepts all pull requests into the Github repo that are fast-forward and whose commits have sufficiently many leading 0s (possibly after confirming that the booki…

'gitcoin' Perfect name. Knowing HN this is gonna be a show HN in a couple of days and rewritten in 10 lines of js a week after that.

This was a challenge in Stripe CTF3. As mentioned by aljungberg, see https://github.com/ctfs/write-ups/tree/master/stripe-ctf3/le...

Re: BasicCoin, a cryptocurrency in less than 600 lines of Python

#40
post #38
post #35

Earlier quoted context omitted.

Hmm... I still don't understand... There has to be some place(s) online where peers register their existence, to find others to connect with. Near as I can tell, this app doesn't have a feature for this yet. I'd argue it isn't a cryptocurrency unless there's a mechanism for finding other peers included in the code. (That said, this is still an awesome proof of concept, and I'm going to work through all the source cod…

You are correct. This is the basic platform for building currencies upon. I have not launched any genesis blocks yet.

Thanks for this library!
Post reply on HN