HTTPS OUTCALLS — CONNECTING TO THE OUTSIDE WORLD
ICP canisters can make HTTP requests to external servers. This is called HTTPS Outcalls. It breaks the traditional blockchain isolation.
HOW IT WORKS:
1. Canister makes an HTTP request (GET, POST, HEAD)
2. All nodes in the subnet independently execute the request
3. Responses are compared using consensus
4. A single agreed-upon response is returned to the canister
WHAT THIS ENABLES:
- Fetch real-time price data from exchanges
- Call traditional APIs (Twitter, GitHub, weather)
- Integrate with Web2 services
- Access off-chain data without oracles
CONSENSUS ON RESPONSES:
For deterministic results:
- GET requests must return the same response
- POST requests must produce the same result
- Headers are normalized
- Timing is managed by the subnet
USE CASES:
1. DeFi: Real-time price feeds
2. Social: Posting to Twitter from a canister
3. IoT: Reading sensor data
4. Enterprise: Calling legacy APIs
5. AI: Fetching external model results
LIMITATIONS:
- Cannot maintain stateful HTTP connections
- Response size has limits
- Cannot use cookies or sessions
- Rate limiting depends on external servers
This is what makes ICP the only fully on-chain platform that can seamlessly interact with the entire web.
Next: Part 15 — Bitcoin Integration
$ICP #InternetComputer #Course