Description
Overview
An IC (Internet Computer) Agent is responsible for encoding and decoding messages used to communicate with the IC via its HTTPS interface, as well as verifying responses from the IC by checking the signature against the public key of the IC.
DFINITY is maintaining two IC agent implementations which can be seen in a template:
In addition, there are currently the following community-driven IC agent implementations with varying completeness:
- icp-client-cpp (C++)
- ic4j-agent (Java/Kotlin)
- agent_dart (Dart/Flutter)
- ic_dart_tools (Dart/Flutter)
- agent-go (Go)
- IC-Go (Go)
- ic-py (Python)
- ICP.NET (C#/.NET/Unity)
- agent-unity (partial) C# wrapper of agent-rs))
- ic_agent (Ruby)
- ICPKit (Swift)
We are open to supporting work on existing agent implementations if features are missing, and we might support additional implementations for languages/frameworks that already exist if there is a good reason for this. In addition, the following agent implementations are desired:
Currently, there are active projects for all agents that have been requested. If you need another client library, please get in touch.
Requirements
- Implementation of the HTTPS interface as defined in the IC Interface Specification. In particular, the following endpoints must be implemented:
call
,read_state
,query
andstatus
. - Calculation of the
request id
using representation-independent hashing - Authentication: A request may be either anonymous or authenticated via signatures. For authenticated requests delegation should be supported.
- CBOR: Requests and responses are CBOR encoded, hence, an IC agent needs to be able to encode/decode CBOR.
- Candid: The IC uses Candid as the interface description language (IDL). An IC agent needs to be able to encode/decode arguments between candid and the agent's programming language.
- Support of
Principal
data type. - IC certificate verification: Responses from the
read_state
API include a certificate that needs to be parsed (to look up the relevant information from the state tree) and verified. The public key of the IC must be hard coded in the software. For verification of responses from a local replica the public key needs to be fetched first.
Acceptance Criteria
- Unit tests
- E2E tests, e.g. using IC-Ref, See example in agent-rs.
- Documentation
- PR to Agents section on internetcomputer.org