I am trying to send a data hashed using SCryptUtil provided by com.lambdaworks.crypto.SCryptUtil, convert it into array of bytes and send it to the stellar network using ManageDataOperation.Builder

My code is as follows

        String hash = SCryptUtil.scrypt("HashData", 16384, 8, 1);

        byte[] hashByte = hash.getBytes();

        ManageDataOperation.Builder updateHashedData = new ManageDataOperation.Builder("Hashed Data", hashByte);

        Transaction tt = new Transaction.Builder(sourceAccount)

The data is not sent to the server. But when I use a simple string for the "hash" variable like "Password", it gets sent. What am I missing here? Is there a way to send long hashcodes to stellar account in this way?

  • I don't understand the example. You declare hash, assign it to hashedData, but you don't use that variable after that. You use the bytes from a new variable, hashedPass in the builder call. Where does hashedPass get set? What's in it? Commented Apr 29, 2019 at 22:35
  • Hi, sorry I made some adjustments in the code. Now it is correct.
    – Ifham
    Commented Apr 29, 2019 at 22:41
  • How long (in bytes) is hashByte? Commented Apr 30, 2019 at 23:02
  • It's length is 150.
    – Ifham
    Commented May 4, 2019 at 20:19

1 Answer 1


The value of ManageDataOperation is limited in length (hashByte.length <= 64), if the length is exceeded, the submission will fail.

  • Thank You! So if I want to store data larger than that, I should be storing them off the chain?
    – Ifham
    Commented May 5, 2019 at 10:24
  • You can store the data off the chain and store the hash of the file on Stellar, another option is to store the file on IPFS and then save the hash on Stellar. I hope this article can help you.
    – overcat
    Commented May 6, 2019 at 2:07
  • Relevant doc: stellar.org/developers/guides/concepts/… Commented May 6, 2019 at 4:14

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.