Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BNT-13: Motoko Certified Assets Canister #48

Open
domwoe opened this issue Oct 6, 2023 · 0 comments
Open

BNT-13: Motoko Certified Assets Canister #48

domwoe opened this issue Oct 6, 2023 · 0 comments

Comments

@domwoe
Copy link
Contributor

domwoe commented Oct 6, 2023

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:

  • Chunked uploads
  • Streaming
  • V2 certification
  • Testing
  • Access control

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

  • The implementation shall fully mirror the existing Rust certified assets canister functionality and interface (including v2 certification)
  • The code shall be of production quality, have good documentation and reasonable test coverage.
  • The code shall be open sourced with an MIT license.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants