dfinity / grant-rfps

Grant RFPs and Bounties
Apache License 2.0
52 stars 11 forks source link

BNT-13: Motoko Certified Assets Canister #48

Open domwoe opened 9 months ago

domwoe commented 9 months ago

Overview

Status: Assigned Project Type: Cooperative - Multiple workers can submit work, and the bounty is shared Time Commitment: Weeks Experience Level: Intermediate Size: USD 5'000 in ICP (at time of distribution)

Description

For some time, dfx has included an assets canister. This canister facilitates the storage and retrieval of static assets. It is automatically provisioned when the canister type in dfx.json is designated as assets.

Assets can be delivered via either raw.icp0.io or the more secure icp0.io, with the latter being the recommended best practice. Assets served through icp0.io are expected to be certified, with the boundary nodes verifying that the replica replying to the http_request hasn't altered the output. This behaviour is specified in the HTTP Gateway Protocol.

Currently, only a Rust version of a certified assets canister exists. Although DFINITY's asset canister was originally crafted in Motoko and there are additional Motoko versions available, these lack asset certification. Consequently, they can only be accessed via the less secure raw.icp0.io. A primary reason for this limitation was the absence of adequate developer tools for the smooth implementation of certified assets in Motoko. However, with the introduction of ic-certification, the situation has evolved, equipping developers with the essential components to construct a certified assets canister using Motoko.

Leveraging the ic-certification, we've introduced the certified-cache library, simplifying the caching of certified API responses. Another noteworthy library, assets, equips canisters with the essential logic to manage assets in line with the asset canister interface utilised by both dfx and @dfinity/assets. Integrating these functionalities, the server library offers a straightforward HTTP server for Motoko. Within its repository, the http-greet example nearly achieves a full-fledged assets canister implementation in Motoko. However, it misses several key features:

The objective of this bounty is to incorporate the above-mentioned features into assets subsequently transforming the http-greet example into a comprehensive certified assets canister.

Acceptance Criteria

How to apply?

Include links to previous relevant work. Include a brief overview of how you will complete the task. Post your application to this forum thread.

References