These docs are for v1.9. Click to read the latest docs for v2.1.

Manage Digital Passport Transferability

Before you begin

As a brand, you wish to disable the transferability of an digital passport.

To manage digital passport access, Arianee defines different tokenType:

  • 0 - viewKey: Allows to display digital passport.
  • 1 - requestKey: Allows to claim digital passport.
  • 2 - proofKey: Allows to generate a proof of ownership on-chain. [Ne pas le mettre si on veut plus générer de proof on chain?]

Let's start 🚀

To disable the transferability of a specific digital passport, let's focus on the requestKey. Use /api/contracts/smartAssetContract/addTokenAccess/send.

InputMandatoryTypeDescription
tokenIdNumberDigital passport identification number
tokenAccessStringWallet address generated through the passphrase.*
tokenTypeStringType of key.
- 0 - viewKey
- 1 - requestKey
- 2 - proofKey
-Booleantrue: The token will be transferable.
false: The transfer will be disabled.
[
  "90587067",
  "0x0000000000000000000000000000000000000000", 
  false,
  1  
]

Result: The digital passport cannot be claimed anymore.

{
    "message": "Not yet in blockchain => transaction saved in transaction manager",
    "type": "transactionManager",
    "nonce": 61852,
    "chainId": 77,
    "from": "0x305051e9a023fe881EE21cA43fd90c460B427Caa",
    "data": "0xb71c34d50000000000000000000000000000000000000000000000000000000005663fbb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
    "to": "0x512C1FCF401133680f373a386F3f752b98070BC5",
    "gasLimit": 500000,
    "gasPrice": "72000000000",
    "value": "0x00",
    "readableTransaction": {
        "contractName": "smartAsset",
        "from": "0x305051e9a023fe881EE21cA43fd90c460B427Caa",
        "to": "0x512C1FCF401133680f373a386F3f752b98070BC5",
        "constant": false,
        "inputs": [
            {
                "name": "_tokenId",
                "type": "uint256"
            },
            {
                "name": "_key",
                "type": "address"
            },
            {
                "name": "_enable",
                "type": "bool"
            },
            {
                "name": "_tokenType",
                "type": "uint256"
            }
        ],
        "name": "addTokenAccess",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function",
        "signature": "0xb71c34d5",
        "arguments": [
            {
                "value": "90587067",
                "name": "_tokenId"
            },
            {
                "value": "0x0000000000000000000000000000000000000000",
                "name": "_key"
            },
            {
                "value": false,
                "name": "_enable"
            },
            {
                "value": 1,
                "name": "_tokenType"
            }
        ]
    }
}

tokenAccess

The Arianee SDK provides a convenient way to generate a tokenAccess.

Before generating a tokenAccess, you need to have a passphrase. This passphrase is required to instantiate a wallet, which in turn serves as the source for creating the private key associated with the tokenAccess.

const tmpWallet = Core.fromPassPhrase('mypassphrase');
const tokenAccess = tmpWallet.getAddress(); //0x008B4B0fa3ee2DB07848941998DAABC1D11480fe