Skip to content

Commit

Permalink
chore: update document
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jan 7, 2025
1 parent 906bdc1 commit 5cdc45b
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 79 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,40 @@

⚙️ A decentralized COnfiguration service with Signing and Encryption on the Internet Computer.

💝 This project received a **$25k Developer Grant** from the [DFINITY Foundation](https://dfinity.org/grants).
💝 Backed by a **$25k Developer Grant** from the [DFINITY Foundation](https://dfinity.org/grants).

## Overview

`ic-cose` is a fully open-source decentralized configuration service running on the Internet Computer. Based on the [CBOR Object Signing and Encryption (COSE, RFC9052)](https://datatracker.ietf.org/doc/html/rfc9052) standard, it offers centralized message signing and configuration data encryption. Configuration data is organized by namespaces and client subjects, supporting collaboration, fine-grained access control, and horizontal scalability. It can serve as a reliable and secure configuration center for various Web3 services and Web2 services with high data security and reliability requirements.

A imaginative use case is serving as a state persistence service for enclaves running in Trusted Execution Environments (TEEs), aiding in loading confidential data during startup and persisting confidential data states during runtime.

**Online Demo**: https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=53cyg-yyaaa-aaaap-ahpua-cai

## Features

- [x] Supports message signing and configuration data encryption (COSE, Threshold ECDSA, Threshold Schnorr, VetKeys (TODO)).
- [x] Organizes configuration data by namespaces and client subjects with fine-grained access control.
- [x] Serve as a state persistence service for enclaves, aiding in loading and persisting confidential data during startup and runtime.
- [ ] Supports horizontal scalability, WASM upgrade management, and Cycles recharge management.
- [ ] Serve as a state persistence service for enclaves, aiding in loading and persisting confidential data during startup and runtime.
- [ ] Can be used as a cluster management center for both Web3 and Web2 services.

## Packages

| Package | Description |
| :---------------------------------------------------------------------------------------------------- | :----------------------------------------------- |
| [ic_cose_canister](https://github.com/ldclabs/ic-cose/tree/main/src/ic_cose_canister) | IC COSE canister (smart contract) |
| [ic_object_store_canister](https://github.com/ldclabs/ic-cose/tree/main/src/ic_object_store_canister) | IC Object Store canister (smart contract) |
| [ic_cose_types](https://github.com/ldclabs/ic-cose/tree/main/src/ic_cose_types) | Rust shared type definitions |
| [ic_cose](https://github.com/ldclabs/ic-cose/tree/main/src/ic_cose) | Rust client SDK for the IC COSE canister |
| [ic_object_store](https://github.com/ldclabs/ic-cose/tree/main/src/ic_object_store) | Rust client SDK for the IC Object Store canister |

## Who's using?

- [ICPanda](https://github.com/ldclabs/ic-panda): A decentralized Panda meme platform featuring E2E encrypted messaging, lucky draws, airdrops.
- [dMsg.net](https://dmsg.net): The world's 1st decentralized end-to-end encrypted messaging application fully running on the Internet Computer blockchain. dMsg.net uses ic-cose to store user avatars (public), channel logos and encrypted files (private).
- [IC-TEE](https://github.com/ldclabs/ic-tee): Make Trusted Execution Environments (TEEs) work with the Internet Computer.

If you plan to use this project and have any questions, feel free to open an issue. I will address it as soon as possible.

## License
Copyright © 2024 [LDC Labs](https://github.com/ldclabs).
Copyright © 2024-2025 [LDC Labs](https://github.com/ldclabs).

`ldclabs/ic-cose` is licensed under the MIT License. See [LICENSE](LICENSE-MIT) for the full license text.
111 changes: 45 additions & 66 deletions src/ic_cose_canister/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,15 @@
- [ ] Serve as a state persistence service for enclaves, aiding in loading and persisting confidential data during startup and runtime.
- [ ] Can be used as a cluster management center for both Web3 and Web2 services.

## Candid API

```shell
admin_add_allowed_apis : (vec text) -> (Result);
admin_add_auditors : (vec principal) -> (Result);
admin_add_managers : (vec principal) -> (Result);
admin_create_namespace : (CreateNamespaceInput) -> (Result_1);
admin_list_namespace : (opt text, opt nat32) -> (Result_2) query;
admin_remove_allowed_apis : (vec text) -> (Result);
admin_remove_auditors : (vec principal) -> (Result);
admin_remove_managers : (vec principal) -> (Result);
ecdh_cose_encrypted_key : (SettingPath, ECDHInput) -> (Result_3);
ecdsa_public_key : (opt PublicKeyInput) -> (Result_4) query;
ecdsa_sign : (SignInput) -> (Result_5);
get_delegation : (blob, blob, nat64) -> (Result_6) query;
namespace_add_auditors : (text, vec principal) -> (Result);
namespace_add_delegator : (NamespaceDelegatorsInput) -> (Result_7);
namespace_add_managers : (text, vec principal) -> (Result);
namespace_add_users : (text, vec principal) -> (Result);
namespace_get_delegators : (text, text) -> (Result_7) query;
namespace_get_fixed_identity : (text, text) -> (Result_8) query;
namespace_get_info : (text) -> (Result_1) query;
namespace_list_setting_keys : (text) -> (Result_9) query;
namespace_list_user_setting_keys : (text) -> (Result_9) query;
namespace_remove_auditors : (text, vec principal) -> (Result);
namespace_remove_delegator : (NamespaceDelegatorsInput) -> (Result);
namespace_remove_managers : (text, vec principal) -> (Result);
namespace_remove_users : (text, vec principal) -> (Result);
namespace_sign_delegation : (SignDelegationInput) -> (Result_10);
namespace_top_up : (text, nat) -> (Result_11);
namespace_update_info : (UpdateNamespaceInput) -> (Result);
schnorr_public_key : (SchnorrAlgorithm, opt PublicKeyInput) -> (
Result_4,
) query;
schnorr_sign : (SchnorrAlgorithm, SignInput) -> (Result_5);
schnorr_sign_identity : (SchnorrAlgorithm, SignIdentityInput) -> (Result_5);
setting_add_readers : (SettingPath, vec principal) -> (Result);
setting_create : (SettingPath, CreateSettingInput) -> (Result_12);
setting_get : (SettingPath) -> (Result_13) query;
setting_get_archived_payload : (SettingPath) -> (Result_14) query;
setting_get_info : (SettingPath) -> (Result_13) query;
setting_remove_readers : (SettingPath, vec principal) -> (Result);
setting_update_info : (SettingPath, UpdateSettingInfoInput) -> (Result_12);
setting_update_payload : (SettingPath, UpdateSettingPayloadInput) -> (
Result_12,
);
state_get_info : () -> (Result_15) query;
validate2_admin_add_allowed_apis : (vec text) -> (Result_16);
validate2_admin_add_auditors : (vec principal) -> (Result_16);
validate2_admin_add_managers : (vec principal) -> (Result_16);
validate2_admin_remove_allowed_apis : (vec text) -> (Result_16);
validate2_admin_remove_auditors : (vec principal) -> (Result_16);
validate2_admin_remove_managers : (vec principal) -> (Result_16);
validate_admin_add_allowed_apis : (vec text) -> (Result);
validate_admin_add_auditors : (vec principal) -> (Result);
validate_admin_add_managers : (vec principal) -> (Result);
validate_admin_remove_allowed_apis : (vec text) -> (Result);
validate_admin_remove_auditors : (vec principal) -> (Result);
validate_admin_remove_managers : (vec principal) -> (Result);
vetkd_encrypted_key : (SettingPath, blob) -> (Result_5);
vetkd_public_key : (SettingPath) -> (Result_5);
```
## Demo

Try it online: https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=53cyg-yyaaa-aaaap-ahpua-cai

The complete Candid API definition can be found in the [ic_cose_canister.did](https://github.com/ldclabs/ic-cose/tree/main/src/ic_cose_canister/ic_cose_canister.did) file.
## Quick Start

## Running locally
### Local Deployment

Deploy to local network:
Deploy the canister:
```bash
dfx deploy ic_cose_canister

Expand Down Expand Up @@ -127,7 +68,45 @@ dfx canister call ic_cose_canister ecdsa_public_key '(opt record {
dfx canister call ic_cose_canister namespace_add_users "(\"testing\", vec {principal \"hpudd-yqaaa-aaaap-ahnbq-cai\"})"
```

## API Reference

The canister exposes a comprehensive Candid API. Key endpoints include:

```candid
# Namespace Operations
namespace_add_managers : (text, vec principal) -> (Result)
namespace_update_info : (UpdateNamespaceInput) -> (Result)
namespace_get_info : (text) -> (Result) query
namespace_list_setting_keys : (text, bool, opt principal) -> (Result) query
# Setting Operations
setting_create : (SettingPath, CreateSettingInput) -> (Result)
setting_get : (SettingPath) -> (Result) query
setting_add_readers : (SettingPath, vec principal) -> (Result)
setting_update_payload : (SettingPath, UpdateSettingPayloadInput) -> (Result)
namespace_top_up : (text, nat) -> (Result)
# COSE Operations
schnorr_public_key : (SchnorrAlgorithm, opt PublicKeyInput) -> (Result) query
schnorr_sign : (SchnorrAlgorithm, SignInput) -> (Result)
ecdsa_sign : (SignInput) -> (Result)
ecdh_cose_encrypted_key : (SettingPath, ECDHInput) -> (Result)
# Identity Operations
namespace_get_fixed_identity : (text, text) -> (Result) query
namespace_add_delegator : (NamespaceDelegatorsInput) -> (Result)
namespace_sign_delegation : (SignDelegationInput) -> (Result)
get_delegation : (blob, blob, nat64) -> (Result) query
# Admin Operations
admin_add_managers : (vec principal) -> (Result)
admin_create_namespace : (CreateNamespaceInput) -> (Result)
admin_add_allowed_apis : (vec text) -> (Result)
```

Full Candid API definition: [ic_cose_canister.did](https://github.com/ldclabs/ic-cose/tree/main/src/ic_cose_canister/ic_cose_canister.did)

## License
Copyright © 2024 [LDC Labs](https://github.com/ldclabs).
Copyright © 2024-2025 [LDC Labs](https://github.com/ldclabs).

`ldclabs/ic-cose` is licensed under the MIT License. See [LICENSE](../../LICENSE-MIT) for the full license text.
2 changes: 1 addition & 1 deletion src/ic_cose_types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
`ic-oss-type` is a Rust types library used for integrating with [ic-oss](https://github.com/ldclabs/ic-oss) cluster.

## License
Copyright © 2024 [LDC Labs](https://github.com/ldclabs).
Copyright © 2024-2025 [LDC Labs](https://github.com/ldclabs).

`ldclabs/ic-oss` is licensed under the MIT License. See [LICENSE](../../LICENSE-MIT) for the full license text.
2 changes: 1 addition & 1 deletion src/ic_object_store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic_object_store"
description = "The Rust version of the client SDK for the ic_object_store canister."
description = "The Rust version of the client SDK for the IC Object Store canister."
publish = true
repository = "https://github.com/ldclabs/ic-cose/tree/main/src/ic_object_store"
version.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions src/ic_object_store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![Docs.rs](https://img.shields.io/docsrs/ic_object_store?label=docs.rs)](https://docs.rs/ic_object_store)
[![Latest Version](https://img.shields.io/crates/v/ic_object_store.svg)](https://crates.io/crates/ic_object_store)

[IC-COSE](https://github.com/ldclabs/ic-cose) is a decentralized COnfiguration service with Signing and Encryption on the Internet Computer.
[IC Object Store](https://github.com/ldclabs/ic-cose/tree/main/src/ic_object_store_canister) is a native Rust implementation of Apache Arrow object store on the Internet Computer.

`ic_object_store` is the Rust version of the client SDK for the ic_object_store canister.
`ic_object_store` is the Rust version of the client SDK for the IC Object Store canister.

## Documentation

Expand Down
43 changes: 40 additions & 3 deletions src/ic_object_store_canister/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
# `ic_object_store_canister`
# `IC Object Store`

Native Rust implementation of Apache Arrow object store on the Internet Computer.

More detail: https://github.com/apache/arrow-rs/blob/main/object_store/README.md

## Features

- Full implementation of Apache Arrow object store APIs.
- AES256-GCM encryption.

## Demo

Try it online: https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=6at64-oyaaa-aaaap-anvza-cai

## API Reference

The canister exposes a comprehensive Candid API. Key endpoints include:

```candid
# Object Operations
put_opts : (text, blob, PutOptions) -> (Result)
head : (text) -> (Result) query
get_opts : (text, GetOptions) -> (Result) query
get_ranges : (text, vec record { nat64; nat64 }) -> (Result) query
copy : (text, text) -> (Result)
rename : (text, text) -> (Result)
list : (opt text) -> (Result) query
list_with_delimiter : (opt text) -> (Result) query
list_with_offset : (opt text, text) -> (Result) query
create_multipart : (text) -> (Result)
put_part : (text, text, nat64, blob) -> (Result)
complete_multipart : (text, text, PutMultipartOpts) -> (Result)
# Admin Operations
admin_add_managers : (vec principal) -> (Result)
admin_remove_managers : (vec principal) -> (Result)
```

Full Candid API definition: [ic_cose_canister.did](https://github.com/ldclabs/ic-cose/tree/main/src/ic_object_store_canister/ic_object_store_canister.did)

## License
Copyright © 2024 [LDC Labs](https://github.com/ldclabs).
Copyright © 2024-2025 [LDC Labs](https://github.com/ldclabs).

`ldclabs/ic-cose` is licensed under the MIT License. See [LICENSE](../../LICENSE-MIT) for the full license text.
`ldclabs/ic-cose` is licensed under the MIT License. See [LICENSE](../../LICENSE-MIT) for the full license text.

0 comments on commit 5cdc45b

Please sign in to comment.