De-anonymizing account purses

Similarly to "de-anonymizing account hashes", CSPR.cloud can also "de-anonymize" account purses which can be used as the only transfer source or destination parameter. Let's have a look at transfers that happened in this deploy for example.

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/deploys/014989ad6e5b0c26a00f23606b8d6ec963003a9cc2e5e32f43b8ababc55fb8ab/transfers' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": [
    {
      "amount": "99000000",
      "deploy_hash": "014989ad6e5b0c26a00f23606b8d6ec963003a9cc2e5e32f43b8ababc55fb8ab",
      "from_purse": "uref-faf8e43069a7551cbb0594dd1f93396cf204e80b59886129d3476bf3319d7aef-007",
      "id": null,
      "initiator_account_hash": "d65804fef96e8c4294c7a95daf5c7dd219f19f08e2613418b453b08eb84364ab",
      "timestamp": "2021-09-16T16:06:16Z",
      "to_account_hash": null,
      "to_purse": "uref-faf8e43069a7551cbb0594dd1f93396cf204e80b59886129d3476bf3319d7aef-007",
      "transform_key": "213bd956791dd9be048bd20b793a277d5807682bb1fa827e344cbe1ad2a3cc53"
    }
  ],
  "item_count": 1,
  "page_count": 1
}

The to_account_hash was not specified in the transfer parameters. Let's "de-anonymize" it by including the to_purse_public_key optional property:

curl -X 'GET' -G \
  'https://api.testnet.cspr.cloud/deploys/014989ad6e5b0c26a00f23606b8d6ec963003a9cc2e5e32f43b8ababc55fb8ab/transfers' \
  --data-urlencode 'includes=to_purse_public_key' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": [
    {
      "amount": "99000000",
      "deploy_hash": "014989ad6e5b0c26a00f23606b8d6ec963003a9cc2e5e32f43b8ababc55fb8ab",
      "from_purse": "uref-faf8e43069a7551cbb0594dd1f93396cf204e80b59886129d3476bf3319d7aef-007",
      "id": null,
      "initiator_account_hash": "d65804fef96e8c4294c7a95daf5c7dd219f19f08e2613418b453b08eb84364ab",
      "timestamp": "2021-09-16T16:06:16Z",
      "to_account_hash": null,
      "to_purse": "uref-faf8e43069a7551cbb0594dd1f93396cf204e80b59886129d3476bf3319d7aef-007",
      "to_purse_public_key": "01f25c7f82f8bf57b195f18412f9c13b239e95b007eb226f559f8320f3acffac7c",
      "transform_key": "213bd956791dd9be048bd20b793a277d5807682bb1fa827e344cbe1ad2a3cc53"
    }
  ],
  "item_count": 1,
  "page_count": 1
}

Note the to_purse_public_key property that was added in the second response. It contains the public key that corresponds to the account having the to_purse as its main purse. Please check Transfer Optional Properties to learn about all the optional data that can be included in the Transfer API responses.

Last updated