4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Use both Java and C++ for cryptocurrency development

Now making ASIC & GPU resistant hash algorithm, which is yescript. And I decided to use JNI(Java Native Inerface) in calculating nonce.

Performance of nonce calculation is very severe issue to make all full nodes fair for fair coin distribution.

The demerit of using JNI is to make compiled Java binary incompatible for all OS platform. But full node is server software, so I'm going to specify OS and distribution. 

Why C++ is necessary

I've told Java is good programming language before. That's because maintain code is easy. But it has some weakpoints. There are two reasons to use C++.

Java can't use pointer

Java doesn't have pointer, so it have to make new object in order to implement following code.

  • Giving pointer of byte array to other variables
  • Manipulating value on byte array

Java has Bytefuffer class which can share byte array. But it makes more memory object on comparing with C and C++.

Fastest implementation for fair distribution

C++ is much faster than Java, on such codes which use pointer. Therefore if a full node user make codablecash server which uses C++ implementation, the person can calculate nonce much faster.

That means the full node can mine more blocks than others. It causes coin distribution problem.

Therefore I decided to use C++ code with JNI.

Platform of full node server of Codecash

At first, I'm going to make server software whose target is 64bit linux. I guess most of users will use cloud servers, like Digital Ocean and AWS.

27 upvotes $0.51

Replies (7)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: