Use both Java and C++ for cryptocurrency development

in #codablecash7 years ago

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.

Sort:  

@iizuka, a question, for specific jobs, where you only need to perform mathematical calculations, is it better to use low level languages?

Low level language is necessary for only calculating nonce, because I want to make difference of calculation speed between low and high spec server small.

Very interesting post by you @iizuka..
Visit my block

Thank you! I'm making cryptocurrency every day.

You welcome bro...
Visit my block yes..

You got a 2.40% upvote from @upmyvote courtesy of @iizuka!
If you believe this post is spam or abuse, please report it to our Discord #abuse channel.

If you want to support our Curation Digest or our Spam & Abuse prevention efforts, please vote @themarkymark as witness.

Hi @lizuka. I've follow and vote you, would you like to vote me back???? Thank you!!!

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.037
BTC 94664.56
ETH 3431.72
USDT 1.00
SBD 3.88