
Show HN: Misocoin – A barebones Bitcoin-like protocol implemented in Python 3.6 - kendrick__
https://github.com/kendricktan/misocoin
======
tuxxy
FYI, I think I see you using the P-256 curve in this project.

Word of warning, this is not Bitcoin's curve. This is a NIST curve.

The library you're using (fastecdsa) has secp256k1 available to use, if that's
what you want to do.

~~~
jnbiche
Yes, it looks like this (and other differences) is why it's called a "Bitcoin-
like" project. It also runs over HTTP instead of plain TCP/IP, so it can't be
used as a Bitcoin node anyway (and there are numerous other differences).

But it's a nice example of a Bitcoin-like project, and manages to get the main
ideas of Bitcoin in as an educational project.

------
Lambdanaut
Very cool! I've been working on a similar project every so
often([https://github.com/lambdanaut/lambdacoin](https://github.com/lambdanaut/lambdacoin)).
I'm not as far along as you are, but so far it seems like creating a
cryptocurrency from scratch is not really all that big of a project, at least
getting it into a prototypical state.

I was delighted to find that much of the math logic is already handled by
libraries such as pycrypto.

It's funny to me how similar our codebases look. Especially our classes such
as `Block` and `Transaction`. We each have to_json and from_json methods as
well, in order to serialize the data for propagation.

~~~
sidmitra
Just curious as to how you got started into this? Are there any references
you'd recommend. I have a typical Web dev background(+ some machine learning
from college). Been investing in crypto for a bit and would love to learn and
implement some basic blockchain concepts on my own. I've also been looking at
Solidity.

~~~
Lambdanaut
Really it's just a lot of googling and looking for good tutorials that explain
how the Bitcoin protocol works. Whenever you hit a concept you don't
understand, google it.

The Bitcoin Developer Documentation is gold:
[https://bitcoin.org/en/developer-
documentation](https://bitcoin.org/en/developer-documentation)

Start by defining your basic objects, and then begin adding their methods,
just like you would any sort of program. The basic objects here are the
Blockchain, Transactions, and a Client to interact with the chain. The rest is
just implementing rules for how these objects work together.

------
jnbiche
Cool project. It seems like the only way for nodes to mine on the same chain
is for them each to use different ports. I tried to use different IPs on the
same port, and it didn't work.

~~~
kendrick__
I guess its because the library I'm using is rpc over HTTP instead of TCP/IP
:(

------
igorgue
Awesome project!

Your cat looks like mine :)

Also, for the JavaScript fans: [http://bcoin.io/](http://bcoin.io/) it's
actually a full node implementation that can run in the browser (can if you
have time and space for the blockchain).

~~~
jnbiche
How would that work? The Bitcoin network runs over TCP/IP, and you can't run
raw TCP/IP connection over browsers.

I assume there is some kind of bridge server, or supernode, to allow the
browser node to connect (via websocket?) to the actual Bitcoin network?

~~~
shakna
> Having a node set-up will allow you to more easily test and query the
> RPC/REST API, and begin monitoring new transactions added to the bitcoin
> blockchain/mempool.

> The default bcoin HTTP server listens on the standard RPC port (8332 for
> main, 18332 for testnet, 48332 for regtest, and 18556 default for simnet).
> It exposes a REST json api, as well as a JSON-RPC api.

Seems bcoin doesn't connect you directly, but rather to a node they're running
elsewhere.

~~~
jnbiche
> It exposes a REST json api, as well as a JSON-RPC api.

So a bridge server.

------
thinkMOAR
Sounds a lot like me so horny, mi so coin... just the name already, oozes
trust... </sarcasm>

