9

It seems that blockchain code written in C++ is prone to obscure but serious bugs such as recently seen in Zcoin.

I know that rewriting Monero in a safer language is not practical in the short-term, and there are various tests run during the build process to check functionality which are helpful.

Given that people will be relying on Monero for cryptographic privacy as well as financial security, and formal verification is some way off; what tools for improving code reliability - such as static code analysis or undefined behavior sanitisation - are (or should be) incorporated into the development process in addition to normal development practices such as unit tests and code reviews?

4
  • some people are thinking about rewriting monero in c for this reason
    – samwellj
    Commented Mar 7, 2017 at 21:28
  • 1
    How is c safer than c++?
    – assylias
    Commented Mar 7, 2017 at 23:23
  • 2
    @assylias it's easier to understand since it's a smaller language. And it there would then be 2 implementations, which is good in itself. But I otherwise agree, that maybe a second implementation should be made in some other, more different language. Commented Nov 1, 2017 at 7:52
  • Seeing a C rewrite started would be one of the happiest days in my life ;) But that requires A LOT OF WORK
    – emesik
    Commented Jan 16, 2018 at 1:09

1 Answer 1

2

It seems that blockchain code written in C++ is prone to obscure but serious bugs

Well, anything coded in anything can be "prone to obscure but serious bugs", it's not the language used that's at fault.

what tools for improving code reliability - such as static code analysis or undefined behavior sanitisation - are (or should be) incorporated into the development process

Actually, a number of tools are already being used. Valgrind, ASAN and Coverity for example. These are just some tools, this is aside from the, arguably more important, many developers that review and test others contributions also. Code is not just rushed into releases.

In addition to this, for major newer cryptography, such as the recent Bulletproofs code, the community funded two independent audits before the code was included in a release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.