Yotam Harchol Profile picture
Sep 9 7 tweets 2 min read
In a few days, canisters (applications running on chain on the #IC) will be able to make HTTPS requests to any external web endpoint. It will be the first ever blockchain to allow that, and will remove the need for external oracles. Here’s how it works: 🧵 1/7
2/7 A canister issue a http_request by calling an API function and specifying the method, target URL, headers, body, and a “transform” function. We’ll get to that function later.
3/7 The request goes into the certified state of the blockchain and then, each node on the corresponding subnet actually makes that request on behalf of the canister. So yes, the request is made multiple times (as of now on app subnets there are 13 nodes, so at most 13 times).
4/7 For GET requests this shouldn’t be a problem as they are not supposed to change state on the remote server, but for POST requests the remote server needs to be able to handle idempotent requests. So this may not suit every use case, but we believe it is still useful for many.
5/7 The request goes out and responses come back to the different nodes. Now they need to reach consensus on the content of the response. This might be tricky, as responses may differ slightly, even for identical requests. For example, they may contain different timestamps.
6/7 Here’s where the “transform” function comes to play: each node applies it separately on the response it got, and then signs the result of that function. Once a block maker has enough signature shares for exactly the same transformed response, it includes it in the next block.
7/7 When a transformed response is included in a block it is delivered back to the calling canister via a callback.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Yotam Harchol

Yotam Harchol Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(