
Toshi – An Open Source Bitcoin Node for Developers - adrianmacneil
http://blog.coinbase.com/post/97671295752/introducing-toshi-an-open-source-bitcoin-node-for
======
kyledrake
I told the Coinbase people to use Postgres for this two years ago, and they
treated me like a crazy person for it. Assuming they arrived at this through
my advice and not the inevitable catastrophe, glad they finally took my advice
to heart.

The next problem is that they are still using EventMachine. Still think I'm a
crazy person? Oh look, it's like I'm a well-received field expert on this
topic or something [http://www.slideshare.net/mobile/KyleDrake/hybrid-
concurrenc...](http://www.slideshare.net/mobile/KyleDrake/hybrid-concurrency-
patterns)

Incase anyone's interested in being a developer at Coinbase, I'll save you
some time: they're more interested in pedigree and whiteboard puzzles than
science and code. Most disrespectful interview I have ever had in my 13 years
of coding, and probably ever will have.

~~~
jonpaul
For those that don't know, Kyle was responsible for helping to resurrect
bitcoinjs-lib
([https://github.com/orgs/bitcoinjs/people](https://github.com/orgs/bitcoinjs/people))
and developing one of the first self-hosted Bitcoin (HTML) wallets - Coinpunk
([https://github.com/kyledrake/coinpunk](https://github.com/kyledrake/coinpunk)),
so he's clearly a talented developer.

~~~
bitcoiner2010
Web-wallets should not be trusted, no matter what. See: mybitcoin.com,
instawallet.com etc. ->
[https://en.bitcoin.it/wiki/EWallet](https://en.bitcoin.it/wiki/EWallet)

~~~
tomlongson
BitGo is a good web wallet.

~~~
tomlongson
Not sure why I'm being downvoted, but it's one of the few multisig web wallets
available. It's not the same as other sites.

~~~
johnhenry
I think you've been downvoted because that comment has little to do with the
topic at hand and seems like a shameless promotion of BitGo. Alternatively,
you could create a separate "Show HN : BitGO -- one of the few multisig web
wallets available" thread and that would be totally acceptable.

------
lappa
I guess Coinbase didn't learn their lesson last time they tried using
reimplemented consensus code.

[https://bitcointalk.org/index.php?topic=260595.0](https://bitcointalk.org/index.php?topic=260595.0)

~~~
lechuga
That's completely fair. Consensus systems are very difficult to (re-)implement
correctly but I would argue there is value in doing so. There is also great
risk and we appreciate that.

This time we took a slightly different approach. Whenever possible, we
directly ported the validation code from bitcoind. Granted, the script runner
is the most fragile part and for that we are relying on bitcoin-ruby which
does not directly port it from bitcoind.

While we are passing Matt Corallo's brilliant test suite, it is not currently
recommended that anyone use Toshi in production for the purpose of managing
bitcoin. And if you are going to run it in your environment we highly suggest
running it behind trusted bitcoind nodes. There are many pieces still missing
-- like all of the DoS penalty code. We currently have the demo running in the
wild for the very purpose of giving helpful people the opportunity to break
it.

~~~
marcell
> it is not currently recommended that anyone use Toshi in production for the
> purpose of managing bitcoin

Does Coinbase use Toshi in production?

~~~
lechuga
The only instances of it we having running are the ones listed in the blog
post (and just perhaps a Litecoin version that we're trying to get to sync.)
They are in no way currently integrated with the web site.

------
lechuga
Been working on this with Adrian for the last 3.5 months. Happy to answer any
questions if I can.

~~~
zmanian
It is great to have more examples of building a indexed fast query
representations of the the current ledger state.

What did you guys go with as a policy for handling or avoiding orphan
blocks...

~~~
lechuga
Currently we're saving every block we see. And if we find an orphan's parent
which is on the main chain we try to connect them both. We aren't doing
anything to explicitly avoid them.

If you're referring to side chain blocks (which some people refer to as orphan
blocks) we'll extend them to be the main chain should they win or leave them
forever marked as side chain blocks. We aren't doing anything to explicitly
avoid these either.

------
marcell
\- Can this full node be used for mining, if one is so inclined? \- What is
the user agent string for this node?
([https://getaddr.bitnodes.io/nodes/](https://getaddr.bitnodes.io/nodes/))

~~~
adrianmacneil
It doesn't support any RPC calls so standard mining software won't play well
with it yet due to the lack of getwork/getblocktemplate.

User agent: Toshi:0.1.0

------
derefr
What advantages does running a Toshi node hold over using one of the many
cloud services that allow free public API access to basically the same
endpoints?

~~~
barmstrong
This is another cloud service that allows free public API access, but it's the
first one I'm aware of that is also open source. Much better to build a
service or business on something you are in control of.

~~~
patcon
\- [https://helloblock.io/](https://helloblock.io/)

\- [https://github.com/helloblock/helloblock-
app](https://github.com/helloblock/helloblock-app)

:)

~~~
marcell
Don't forget
[https://github.com/bitpay/insight](https://github.com/bitpay/insight)

------
kolev
Project's homepage: [https://toshi.io/](https://toshi.io/)

------
swandriven
You're sooo good! Come on, Toshi!

