Skip to main content

Compute

Perform computation using secrets stored in the network.

Get a Quote to Compute

src/nillion/components/ComputeForm.tsx
await nillion.default();

const operation = nillion.Operation.compute(
programId,
additionalComputeValues
);
const quote = await getQuote({
client: nillionClient,

Pay to Compute and get Payment Receipt

src/nillion/components/ComputeForm.tsx
if (nillionClient && quote?.operation) {
setLoadingPayment(true);
const [nilChainClient, nilChainWallet] =
await createNilChainClientAndWalletFromPrivateKey();

const paymentReceipt = await payWithWalletFromPrivateKey(
nilChainClient,
nilChainWallet,

Compute

src/nillion/components/ComputeForm.tsx
setPaymentReceipt(paymentReceipt);

const value = await computeProgram({
nillionClient,
receipt: paymentReceipt,
programId,
storeIds,
inputParties,
outputParties,
outputName,
Feedback