Skip to content
KYZEN DOCUMENTATIONLaunch app

DocsProductsGateway

Keys

Issue an API key with one wallet signature, and revoke it with the key itself.

Issued on
One signature
Gas
None
Active keys
5 per wallet
Shown
Once

#Issue a key

A key is issued on one wallet signature. Signing sends no transaction and costs no gas. In the app, open Gateway and press Sign to issue API key: the app runs the steps below for you (Get a key).

  1. 01
    Ask for a challenge
    Send POST /v1/keys/challenge with the wallet’s address: {"address":"0x<wallet>"}. The answer holds a nonce and the message to sign.
  2. 02
    Sign the message
    The wallet signs the message exactly as given, as a personal message (personal_sign). A smart-contract wallet’s signature is accepted too.
  3. 03
    Send the signature
    Send POST /v1/keys with address, nonce and signature. The answer holds the key, its prefix and the base_url.
  4. 04
    Store the key
    The key is shown once, in that answer. Keep it where you keep passwords.

The message names the site that asks, the wallet, the chain and the nonce. Read it in the wallet before you sign:

The message
app.kyzen.network asks this wallet to sign for a Kyzen Network Gateway API key.

Wallet: 0x<your wallet, in lowercase>
Chain ID: 4663
Nonce: <32 hexadecimal characters>

Signing sends no transaction and costs nothing.
Issue a key
# 1. Ask for a challenge
curl https://app.kyzen.network/v1/keys/challenge \
  -H "Content-Type: application/json" \
  -d '{"address":"0xYourWallet"}'

# 2. Sign its message with the wallet, then send the signature
curl https://app.kyzen.network/v1/keys \
  -H "Content-Type: application/json" \
  -d '{"address":"0xYourWallet","nonce":"<nonce>","signature":"0x<signature>"}'
RuleValue
ChallengeValid for 10 minutes, for one wallet, used once
Keykyzn_ followed by 43 characters
PrefixThe key’s first 11 characters, which name it in GET /v1/account
StoredOnly the key’s SHA-256 hash: the Gateway cannot show the key again
Per walletAt most 5 active keys
SharedEvery key of a wallet spends the same balance and shares the same limits
RegionsBoth requests follow the app’s region rule (Where the app opens)

A refused request names its case. Every error, in full: Errors.

StatusCodeWhen
400invalid_walletThe address is not a 0x wallet address
400invalid_signatureThe nonce is missing, or the signature is not 0x hex
400challenge_expiredThe challenge is unknown, used, older than 10 minutes or another wallet’s: ask for a new one
401invalid_signatureThe signature is not this wallet’s signature of the message
409too_many_keysThe wallet already has 5 active keys. The challenge is used: revoke a key, then ask for a new challenge

#Revoke a key

A key revokes itself: send DELETE /v1/keys/current with the key in the Authorization header. It stops working at once, and the answer reads {"object":"kyzen.key","revoked":true}.

Revoke the key
curl -X DELETE https://app.kyzen.network/v1/keys/current \
  -H "Authorization: Bearer $KYZN_KEY"
After revokingRule
The keyEvery request with it answers 401 invalid_api_key
The balanceUnchanged: it belongs to the wallet, not to the key
Other keysKeep working
A new keyOne more signature issues it, up to 5 active

Revoking takes the key itself. Keep each key until you revoke it: a lost key stays active and counts toward the wallet’s five. GET /v1/account lists the active keys by id, prefix and the time each was created (Endpoints).

Esc
  • OverviewGet started
  • Quick startGet started
  • Wallets and networkGet started
  • Where the app opensGet started
  • GuidesGuides
  • Buy $KYZNGuides