> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# wallet/getnkfromnsk | TRON

> TRON API method that derives a nullifier key (nk) from a nullifier secret key (nsk) for shielded TRC20 transactions. TRON via Chainstack.

TRON API method that derives a nullifier key (nk) from a nullifier secret key (nsk) for shielded TRC20 transactions. The nullifier key is used to generate nullifiers that prevent double-spending in the shielded transaction protocol.

## Parameters

* `value` — nullifier secret key (nsk) as a 32‑byte (64‑hex) string, no `0x` prefix.

## Response

* `value` — the derived nullifier key (nk) in hexadecimal format

## Use case

The `wallet/getnkfromnsk` method is used for:

* Deriving nullifier keys required for preventing double-spending in shielded transactions
* Converting secret nullifier keys to public nullifier key components
* Supporting the cryptographic foundation for privacy-preserving transaction verification
* Enabling secure nullifier generation in shielded TRC20 implementations

## curl example

```shell Shell theme={"system"}
curl --request POST \
  --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnkfromnsk' \
  --header 'Content-Type: application/json' \
  --data '{
    "value": "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"
  }'
```

<Info>
  Ensure `value` is exactly 64 hexadecimal characters without a `0x` prefix; otherwise the node returns a validation error indicating the expected length.
</Info>


## OpenAPI

````yaml openapi/tron_node_api/shielded_getnkfromnsk.json post /95e61622bf6a8af293978377718e3b77/wallet/getnkfromnsk
openapi: 3.0.0
info:
  title: wallet/getnkfromnsk TRON API
  version: 1.0.0
  description: >-
    Derive nullifier key (nk) from nullifier secret key (nsk) for shielded
    transactions
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/getnkfromnsk:
    post:
      tags:
        - Shielded Contract Methods
      summary: wallet/getnkfromnsk
      operationId: getNkFromNsk
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - value
              properties:
                value:
                  type: string
                  description: >-
                    Nullifier secret key (nsk) as a 32‑byte (64‑hex) string
                    without 0x prefix.
                  pattern: ^[0-9a-fA-F]{64}$
                  example: >-
                    abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd
      responses:
        '200':
          description: Successfully derived nullifier key
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                    type: string
                    description: >-
                      The derived nullifier key (nk) in hexadecimal format (no
                      0x prefix)
                    example: >-
                      04b2c3d4e5f6789012345678901234567890123456789abcdef0123456789abcd

````