Cryptosim: Try Out the Cryptosat API

Yan Michalevsky
Cryptosat
Published in
4 min readDec 5, 2022

--

Cryptosat builds and launches small satellites into Low-Earth Orbits (LEO). There, physically out of anyone’s reach, they serve as the most secure cryptographic modules that protect sensitive operations and protocols, and perform functions like harvesting entropy, trusted setups for cryptographic protocols, or signing transactions and data from space.

Most developers and users are far removed from the space industry and have never directly interacted with a satellite. This is why we thought it would be extremely helpful to give developers a sense of some of the possibilities, as well as the constraints of working with a satellite constellation.

In this post, we dive into Cryptosim (Cryptosat Simulator) — a sandbox simulator and interactive tutorial we’ve been developing since we started Cryptosat. Cryptosim is accessible using any modern browser and enables developers to learn about our satellites’ functionality prior to any actual integration with our production pipeline.

Screenshot of the first version of Cryptosim developed by Gil Shotan.

The simulator UI is divided between a tutorial (on the right-hand side) that describes the API functions supported by Cryptosat, a map that shows the satellite trajectory, and a JS console where the user can programmatically try the API and interact with the simulated satellite to request its status, sign messages, request randomness, generate Delay-Encryption key-pairs and more.
The tutorial explains the general premise of Cryptosat, teaches about communication windows and satellite availability, the asynchronous interface to the satellites, and showcases the different cryptographic functions supported by Cryptosat, as well as how to use them in a context.
Let’s take a look at the example of Public Randomness, also known as a Random Beacon or VRF (Verifiable Random Function).

Public Randomness example. Note: here, we use a method to obtain the response verification key, but in reality, the public key of a satellite would be provided via a different channel that cannot be controlled by a man-in-the-middle.

Cryptosat periodically broadcasts a random beacon — an unpredictable bit sequence generated off entropy harvested aboard a satellite. This beacon could be used to run lotteries, generate random NFT shuffles, and more. Calling cryptosat.getPublicRandom() returns the most recent beacon received from Cryptosat’s satellite constellation.

From a physics perspective, it actually shows on a map the real trajectory of our first satellite, Crypto1, based on data (TLE) pulled from NORAD, a US agency that monitors all moving objects in orbit. As we launch more satellites, we’ll be adding those in Cryptosim with their respective trajectories.

Asynchronous API

Since satellites are not visible to ground stations 100% of the time, at times, there can be a significant delay in executing a user request. Therefore, the satellite API is asynchronous. Functions return a request object, which you can query for the request completion status by calling the .status() method. The request status will remain Pending as long as the satellites are out of reach of any ground station. As soon as it is executed, the status will switch to Ready. The user can then safely call the .result() method to obtain the satellite response.

Using the asynchronous requests API

Use case examples

Cryptosim showcases some of the use-cases where a user may want to use Cryptosat services. The common theme to all of them is using Cryptosat satellites as a tamper-proof, trustworthy, and secure cryptographic root-of-trust that can be trusted to operate correctly and provide cryptographic integrity due to them being physically out of reach of even the most sophisticated adversaries.

The current version of Cryptosim includes examples for:

  • Public randomness (Random Beacon)
  • Private Randomness — where a user can request random bits to be encrypted to a public key they provide in the request.
  • Retrieving a signed timestamp — which can be used by applications that require a trusted source of time or smart contracts that need to ensure a certain amount of time has passed in the real world.
  • Signing any data in space
  • Delay Encryption — where a satellite generates a cryptographic key-pair and publishes the public key. The private key is not released before a specified amount of time has passed, preventing premature decryption of any data encrypted to the published public key. This could be used, for example, in auctions, voting schemes, and more (send us a use-case YOU are excited about!).

As we keep adding functionality and expanding the Cryptosat API, we’ll keep updating the simulator with new tutorials and examples.

RESTful API

In addition to the self-contained browser-based simulation, we are working towards opening up access to a RESTful API. The API would enable access to the production satellites for authorized users, as well as to a simulated constellation for development and testing purposes.

Open-source contribution

If you’re interested in contributing additional ideas and suggesting use-cases for Cryptosat, you can play with the Cryptosim source code, which is available on our Github. The main repository is cryptosim-tutorialbut, depending on the pieces you want to tweak, you may also want to check out the cryptosim and cryptosim-visualization repositories.

Using Cryptosat satellites

Remember that the whole point is to learn how to use the API and then use the actual Cryptosat satellites and get requests served from space. Get in touch with us at info@cryptosat.io for more information on how to integrate with our production system. More technical information about Cryptosat and its APIs is on our documentation portal.

--

--