Zero Knowledge Token Transfer API (1.0)

Download OpenAPI specification:Download

With Kaleido's Zero Knowledge Token Transfer service, transfers are conducted with Zero Knowledge Proofs such that the transactions are both confidential (the balances and transfer amounts are concealed), and anonymous (the sender and receiver identities are concealed).

Currently the service supports shielding ERC20 tokens. Ethereum accounts holding balances in ERC20 tokens can use their tokens to fund a corresponding shielded account in the service, and obtain equal amount shielded tokens. They the shielded tokens can be transfers among the shielded accounts owned by the participating organizations.

Shielded token balances can be used to exchange back to ERC20 tokens by withdrawing.

This service is part of Kaleido Lab's experimental catalog.

tokenzkp

Shielded Account

Get shielded and unshielded ethereum accounts

Returns the accounts owned by the current membership across all Zero Knowledge Token Transfer services, both unshielded Ethereum accounts and shielded accounts. If the entry contains an index property, they exist locally inside the target service instance, and can be used to send shielded tokens and query balances

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$

Responses

Response samples

Content type
application/json
{
  • "membership_id": "string",
  • "ethAccount": "string",
  • "shieldedAccount": [
    ],
  • "index": 0
}

Create shielded account

Create a shielded account for the Ethereum account, so that the new shielded account can be funded with the Ethereum account

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
Request Body schema: application/json
ethAccount
required
string^0x[0-9a-fA-F]{40}$

Responses

Request samples

Content type
application/json
{
  • "ethAccount": "string"
}

Response samples

Content type
application/json
{
  • "membership_id": "string",
  • "ethAccount": "string",
  • "shieldedAccount": [
    ],
  • "index": 0
}

ZKP Contracts

Get Zero Knowledge Transfer contracts

Returns the Zero Knowledge Transfer contracts deployed in the environment along with their corresponding ERC20 contracts

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Deploy Zero Knowledge Proof contract (ZSC)

Deploys a Zero Knowledge Proof contract (ZSC)

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
Request Body schema: application/json
erc20
required
string

ERC20 token contract address used by the ZSC for funding and withdrawing operations

Responses

Request samples

Content type
application/json
{
  • "erc20": "string"
}

Response samples

Content type
application/json
{
  • "zsc": "string",
  • "erc20": "string",
  • "epochLength": 0,
  • "compatible": true
}

Fund a shielded account

Funds a shielded account in a Zero Knowledge Proof contract (ZSC) by transfering ERC20 tokens to the ZSC contract

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
shielded_contract_id
required
string^0x[0-9a-f]{40}$
Request Body schema: application/json
ethAccount
required
string^0x[0-9a-fA-F]{40}$

The Ethereum account to receive the ERC20 tokens from the ZSC after burning equal amount of Zethers from the corresponding shielded account

amount
required
integer

The amount of ERC20 tokens to transfer

Responses

Request samples

Content type
application/json
{
  • "ethAccount": "string",
  • "amount": 0
}

Withdraw balance from a shielded account

Withdraws from a shielded account in a Zero Knowledge Proof contract (ZSC) by burning the requested amount of Zether and transfering equal amount of ERC20 tokens back to the original funding account

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
shielded_contract_id
required
string^0x[0-9a-f]{40}$
Request Body schema: application/json
ethAccount
required
string^0x[0-9a-fA-F]{40}$

The Ethereum account to draw the ERC20 tokens from in order to fund the corresponding shielded account inside the ZSC

shieldedAccount
Array of strings

Optional. The shielded account corresponding to the Ethereum account.

amount
required
integer

The amount of ERC20 tokens to transfer

Responses

Request samples

Content type
application/json
{
  • "ethAccount": "string",
  • "shieldedAccount": [
    ],
  • "amount": 0
}

Transfer Zether tokens between shielded accounts

Transfers Zether tokens from a shielded account to another shielded account in a Zero Knowledge Proof contract (ZSC)

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
shielded_contract_id
required
string^0x[0-9a-f]{40}$
Request Body schema: application/json
from
required
Array of strings

Shielded account to transfer Zether tokens from

to
required
Array of strings

Shielded account to transfer Zether tokens to

amount
required
integer

The amount of Zether tokens to transfer

decoys
Array of strings[ items ]

Optional. List of shielded accounts to add to the anonymity set to increase security of the transfer transaction

Responses

Request samples

Content type
application/json
{
  • "from": [
    ],
  • "to": [
    ],
  • "amount": 0,
  • "decoys": [
    ]
}

Get shielded account balance

Returns Zether token balance for the shielded account corresponding to the given Ethereum account

Authorizations:
bearer_token
path Parameters
service_id
required
string^[0-9a-z]{10}$
shielded_contract_id
required
string^0x[0-9a-f]{40}$
ethAccount
required
string^0x[0-9a-f]{40}$

Responses

Response samples

Content type
application/json
{
  • "result": 0
}