Developer Resources

Certifying the Authenticity of Responses

This technical explanation illustrates the way responses from canisters hosted on the Internet Computer are certified as authentic

IC Academy » Developer Resources » Certifying the Authenticity of Responses

How Responses are Certified as True

Technical explanation of the way responses from canisters hosted on the Internet Computer are certified as authentic

Users that are interacting with canister smart contracts and the Internet Computer blockchain may wish to verify the authenticity of the responses they get. In the following, we’ll take a look how this is accomplished.

Introductory Example

To better illustrate the problem the Internet Computer addresses when it comes to verifying the authenticity of responses, we are going to use the example of a booking agency selling show tickets.

If you are interested in purchasing tickets for an upcoming show from the agency, you will most likely interact with the service over the internet. You may proceed with your planned purchase if you trust the network and the service provider. The internet, however, enables malicious third parties between you and the service provider to manipulate your request and/or the services’ response.

Using a service on the internet

User

Book the show

Confirmed! Seat 5A

Internet

abcd-efg

As you can see in the image above, a malicious party can step between you and the service provider to manipulate requests and responses. The solution for this problem is public key cryptography by means of which both parties have a secret key, preventing third parties from manipulating the exchange between user and service. The service provider has a secret key which is used to sign responses. Users have the public key of the service to verify the authenticity of the response.

Using a service on the Internet Computer

User

Book the show

Confirmed! Seat 5A

Subnet

abcd-efg

Verifying responses from services and canisters on the Internet Computer is similar but differs slightly. Instead of being full-stack service servers with their own secret keys, services on the Internet Computer are comprised of code that is running in canister smart contracts.

What are canisters?

Canisters are compute units (i.e. smart contracts) that are designed for internet-scale applications and services running at web speed.

These applications running on the Internet Computer are not providing cryptography on their own. Instead, the canister smart contracts are being executed by the subnets they are hosted on.

These applications running on the Internet Computer are not providing cryptography on their own. Instead, the canister smart contracts are being executed by the subnets they are hosted on.

In our example, the booking agency’s code is located in a canister smart contract.

As a whole, the subnet can create a signature that is then used by users to authenticate the response of a service. A subnet can only create such a signature if the supermajority of nodes comprising the subnet agree on signing the signature. This means that false signatures cannot be created even if there are malicious nodes in the subnet.

Aforementioned signatures are used via threshold cryptography. Threshold signatures are expensive which limits the scalability of the network.

This problem is solved by removing the need to sign all responses individually. Instead, responses are listed in a document of the subnet. The resulting document is redacted so that users can only see responses that are relevant to them. By looking at the document, users can verify that the responses to their requests are authentic.

User

Book the show

Confirmed! Seat 5A

Subnet 5

Root Subnet

The effect of using a redacted document is similar to document compression, reducing the costs of threshold signatures substantially as users only get reasonably sized responses.

The Internet Computer is infinitely scalable. This is made possible by expanding the network with new subnets. For this reason, the number of subnets grows with increases of demand. Because of this, users do not need the public keys of all existing subnets.

As a result, users only have one public key, allowing them to verify the authenticity of all data coming from the Internet Computer blockchain. This public key is represented in the illustration above in orange. The users public key is the public key of a particular subnet, i.e. the root subnet in which the services (canisters) are located that the user interacts with. The user knows the public key of the root subnet but not the keys of other subnets in the network.

In practice, a redacted listing of all subnets on the Internet Computer is sent along with the service’s response to the user. The user can then use this document to find the subnet’s public key.

With the help of update calls, subnets certify responses to users and canisters on behalf of the Internet Computer. Such update calls are requests from users to the Internet Computer, go through consensus, and are then included in blocks. These calls can change the state of a canister, for example when booking a ticket to a show.

Interface Specification

Learn more about the Interface Specification that details how users and services communicate

IC Internet Specification

Introducing the Quill Toolkit

Find out more about Quill, the open source ledger and governance toolkit for the Internet Computer

Quill