Skip to content

Instantly share code, notes, and snippets.

@elichai
Last active October 15, 2021 09:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elichai/673b031fb235655cd254397eb8d04233 to your computer and use it in GitHub Desktop.
Save elichai/673b031fb235655cd254397eb8d04233 to your computer and use it in GitHub Desktop.
Rust Bitcoin core

Q: Pathway wise is this even possible to have a parallel Rust thing going at the same time?
A: Yes, Rust is a compiled non-gc languange just like C++, Rust can call easily call into C functions and easily expose a C API (Rust can also do this with C++ but less "easily").

Q: At the same time there are a lot of big companies making that same bet... I wish I had more examples than that but I don’t off the top of my head
A:

  1. Google is actively using Rust in multiple projects: Fuchsia[0] CrosVM(part of Chromium OS)[1], and probably more[2][3]
  2. Microsoft, it was already said but microsoft is using Rust in Windows[4], wasm related tools[5], and more[6] they also have people whose all job is making rust+windows experience better[7]
  3. Facebook is both experimenting with rust[8][9] and using it in production[10]
  4. Dropbox main sync engine is written in Rust[11].
  5. Amazon is using rust in Lambda, EC2, S3 and even virtualization[12].
  6. Here's Meeting notes from a meeting between rust core devs and multiple big companies about integrating rust. https://gist.github.com/rylev/0e3c3895dcb40b6a1c1cf8c427c01b5e

Q: You’ve got rust-bitcoin ... which still has a big warning at the top of the README saying “Don’t use in this production for consensus critical applications.”
A: The comment in the readme says This library must not be used for consensus code not Don’t use in this production, rust-bitcoin is actively used in production by many users (Liquid, electrs(electrum server), rust-lightning and more)

Q: I have never seen a rust-bitcoin node be listed on an bitnodes.io.
A: That's because rust-bitcoin isn't a full node implementation, it doesn't have any validation code nor a p2p implementation, rust-bitcoin is a library that provides all the needed primitives and operations you need to interact with bitcoin (Encoding/Decoding transactions,blocks, etc. Create and sign transactions, manipulate scripts and more)

Q: There is one argument to be made that it is not stable yet
A: That requires defining "stable" is ABI stability "stable"? is compiler backwards compatibility stable? is no new features stable?.

Q: The only way you get Linux in Rust to rewrite everything... I thought there were people introducing some Rust things into the Linux kernel.
A: There's active positive discussion around linux and rust[13], and people are working on the right infra to make it happen[14][15]

Q: I can’t think of an open source project that has switched implementation languages and survived. I can’t think of many that have tried to switch implementation languages.
A: No one is talking about really switching the whole implementations, but gradually adding a new language,similar what the tor project did, which is also a very security critical OSS project and is adding more and more rust where today rust is the second biggest language in the tor core code[16].

Q: What about making a fresh one starting from scratch in Rust? There is rust-bitcoin.
A: As said before most rust-bitcoin maintainers and contributors belive that a separate node implementation isn't a great idea, so as I mentioned before it's just a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment