Bundle Structure

Kwil utilizes its own bundle structure to allow for practically limitless levels of scalability. By allowing for multiple data-moat blocks to be contained in a single bundle, and by utilizing a dynamic endpoint based indexing system, Kwil bundles allow for the easy implementation and removal of custom data-write methods while maintaining a high level of scalability and interoperability.

Bundle Indexing

Each bundle is stored as a JSON with fields corresponding to each data-moat the node is serving. Inside of each JSON field is each data-moat's block, which contains the new data submitted to the network over some arbitrary length of time.

Content inside each moat block is indexed by the endpoint on which it was received. The content is submitted in some sort of standardized format to allow future nodes to verifiably un-bundle the data from Arweave. For example, raw SQL statements are submitted to the /raw endpoint. Image this SQL query was submitted for the data-moat "satoshi_social":

INSERT INTO some_table (column_1, column_2) VALUES (value_1, value_2);

In the bundle, this would simply appear as:

{
    "satoshi_social": [
        {
            query: `INSERT INTO some_table (column_1, column_2) VALUES (value_1, value_2);`,
            timestamp: `Mon Jan 31 2022 11:07:01 GMT-0800 (Pacific Standard Time)`
        }
    ]
}

Images

Currently, Kwil supports files with no extensions and JPEGs. All JPEGs must be BASE64 encoded.

Hint: If your image won't display, make sure you are stripping any padding from the beginning. Many libraries leave ~16 bytes of padding before the actual image data.

Now, let's imagine that an image was submitted to the data-moat "bayc_videogame" with a file path of "images/boredApes/1455", and both of these data-moats were being served by the same node. The bundle would now appear as:

{
    "satoshi_social": [
        {
            "raw":
            {
                "query": `INSERT INTO some_table (column_1, column_2) VALUES (value_1, value_2);`,
                "timestamp": `Mon Jan 31 2022 11:07:01 GMT-0800 (Pacific Standard Time)`
            }
        }
    ],
    "bayc_videogame": [
        {
            "storeJPEG":
            {
                "path": `images/boredApes/1455`,
                "image": `{some_base64_img}`
            }
        }
    ]
}

On any node that has synced this propagation, the photo would be accessible at the URL "https://{node-url}/public/bayc_videogame/images/boredApes/1455.jpeg"

Last updated