Perpetual File Data Structure

Important: We created a data structure of Perpetual File to ensure the best storage optimization while complying with Algorand transaction parameters limits.

Original file preprocessing before on-chain upload:

  1. Sha256 hash is computed on the original file

  2. The file's bytes are splitted in pieces of 3065 bytes each

  3. The first piece of 3065 bytes will be splitted in one piece of 1017 bytes that will be set as note parameter, this note parameter will contain "1 bytes Head Data Header" + "3 bytes Unique ID for this Perpetual File" + "3 bytes Unique ID different for every piece of data" + "1017 bytes of file data", the remaining 2048 bytes will be set as Application Args paramenters of Algorand transaction

  4. All the other pieces of file data between the first piece and the last piece will be splitted in one piece of 1017 bytes that will be set as note parameter inside the Algorand transaction, the note parameter will have the following structure: "1 byte Body Data Header" + "3 Bytes Unique ID" + "3 bytes Unique ID different for every piece of data" + "1017 bytes of file data" the 2048 bytes will be set as Application Args parameters of Algorand transaction

  5. The last piece of data will be splitted in one piece of 1017 bytes that will be set as note parameter, this note parameter will contain "1 byte Tail Data Header" + "Unique ID" + "3 bytes Unique ID different for every piece of data" + "1017 bytes of file data", the remaining bytes will be set as Application Args paramenters of Algorand transaction.

Refer to the following diagram for in depth information

Last updated