Live data from Hacker News

BasicCoin, a cryptocurrency in less than 600 lines of Python

github.com

11–20 of 40 posts

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

#12
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?

Fewer points of failure for consensus.

Of course, being written in a dynamic interpretive language goes against that.

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

#13
post #12
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?

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!

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

#14
post #12
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?

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

An interpretive language?

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

#15
Millions of currencies. I was standing at the back of the room when Andreas said that and I was like, yeah, I can see it.

The blockchains deliver trusted communication of stored work to us. The network has value in and of that function alone. That I can verify you have thing of X value and I have thing of Y value and that the ratio of X to Y is such as established by these market APIs/feeds. Which themselves are running on a trusted computing platform that is a fair and accurate representation of what is what in this world, up to a point.

That there will be a million blockchains working together in a mishmash of interconnected markets, is no more difficult than imagining a million seperate computer networks, each of which is using a private address block 10.0.0.0/24. Some things are meant to be highly distributed, some are not.

Why would you ever expect a cryptocurrency based on the thesis of high distribution to ever be a singleton itself?

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

#16
I am bother by the desire to get smaller and smaller. A secure implementation will have a lot of code to verify incoming data and handle exceptions. It is fun to learn and implement HTTP server from the raw socket module (I did that once for my security project in my computer security class too), but if you are just looking for a simple server that you can handle GET and POST look into bottle.py

A single file / pip install write into setup.py and you are good to go.

This I consider as educational, which I assume is the case by the desire to go smaller and implementing such socket server.

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

#17

Millions of currencies. I was standing at the back of the room when Andreas said that and I was like, yeah, I can see it. The blockchains deliver trusted communication of stored work to us. The network has value in and of that function alone. That I can verify you have thing of X value and I have thing of Y value and that the ratio of X to Y is such as established by these market APIs/feeds. Which themselves are runn…

errm...what tha fuck did you just say?

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

#18
post #8

600 lines, however the codebase is quite unreadable. Typically, code written in python is rather readable and easy to follow, but this is heavily condensed and somehow completely void of any sort of pythonic code. Programs are the communication of thoughts between fellow software writers, readability should be your #1 priority.

Yeah. The author says they are following pep8 but I thought spaces between functions was part of those guidelines. Definitely trying hard to reduce the lines below 600. Yet I feel like if the bragging rights had been "under 1000 lines" we still would be equally interested.

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

#19

Millions of currencies. I was standing at the back of the room when Andreas said that and I was like, yeah, I can see it. The blockchains deliver trusted communication of stored work to us. The network has value in and of that function alone. That I can verify you have thing of X value and I have thing of Y value and that the ratio of X to Y is such as established by these market APIs/feeds. Which themselves are runn…

See Sidechains[0], and Treechains[1]. But as always, without the proper incentives a block chain is unsustainable and vulnerable.

[0]: http://sourceforge.net/p/bitcoin/mailman/message/32108143/

[1]: https://www.mail-archive.com/bitcoin-development@lists.sourc...

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

#20
post #18
post #8

600 lines, however the codebase is quite unreadable. Typically, code written in python is rather readable and easy to follow, but this is heavily condensed and somehow completely void of any sort of pythonic code. Programs are the communication of thoughts between fellow software writers, readability should be your #1 priority.

Yeah. The author says they are following pep8 but I thought spaces between functions was part of those guidelines. Definitely trying hard to reduce the lines below 600. Yet I feel like if the bragging rights had been "under 1000 lines" we still would be equally interested.

Very little of this follows PEP8. The code appears to have been written as tersely as possible, even in cases where it would have utterly no effect on the 600 SLOC limit.
Post reply on HN