Maybe somebody can help.
I was chatting to Embii on the Facebook page of Apertus.io. He mentioned that they are able to get Javascript programs to run on Datacoin but only with the 20byte payload, not the full 128kB payload. They can write the data, but no other client can read it. With the 20byte payload it is very expensive to write Javascript programs into the Datacoin blockchain (you need to pay 0.05DTC for every chunk of code that gets written and with 20bytes you need a lot of chunks).
From embii:
"we implemented encoding and deciding base 64 for DataCoin...we did get this to work...except what is saved in this manner is only accessible via RPC to the wallet that saved it... this is the real problem and is the main reason we abandoned it. It does have personal applications but does not let you share anything saved with others."
I tried to see if I could find the problem in the Datacoin wallet. In rpcwallet.cpp I saw
senddata(const Array& params, bool fHelp)
{
if (fHelp || 1 != params.size())
throw runtime_error(
"senddata [data]\n"
" is a base64 encoded data chunk"
+ HelpRequiringPassphrase());
CWalletTx wtx;
// Transaction data
std::string txdata;
if (params.size() > 0 && params[0].type() != null_type && !params[0].get_str().empty()) {
txdata = params[0].get_str();
if (txdata.length() > MAX_TX_DATA_SIZE)
throw JSONRPCError(RPC_INVALID_PARAMETER, "data chunk is too long. split it the payload to several transactions.");
}
string strError = pwalletMain->SendData(wtx, false, txdata);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
I suspect HelpRequiringPassphrase() is the suspect. Anybody else have an idea? We will have to remove this so that other wallets can see the 128kB data in the blockchain.
If this can be done the Datacoin blockchain will contain Javascript programs that will be visible to other clients and executable in the Apertus.io browser. And maybe other browsers as well. Datacoin could then use Javascript as a programming language.