{"id":15031159,"url":"https://github.com/usherlabs/ic-adc","last_synced_at":"2025-05-15T05:31:31.299Z","repository":{"id":254047041,"uuid":"841170026","full_name":"usherlabs/ic-adc","owner":"usherlabs","description":"Efficiently fetch and verify asset data on the IC, powered by the Verity Protocol.","archived":false,"fork":false,"pushed_at":"2025-03-28T11:52:42.000Z","size":454,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T12:34:49.690Z","etag":null,"topics":["blockchain","canister","cryptocurrency","icp","rust","rust-lang","smart-contracts","web3"],"latest_commit_sha":null,"homepage":"https://www.usher.so","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usherlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-11T21:00:52.000Z","updated_at":"2025-03-28T11:52:46.000Z","dependencies_parsed_at":"2024-11-07T04:26:08.347Z","dependency_job_id":"1b88520e-2273-4d31-9e84-03cadadf6727","html_url":"https://github.com/usherlabs/ic-adc","commit_stats":null,"previous_names":["usherlabs/ic-adc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usherlabs%2Fic-adc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usherlabs%2Fic-adc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usherlabs%2Fic-adc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usherlabs%2Fic-adc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usherlabs","download_url":"https://codeload.github.com/usherlabs/ic-adc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254281970,"owners_count":22045062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","canister","cryptocurrency","icp","rust","rust-lang","smart-contracts","web3"],"created_at":"2024-09-24T20:15:01.083Z","updated_at":"2025-05-15T05:31:31.287Z","avatar_url":"https://github.com/usherlabs.png","language":"Rust","readme":"# Internet Computer Asset Data Canister (ADC)\n\nThe ADC is a highly efficient Oracle for real-world and cryptocurrency asset data on the Internet Computer. Developed by [Usher Labs](https://www.usher.so) and powered by the Verity Protocol.\n\nThe unique Chain-key architecture of the IC allows for new ways of combining off-chain data sourcing with on-chain computation, resulting in concise proofs of entire data flows. This approach addresses the challenges of traditional methods, such as the high costs and technical difficulties of HTTPS Outcalls for fetching data, especially from foreign blockchains. Additionally, there is currently no standardised framework for efficiently integrating foreign blockchain data, particularly for digital asset management and verifying private API data due to security concerns.\n\nThe ADC serves as an example of using the Internet Computer (IC) as a decentralised co-processor.\n\n## Explorer\n\nTo explore live TLS proofs and metrics sourced for the IC-ADC, visit the [IC-ADC Explorer](https://go.usher.so/ic-adc).\n\n## Data Supported \u0026 Roadmap\n\n- [x] Cryptocurrency Asset Prices\n- [ ] Cryptocurrency Asset Market Capitalisations\n- [ ] Cryptocurrency Asset Volume\n- [ ] Cryptocurrency Asset Uniswap Liquidity\n- [ ] Cryptocurrency Asset Token Holder Count\n- [ ] Arbitrary EVM Blockchain Data\n- [ ] IoT Data (Streamr \u0026 Helium)\n\n## Getting Started\n\nThe ADC works similarly to the native [IC Exchange Rate Canister](https://github.com/dfinity/exchange-rate-canister). Calling Canisters integrate with the ADC by making [XNET calls](https://internetcomputer.org/how-it-works/message-routing/) and waiting for a response from the ADC.\n\nTo learn more about integrating you Canister with the IC-ADC, read the [`example_caller/README.md`](./example_caller/README.md).\n\n### Overview\n\nThe ADC operates on a pull model. Requests are sent to the ADC for specific data, and an off-chain `orchestrator` process handles making and cryptographically proving these requests. The ADC then verifies and forwards the processed or unprocessed result to the Calling Canister.\n\n**There are two main actions when interacting with the ADC:**\n\n1. **Requesting price details about a currency pair:**\n\nWhen you make a request, you receive an `id` that you can use to track the response. This `id` corresponds to the timestamp when the request was received by the processor.\n\n```rust\n#[ic_cdk::update]\n/// where `currency_pairs` is a comma separated list of pairs\n/// e.g \"BTC,ETH/USDT,sol\"\nasync fn submit_adc_request(currency_pairs: String) -\u003e String {\n    let adc_canister_request_method = \"request_data\";\n    //TODO: change the principal to that of the processor's\n    let processor_canister_principal = Principal::from_str(\"bkyz2-fmaaa-aaaaa-qaaaq-cai\").unwrap();\n    let options = RequestOpts::default();\n\n    let (request_id,): (String,) = ic_cdk::call(\n        processor_canister_principal,\n        adc_canister_request_method,\n        (currency_pairs, options, ),\n    )\n    .await\n    .unwrap();\n\n    // println!(\"{:?}\", request_id)\n    return request_id;\n}\n```\n\n2. **Receiving a response for a request:**\n\nTo receive a response, an `update` function called `receive_adc_response` must be present on the Calling Canister.\nThis method receives a `result` which could either contain information about the response or the error encountered while trying to fetch the response\n\n```rust\n\n#[ic_cdk::update]\nfn receive_adc_response(response: Result\u003cADCResponse, ADCErrorResponse\u003e) {\n    println!(\"receive_adc_response: {:?}\", response);\n}\n```\n\nTo reiterate, a working example of a Calling Canister with the relevant schema can be found in [this example](./example_caller).\n\n## Caveats\n\n### `identity.pem`\n\nIf deployed locally, then the IC-ADC Orchestrator will use the local `identity.pem` - see `orchestrator/.env.example`\n\nHowever, the IC-ADC deployed by Usher Labs requires whitelisting by Usher Labs, authenticated by Usher Labs' `identity.pem` \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusherlabs%2Fic-adc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusherlabs%2Fic-adc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusherlabs%2Fic-adc/lists"}