Skip to content

Hash Documentation

A Hash function is a function that can use to map data into a fixed-size value. The hash value is used to uniquely identify the source data. We use a hash function to identify a vFunction build, this way you can ensure that the vFunction you build is the same as the one that is being executed.

Generate SHA256

To build your vFunction you need to provide the hash value of your zip file generated by the SHA256 hash function. To generate this value just use the following command.

bash
sha256sum yourvFunction.zip

You will the hash value of your vFunction zip file to use it on the build process.

Base Image Hash Inspection

In the Dockerfile of your vFunction, you used a verifiably base image. To build the vFunction you need to provide the build API with the SHA256 value for that image. To do this you can use the verifiably API to inspect the build process of that base image.

bash
curl --request GET -H "x-api-key: <api-key>" -H "x-api-key-id: <api-key-id>" "https://vbuild.us-east-2.verifiably.com/build?proof=true"

This request will give you the information about your current builds and give you credentials to access verifiably builds. It will also give you commands to get the python-base-image SHA256 and a command to inspect the build process of the image.

Inspect Image Build process

This command will get the the last build in the project.

bash
aws codebuild batch-get-builds --ids $(aws codebuild list-builds-for-project --project-name EnclaveBaseImages | jq -r '.ids[0]')

You can check the source code to generate this image in the python-base-image repository.

Get Image Hash value

Use this command to get the information about the public python-base-image. Use the 'imageDigest' value when you call the build API.

bash
aws ecr describe-images --registry-id 558794228868 --repository-name python-base-image

Verifiably Documentation