Request Network Docs
WebsiteGithubStatusDiscord
  • Request Network Docs
  • Request Network API
    • Create and Pay Requests
    • Crosschain Payments
    • EasyInvoice: API Demo App
    • API Portal: Manage API Keys and Webhooks
      • Manage API Keys and Webhooks programmatically
    • Full API Reference
  • General
    • Lifecycle of a Request
    • Request Scan
    • Supported Chains
      • Smart Contract Addresses
    • Request Network Token List
  • Advanced
    • Request Network SDK
      • Get Started
        • Quickstart - Browser
        • Quickstart - Node.js
        • Installation
        • SDK Injector
        • Request Node Gateways
      • SDK Demo Apps
        • Request Invoicing
          • Pay from Safe Multisig
        • Request Checkout
        • Components
          • Create Invoice Form
          • Invoice Dashboard
          • Payment Widget
          • Add Stakeholder
      • SDK Guides
        • Request Client
          • Configure the Request Client
          • Updating a Request
          • Payment Reference
          • Compute a Request ID without creating the request
          • Use your own signature mechanism
          • Support a new currency
          • In-Memory Requests
        • Encryption and Decryption
          • Encrypt with a wallet signature using Lit Protocol
          • Encrypt with an Ethereum private key
          • Share an encrypted request
        • Payment
          • Detect a payment
          • Native Payment
          • Conversion Payment
          • Declarative Payment
          • Configuring Payment Fees
          • Single Request Forwarder
          • Batch Payment
          • Swap-to-Pay Payment
          • Swap-to-Conversion Payment
          • Transferable Receivable Payment
          • Meta Payments
          • Escrow Payment
          • Streaming Payment
          • Pay through a proxy-contract with a multisig
          • Hinkal Private Payments
        • Mobile using Expo
      • SDK Reference
        • request-client.js
          • RequestNetwork
            • createRequest()
            • computeRequestId()
            • fromRequestId()
            • fromIdentity()
            • fromTopic()
          • Request
            • waitForConfirmation()
            • getData()
            • refresh()
            • cancel()
            • accept()
            • increaseExpectedAmountRequest()
            • reduceExpectedAmountRequest()
          • IIdentity
          • IRequestDataWithEvents
          • PaymentReferenceCalculator
        • payment-processor
          • payRequest()
        • web3-signature
          • Web3SignatureProvider
        • epk-signature
          • EthereumPrivateKeySignatureProvider
        • epk-decryption
          • EthereumPrivateKeyDecryptionProvider
    • Protocol Overview
      • SDK and Request Node Overview
      • Payment Networks
      • Private Requests using Encryption
      • Smart Contracts Overview
    • Internal SDK Architecture
      • Request Logic
      • Advanced Logic
      • Transaction
      • Data-access
      • Storage
      • Data flow
      • Request IPFS network
  • FAQ
  • Glossary
  • Contributing
Powered by GitBook
On this page
  • Benefits
  • Supported Chains
  • Installation
  • Usage
  • Pay a request from a Hinkal private address
  • Deposit to a Hinkal private address
  • Content Security Policy
  • Details

Was this helpful?

Edit on GitHub
Export as PDF
  1. Advanced
  2. Request Network SDK
  3. SDK Guides
  4. Payment

Hinkal Private Payments

PreviousPay through a proxy-contract with a multisigNextMobile using Expo

Last updated 2 months ago

Was this helpful?

The Request Network SDK supports Hinkal Private Payments using ERC-20 tokens. Hinkal is a middleware and suite of smart contracts on EVM-compatible chains that leverage zero-knowledge proofs and private addresses to facilitate compliant and private transactions.

Each public address has exactly one Hinkal private address.

The @requestnetwork/payment-processor package provides functions to:

  • Pay a request from a Hinkal private address to a public address: such that the payment sender's public address never appears on-chain.

  • Deposit to a Hinkal private address from a public address: such that the payment recipient's public address never appears on-chain. Callers can choose to deposit to their own private address or someone else's private address.

Paying a request where the payment recipient address is a Hinkal private address is not supported because the Request Network payment proxy smart contracts can only send funds to public addresses. Consider using Declarative Payment instead.

Benefits

  • Privacy: Obfuscates payer address when paying a request.

  • Compliance: Ensures transactions adhere to regulatory requirements. See for details

Supported Chains

See for a list of chains on which Hinkal Private Payments are supported.

Installation

To use Hinkal Private Payments, install the necessary package:

npm install @requestnetwork/payment-processor

Usage

Pay a request from a Hinkal private address

To pay a request from a Hinkal private address to a public address, where only the payment sender's address is obfuscated, use the `payErc20FeeProxyRequestFromHinkalShieldedAddress()` function. Ensure the payment sender's Hinkal private address has a positive balance using Deposit to a Hinkal private address

Strongly consider using Encryption and Decryption to keep the request contents private, including the payer and payee identity addresses, when paying requests from a Hinkal private address. Revealing the payer and payee identity addresses increases the likelihood of un-shielding the payment sender's address via on-chain analysis.

import { 
  payErc20FeeProxyRequestFromHinkalShieldedAddress,
} from '@requestnetwork/payment-processor';

// Instantiation of `RequestNetwork` and `Signer` omitted for brevity

const request = await requestClient.fromRequestId('insert request id');
const requestData = request.getData();

const relayerTx = await payErc20FeeProxyRequestFromHinkalShieldedAddress(
  requestData,
  signer,
);

See Quickstart - Browser for how to instantiate a RequestNetwork and Signer

Deposit to a Hinkal private address

To deposit funds to a Hinkal private address from a public address, where only the payment recipient's address is obfuscated, use the sendToHinkalShieldedAddressFromPublic() function.

  • Deposit to own Hinkal shielded address: omit the recipientInfo argument

  • Deposit to someone else's Hinkal shielded address: set recipientInfo to the shielded address of the payment recipient.

Hinkal private addresses must be shared out-of-band. This SDK doesn't offer functions for sharing Hinkal private addresses.

import { 
  sendToHinkalShieldedAddressFromPublic,
} from '@requestnetwork/payment-processor';

// Instantiation of `Signer` omitted for brevity

const recipientShieldedAddress = '142590100039484718476239190022599206250779986428210948946438848754146776167,0x096d6d5d8b2292aa52e57123a58fc4d5f3d66171acd895f22ce1a5b16ac51b9e,0xc025ccc6ef46399da52763a866a3a10d2eade509af27eb8411c5d251eb8cd34d'
const tx = await sendToHinkalShieldedAddressFromPublic({
    signerOrProvider: paymentSender,
    tokenAddress: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC on Base
    amount: '1000000', // 1 USDC
    recipientInfo: recipientShieldedAddress, // omit to deposit to own Hinkal shielded address
})

See Quickstart - Browser for how to instantiate a Signer

Content Security Policy

As a result, any client-side application integrating the Hinkal SDK must adjust its Content-Security-Policy to allow the wasm-unsafe-eval directive under the script-src setting. This configuration ensures that the cryptographic processes can execute properly.

Details

The Hinkal SDK depends on , a powerful library that enables local zero-knowledge proving in browser and Node.js environments. Snarkjs leverages to perform complex cryptographic computations efficiently.

See for more details.

For more details about Hinkal Private Payments, refer to on GitHub.

Hinkal Compliance
Hinkal Supported Chains
snarkjs
WebAssembly
Hinkal SDK Integration
Pull Request #1482