BEP-323: Bundle Format for Greenfield #323
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BEP-323: Bundle Format for Greenfield
1. Summary
This BEP proposes a solution for better on-chain storage efficiency and user experience in Greenfield by introducing
a method to bundle small files together before uploading. The new system will reduce storage space and costs caused
by small files while increasing the capacity of the entire network.
2. Motivation
Storing small files in Greenfield is inefficient. The metadata stored on the blockchain can be larger than the files,
leading to higher costs for users. Greenfield Blockchain has a capacity limit to process files simultaneously.
To tackle this problem, we aim to design a bundle format specifically for Greenfield. This is because a specialized
format will allow developers to build something that fits exactly with what Greenfield and its users need, without
any unnecessary features. By introducing a bundle format, Greenfield can provide a better service to the users and
make sure that Greenfield stays efficient and easy to use as it grows.
3. Specification
3.1 Bundle Format
The bundle format specifies the structure and organization of the bundle that users create when packing files.
This format is designed to pack flat files; hierarchical directory structures, or folders, are not supported.
When dealing with a folder, users can simplify its structure by turning it into a series of individual files.
As part of this process, it renames each file to include the folder path. For example, a file originally named
file.txt
inside the nested foldersdirA
anddirB
would be renamed todirA/dirB/file.txt
.This approach allows us to maintain the organization of the folder while conforming to the requirement for flat files in the bundle.
There are still constraints for the bundle format. The file names of the files in the bundle should be unique so that
they can be indexed by the file name.
The bundle format is structured into several key components as follows:
The Meta structure is designed to include essential attributes for each file, outlined as follows:
owner
.3.1.1 Encoding
The bundle's encoding format is structured as follows:
The Meta structure will be serialized with protobuf:
4. License
The content is licensed under CC0.