LogoLogo
CSPR.build Portal
1.0.x
1.0.x
  • Documentation
    • Introduction
    • Overview
      • Authorization
      • Rate limits and quotas
      • Pagination
      • Sorting
      • Filtering
      • Optional properties
      • Errors
    • Getting started
    • Highlights
      • Including related entities
      • Including CSPR rates
      • Including account info
      • Accessing auction data
      • Accessing token data
      • Accessing NFT data
      • De-anonymizing account hashes
      • De-anonymizing account purses
      • Receiving contract-level events
    • Changelog
  • REST API
    • Reference
    • Account
      • Get account
      • Get accounts
    • Account Info
      • Get account info
      • Get account infos
    • Auction metrics
      • Get auction metrics
    • Awaiting deploy
      • Create Awaiting Deploy
      • Add Awaiting Deploy signatures
      • Get Awaiting Deploy
    • Block
      • Get block
      • Get blocks
      • Get validator blocks
    • Bidder
      • Get bidder
      • Get bidders
    • Contract
      • Get contract
      • Get contracts
      • Get contracts by contract package
      • Get contract types
    • Contract entry point
      • Get contract entry points
      • Get contract entry point costs
    • Contract package
      • Get contract package
      • Get contract packages
      • Get account contract packages
    • Delegation
      • Get account delegations
      • Get validator delegations
    • Delegator reward
      • Get account delegator rewards
      • Get delegator total rewards
    • Deploy
      • Get deploy
      • Get deploys
      • Get account deploys
      • Get block deploys
      • Get deploy execution types
    • Fungible token action
      • Get fungible token actions
      • Get fungible token action types
      • Get account fungible token actions
      • Get contract package fungible token actions
    • Fungible token ownership
      • Get account fungible token ownership
      • Get contract package fungible token ownership
    • Non-fungible token (NFT)
      • Get NFT
      • Get account NFTs
      • Get contract package NFTs
      • Get NFT standards
      • Get off-chain NFT metadata statuses
    • Non-fungible token (NFT) action
      • Get contract package NFT actions for a token
      • Get account NFT actions
      • Get contract package NFT actions
      • Get NFT action types
    • Non-fungible token (NFT) ownership
      • Get contract package NFT ownership
      • Get account NFT ownership
    • CSPR rate
      • Get the current currency rate
      • Get historical currency rates
      • Get currencies
    • CSPR supply
      • Get supply
    • Transfer
      • Get account transfers
      • Get deploy transfers
    • Validator
      • Get validator
      • Get validators
    • Validator performance
      • Get historical validator performance
      • Get historical average validator performance
      • Get historical average validators performance
    • Validator reward
      • Get validator rewards
      • Get validator total rewards
  • Streaming API
    • Reference
    • Account balance
    • Block
    • Contract
    • Contract package
    • Contract-level events
    • Deploy
    • Fungible token action
    • Non-fungible token (NFT)
    • Non-fungible token (NFT) action
    • Transfer
  • Casper Node API
    • Connecting with an SDK
Powered by GitBook
On this page
  1. Documentation
  2. Highlights

De-anonymizing account hashes

PreviousAccessing NFT dataNextDe-anonymizing account purses

Last updated 1 year ago

While accounts are known to be recognized by their public keys, internally on-chain, they are uniquely identified by fixed-length accounts hashes derived from those public keys. Because of that, in certain contexts, we may know the account hash but not the public key. CSPR.cloud maintains the mapping between account hashes and the corresponding public keys to be able to "de-anonymize" the former when needed by requesting the public key as an .

Let's have a look at the , for example. The Transfer object only provides the recipient account hash:

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/deploys/6117d9f92a40d3785b53145c68a118cf36b974b2803acf41cffce8630acd769c/transfers' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": [
    {
      "amount": "2000000000000",
      "deploy_hash": "6117d9f92a40d3785b53145c68a118cf36b974b2803acf41cffce8630acd769c",
      "from_purse": "uref-72653d09444d0b3bd27372247510e9346c39fa831a89008dd9ce849a7b2c15e2-007",
      "id": 1704899420700,
      "initiator_account_hash": "7dc2bcc676eba6196d16374e1a2dbfa1df336f779854d95a0b4e65de6d593158",
      "timestamp": "2024-01-10T15:10:36Z",
      "to_account_hash": "b85634e0695ac3b6a7792c2009377b4a405118571a9c64ab2c66048250fef36c",
      "to_purse": "uref-7bba21087353cf75a83234b07525efdf33f59a6d71da00021a4bb80b6ace4bd7-004",
      "transform_key": "a1845ce7b2d334c7fd39b6313ebcfe4e8e29889bcdc792f7c67c7ba5360fd220"
    }
  ],
  "item_count": 1,
  "page_count": 1
}
curl -X 'GET' -G \
  'https://api.testnet.cspr.cloud/deploys/6117d9f92a40d3785b53145c68a118cf36b974b2803acf41cffce8630acd769c/transfers' \
  --data-urlencode 'includes=to_public_key' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": [
    {
      "amount": "2000000000000",
      "deploy_hash": "6117d9f92a40d3785b53145c68a118cf36b974b2803acf41cffce8630acd769c",
      "from_purse": "uref-72653d09444d0b3bd27372247510e9346c39fa831a89008dd9ce849a7b2c15e2-007",
      "id": 1704899420700,
      "initiator_account_hash": "7dc2bcc676eba6196d16374e1a2dbfa1df336f779854d95a0b4e65de6d593158",
      "timestamp": "2024-01-10T15:10:36Z",
      "to_account_hash": "b85634e0695ac3b6a7792c2009377b4a405118571a9c64ab2c66048250fef36c",
      "to_public_key": "02027fec2d969dd0779358c40abe2a772f309408348c2a1f413fddfe684a4287ba1a",
      "to_purse": "uref-7bba21087353cf75a83234b07525efdf33f59a6d71da00021a4bb80b6ace4bd7-004",
      "transform_key": "a1845ce7b2d334c7fd39b6313ebcfe4e8e29889bcdc792f7c67c7ba5360fd220"
    }
  ],
  "item_count": 1,
  "page_count": 1
}

Let's "de-anonymize" the recipient of the transfer above by including the to_public_key :

Note the to_public_key property that was added in the second response. It contains the public key that corresponds to the account hash specified in to_account_hash. Please check to learn about all the optional data that can be included in the responses.

optional property
Transfer API
optional property
Transfer API
Transfer Optional Properties