The Polybase Gateway REST API provides a convinent way to access the Polybase decentralized network.

While the Polybase network is in Alpha, the gateway is the only way to access the Polybase network. We will shortly be adding p2p access to the network.


The Polybase Gatweay API uses public/private key pair for authentication. That means it works natively with wallets like Metamask.

Authentication is composed of:

  • v the version being used, should be v=0
  • t current unix timestamp in milliseconds
  • h type of hash signing being used eth-personal-sign is currently the only allowed option
  • sig the signature of the data (see below)
  • pk optional 64 byte public key (secp256k1 algorithm)

An example of a valid authroization:


The token is passed in the X-Polybase-Signature header of the request.

Signature (sig)

To generate sig you must sign a string in the format <timestamp>.<body_json>. Where timestamp is the t you provided above, and body_json is the body of the request (as a JSON string).

You can use the @polybase/util package to generate the signature from any 32 bytes private key, and the sign function to create the signature.

import { secp256k1 } from '@polybase/util'

// You can use any 32 byte private key from any library, 
// here is an example from @polybase/util
let private_key = secp256k1.generatePrivateKey();

function createSig (timestamp, body) {
  const str_to_sign = `${timestamp}.${JSON.stringify(body)}`;
  return secp256k1.sign(privateKey, str_to_sign);