Skip to main content

ConsenSys Rollups API methods

pazkp_createAccount

Creates an account on the rollup.

info

You need to wait for the account to be finalized on the blockchain before creating money orders.

Use pazkp_findAccountByPublicKey to obtain the account ID and determine whether the account is ready to use.

Parameters

  • publicKey: string - 64-byte account public key

  • jointEncryptionKey: string - 128-byte encryption key based on the user's public key and operator's public key assembled using the ConsenSys Rollups cryptographic library

  • blindingFactor: string - 32-byte blinding factor for obfuscation

  • encryptedBlindingFactor: string - blinding factor encrypted using jointEncryptionKey

  • randomizationFactor: string - value produced during encryption used to check whether data has been encrypted correctly

  • signature: string - 96-byte account signature

Returns

result: object - account creation details

  • status: string - account creation status, for example REGISTERED; otherwise an error, for example PUBLIC_KEY_ALREADY_EXISTS
curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_createAccount","params":["0x0ec2cd6bb8213dbe3de41dc828f54a5cf2cc8127533899d70ad8cb6d915efd97167698318dd99feeeb6ff9c2b06bc85fa2f22c596f3782b63d99bd6553d34542","0x018bfd3d600db9f51f5e69d30144051c22f624b96455c1ac891362d3dd9c265b21d476dc08d1a79de4b73b8fce6f9c3bd2f6a195e2b363bcd7e069f439f56443018bfd3d600db9f51f5e69d30144051c22f624b96455c1ac891362d3dd9c265b21d476dc08d1a79de4b73b8fce6f9c3bd2f6a195e2b363bcd7e069f439f56443","0x0d5c179267be7695e3aeef4249b4bb845e904d188c64fc07b41c5bb4b529db03","0x0000000000000003024362050bdb3c6f511b07639ff6425009fc6b7665d34966a71790c38de7ba2c2325ead882e7ef4a174c63d3f03844296844177e885d6969980d0a354f7922462a3d4299f0053fd6859a1279813bf008c1920da7de9f9c757b9f56f793cb611b113430f9039e3018985cefac7683010c2f520f52621f171a6a097f7e0fc863e72a3d4299f0053fd6859a1279813bf008c1920da7de9f9c757b9f56f793cb611b113430f9039e3018985cefac7683010c2f520f52621f171a6a097f7e0fc863e700000000000000012854d1f8a4c50d92e2b66e21636d55059ee6b812bac2a751e1254ad72d7315e9","0x0b94aeab3040a0e7f5670d413751fe0c38ec52b2e5ffee938f07c16765c08559","0x1efe34e4c66965b07c80547e420903f6e143763b36e95090c3e4a4e55a354b761ce3628ab45abe232b742058ad47a7b694efbd0e791601954a1dd2017f67b9a60347d80317ac0191f79e7c5780de632d92c2c1a7772a1db48d343e9639ad34f2"],"id":0}' <IP>:<PORT>

pazkp_createMoneyOrder

Creates a money order to transfer an amount between two accounts. Both accounts must be in the rollup.

Parameters

  • fromAccountId: integer - 32-bit account ID of the sender

  • toAccountId: integer - 32-bit account ID of the receiver

  • tokenId: integer - token type ID

  • amount: integer - token amount for the transaction

  • blindingFactor: string - 32-byte blinding factor for obfuscation

  • encryptedMoneyOrder: string - money order redemption encrypted using the receiver's jointEncryptionKey

  • randomizationFactor: string - value produced during encryption used to check whether data has been encrypted correctly

  • nonce: integer - nonce of the most recent account operation

  • signature: string - signature of sender's account

Returns

result: object - money order creation details

  • operationHash: string - hash of the operation
curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_createMoneyOrder","params":[0,1,0,100,"0x22879dd7ce3e297b879a52225026f256d8758bb700c40d53b769472218cfe740","0x000000000000000510c380d46202de6b88ccac3a89918f5a64691fc6ab638e200d81687856413bea304d894c75e86a57d7cf237d4eb6bd89036ef8db6b7fadcd8a274cce3cb3cea40edec9cf26b591e617223be7737d4851583772a34107c5e8063868731a56b0dc1bea0fa146e057a9ab260f58cd3364e1e1dd1c939a45e38b948801ca778bf5890edec9cf26b591e617223be7737d4851583772a34107c5e8063868731a56b0dc1bea0fa146e057a9ab260f58cd3364e1e1dd1c939a45e38b948801ca778bf5890edec9cf26b591e617223be7737d4851583772a34107c5e8063868731a56b0dc1bea0fa146e057a9ab260f58cd3364e1e1dd1c939a45e38b948801ca778bf5890edec9cf26b591e617223be7737d4851583772a34107c5e8063868731a56b0dc1bea0fa146e057a9ab260f58cd3364e1e1dd1c939a45e38b948801ca778bf58900000000000000020d31b221072da2c8d0617ed83c97d1a23121ba670f3a907e7025cdc639aac2a60c55f160c2fd8a9308c494ab4405605554cae3b9fb0ee451928e85dc2e9b1974","0x104e6481626a5faaf4bc1491270ba50d131ff8f1c40b981d152f89e3cfd167b9",1,"0x1a79b79570157ee66af363c838018faa920c0b2e035091902ceff2963c1766b42082c4bb5f7641ea90d196406e45b1548a91ac4eaa580bb554a88e2ee36d4e8a03a50ef82c307aa57caf90d5fbf231c3c7e9242e7da2c2bffe5b13f3575ec653"],"id":30}' <IP>:<PORT>

pazkp_createOutboundTransfer

Creates an outbound transfer to move an amount between a rollup account and an Ethereum address.

Parameters

  • fromAccountId: integer - 32-bit account ID of the sender

  • toEthereumAddress: integer - 20-byte Ethereum address of the receiver

  • tokenId: integer - token type ID

  • amount: integer - token amount for the transaction

  • nonce: integer - nonce of transaction

  • signature: string - signature of sender's account

Returns

result: object - outbound transfer details

  • operationHash: string - hash of the operation
curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_createOutboundTransfer","params":[1,"0x0f38616f3f7ca7316aceea7adb3fd53fa2527026",1,5,5,"0x28cc754c9587098274ff9936b3496b6d00bba7eab79bbb72b50804d5a1a5715b2cddca0d2a25e0d203e9d0a1b1fb2c0952d7ffc28affb843b6b36ffd37d863ad01d9c94ca421176eca05f2bee506a913a7040ee120613f18127d80262f74c751"],"id":89}' <IP>:<PORT>

pazkp_findAccountById

Returns the public details of an account.

Parameters

  • accountId: integer - account ID

Returns

result: object - account details

  • id: integer - account ID

  • publicKey: string - 64-byte account public key

  • jointEncryptionKey: string - 128-byte encryption key based on the user's public key and operator's public key assembled using the ConsenSys Rollups cryptographic library

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findAccountById","params":[0],"id":10}' <IP>:<PORT>

pazkp_findAccountByPublicKey

Returns the public details of an account, including the account ID. You need the account ID to create a money order.

Parameters

  • publicKey: string - 64-byte account public key

Returns

result: object - account details

  • id: integer - account ID

  • publicKey: string - 64-byte account public key

  • jointEncryptionKey: string - 128-byte encryption key based on the user's public key and operator's public key assembled using the ConsenSys Rollups cryptographic library

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findAccountByPublicKey","params":["0x0ec2cd6bb8213dbe3de41dc828f54a5cf2cc8127533899d70ad8cb6d915efd97167698318dd99feeeb6ff9c2b06bc85fa2f22c596f3782b63d99bd6553d34542"],"id":26}' <IP>:<PORT>

pazkp_findMoneyOrderCreation

Returns a specific money order for which you are the issuer.

Parameters

  • operationHash: integer - hash of the operation

Returns

result: object - money order creation details

  • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

  • nonce: integer - transaction nonce

  • status: string - status of the money order, for example PENDING or EXECUTED

  • rejectionReason: string - rejection reason details, when status of the money order is REJECTED

  • operationHash: string - hash of the operation

  • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch.

  • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

  • batchStateRootHash: string - rollup rootHash that corresponds to the batch in which the money order was included

  • blockNumber: integer - Ethereum block number in which the batch was included in the rollup smart contract

  • blockHash: string - Ethereum block hash in which the batch was included

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findMoneyOrderCreation","params":[0,"0x24b2e10dade2ef8e3732003490121c1f0ef9b174095a2318ef2fa8cad9dc9885"],"id":128}' <IP>:<PORT>

pazkp_findMoneyOrderRedemption

Returns a specific money order submitted for redemption.

Parameters

  • operationHash: integer - hash of the operation

Returns

result: object - money order redemption details

  • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

  • nonce: integer - transaction nonce

  • status: string - status of the money order, for example PENDING or EXECUTED

  • rejectionReason: string - rejection reason details, when status of the money order is REJECTED

  • operationHash: string - hash of the operation

  • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

  • merkleProof: array - merkle proof of the account in the merkle tree

  • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

  • batchStateRootHash: string - rollup rootHash that corresponds to the batch in which the money order was included

  • blockNumber: integer - Ethereum block number in which the batch was included in the rollup smart contract

  • blockHash: string - Ethereum block hash in which the batch was included

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findMoneyOrderRedemption","params":[1,"0x105cbc9a6c55a5a525c81993a1a3f6c0d0b9786a38a76b63f5e6652423c946f2"],"id":70}' <IP>:<PORT>

pazkp_findOutboundTransfer

Returns a specific outbound transfer.

Parameters

  • operationHash: integer - hash of the operation

Returns

result: object - money order redemption details

  • fromAccountId: integer - 32-bit account ID of the sender

  • toEthereumAddress: string - 20-byte Ethereum address of the receiver

  • tokenId: integer - token type ID

  • amount: integer - token amount for the transaction

  • status: string - status of the money order, for example PENDING or EXECUTED

  • rejectionReason: string - rejection reason details, when status of the money order is REJECTED

  • operationHash: string - hash of the operation

  • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

  • batchStateRootHash: string - rollup rootHash that corresponds to the batch in which the money order was included

  • blockNumber: integer - Ethereum block number in which the batch was included in the rollup smart contract

  • blockHash: string - Ethereum block hash in which the batch was included

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findOutboundTransfer","params":[1,"0x12fb7a82834dfcb8c8e4c82b34744c92abbf74e3f53106590fe55025c4578e57"],"id":98}' <IP>:<PORT>

pazkp_findReceivedMoneyOrder

Returns a specific money order that is either available to redeem or has been redeemed.

Parameters

  • accountId: integer - account ID

  • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

Returns

result: object - received money order details

  • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

  • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

  • merkleProof: array - merkle proof of the account in the merkle tree

  • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_findReceivedMoneyOrder","params":[1,65536],"id":121}' <IP>:<PORT>

pazkp_getAccountNonce

Returns the most recent nonce and redemption index for the account.

Parameters

  • accountId: integer - account ID

Returns

result: object - account state details:

  • id: string - account ID

  • nonce: integer - nonce of the most recent account operation

  • redemptionIndex: string - redemption index of the most recent redeemed money order

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_getAccountNonce","params":[0],"id":6}' <IP>:<PORT>

pazkp_getAccountState

Returns the latest finalized account state on the blockchain.

Parameters

  • accountId: integer - account ID

Returns

result: object - account state details:

  • id: string - account ID

  • publicKey: string - account public key

  • jointEncryptionKey: string - 128-byte encryption key based on the user's public key and operator's public key assembled using the ConsenSys Rollups cryptographic library

  • blindingFactor: string - 32-byte blinding factor for obfuscation

  • nonce: integer - nonce of the most recent account operation

  • redemptionIndex: string - redemption index of the most recent redeemed money order

  • balances: object - map of the token balance for each token index

  • rootHash: string - root hash of the account in the merkle tree

  • merkleProof: array - merkle proof of the account in the merkle tree

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_getAccountState","params":[0],"id":27}' <IP>:<PORT>

pazkp_listMoneyOrderCreations

Lists all money orders for which you are the issuer.

Parameters

Important

Use null if you don't want to specify a value for an optional parameter.

  • nonce: integer - transaction nonce

  • softLimit: integer - maximum number of results to return

  • fromAccountId: integer - 32-bit account ID of the sender

  • toAccountId: integer - (optional) 32-bit account ID of the receiver

  • status: string - (optional) status of the money order

  • minAmount: integer - (optional) filter results by the minimum transaction value

  • maxAmount: integer - (optional) filter results by the maximum transaction value

Returns

result: object - money order details:

  • hasMoreResults: boolean - true if there are more results available which haven't been displayed

  • items: array of objects - money order creation records:

    • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

    • nonce: integer - transaction nonce

    • status: string - status of the money order, for example PENDING or EXECUTED

    • rejectionReason: string - rejection reason details, when status of the money order is REJECTED

    • operationHash: string - hash of the operation

    • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

    • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_listMoneyOrderCreations","params":[0,10,0,null,null,null,null],"id":107}' <IP>:<PORT>

pazkp_listMoneyOrderRedemptions

Lists money orders submitted for redemption.

Parameters

Important

Use null if you don't want to specify a value for an optional parameter.

  • nonce: integer - transaction nonce

  • softLimit: integer - maximum number of results to return

  • fromAccountId: integer - (optional) 32-bit account ID of the sender

  • toAccountId: integer - (optional) 32-bit account ID of the receiver

  • status: string - (optional) status of the money order

  • minAmount: integer - (optional) filter results by the minimum transaction value

  • maxAmount: integer - (optional) filter results by the maximum transaction value

Returns

result: object - money order details:

  • hasMoreResults: boolean - true if there are more results available which haven't been displayed.

  • items: array of objects - money orders submitted for redemption:

    • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

    • nonce: integer - transaction nonce

    • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

    • operationHash: string - hash of the operation

    • status: string - status of the redemption, for example EXECUTED or PENDING

    • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_listMoneyOrderRedemptions","params":[3,2,null,1,null,null,null],"id":133}' <IP>:<PORT>

pazkp_listMoneyOrdersReceived

Lists money orders available to redeem that are already finalized on the blockchain.

Parameters

Important

Use null if you don't want to specify a value for an optional parameter.

  • fromMoneyOrderTotalIndex: integer - starting index for the money order batch

  • softLimit: integer - maximum number of results to return

  • fromAccountId: integer - (optional) 32-bit account ID of the sender

  • toAccountId: integer - 32-bit account ID of the receiver

  • status: string - (optional) status of the money order. Valid options are AVAILABLE_TO_REDEEM and REDEEMED

  • minAmount: integer - (optional) filter results by the minimum transaction value

  • maxAmount: integer - (optional) filter results by the maximum transaction value

Returns

result: object - money order details:

  • hasMoreResults: boolean - true if there are more results available which haven't been displayed.

  • items: array of objects - money orders available to redeem:

    • moneyOrder: object - object containing the fromAccountId, toAccountId, tokenId, amount, and blindingFactor

    • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

    • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_listMoneyOrdersReceived","params":[0,10,null,1,null,null,null],"id":111}' <IP>:<PORT>

pazkp_listOutboundTransferCreations

Lists all outbound transfers for which you are the sender.

Parameters

Important

Use null if you don't want to specify a value for an optional parameter.

  • nonce: integer - transaction nonce

  • softLimit: integer - maximum number of results to return

  • fromAccountId: integer - 32-bit account ID of the sender

  • toEthereumAddress: integer - (optional) 32-bit account ID of the receiver

  • status: string - (optional) status of the outbound transfer

  • minAmount: integer - (optional) filter results by the minimum transaction value

  • maxAmount: integer - (optional) filter results by the maximum transaction value

Returns

result: object - outbound transfer details:

  • hasMoreResults: boolean - true if there are more results available which haven't been displayed

  • items: array of objects - outbound transfer records:

    • fromAccountId: integer - 32-bit account ID of the sender

    • toEthereumAddress: integer - 20-byte Ethereum address of the receiver

    • tokenId: integer - token type ID

    • amount: integer - token amount for the transaction

    • nonce: integer - transaction nonce

    • operationHash: string - hash of the operation

    • status: string - status of the outbound transfer, for example PENDING or EXECUTED

    • rejectionReason: string - rejection reason details, when status of the outbound transfer is REJECTED

    • batchHeight: integer - unique batch index in the rollup that contains the transaction, following ascending ordinal numbering

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_listOutboundTransferCreations","params":[0,1,1,null,null,null,null],"id":102}' <IP>:<PORT>

pazkp_redeemMoneyOrder

Opens a money order and claim the funds locked within.

Parameters

  • fromAccountId: integer - 32-bit account ID of the sender

  • toAccountId: integer - 32-bit account ID of the receiver

  • tokenId: integer - token type ID

  • amount: integer - token amount for the transaction

  • blindingFactor: string - 32-byte blinding factor for obfuscation.

  • moneyOrderTotalIndex: integer - 6 byte integer where 4 bytes contain the money order batch ID of the money order batch, and 2 bytes are for the index of the money order in the batch

  • nonce: integer - transaction nonce

  • encryptedMoneyOrderRedeem: string - money order redemption encrypted, using the receiver's jointEncryptionKey

  • randomizationFactor: string - value produced during encryption used to check whether data has been encrypted correctly

  • signature: string - signature of sender's account

  • merkleProof: string - Merkle Proof connecting the money order hash to the batch root hash

Returns

result: object - money order redemption details

  • operationHash: string - hash of the operation

curl HTTP request

curl -X POST --data '{"jsonrpc":"2.0","method":"pazkp_redeemMoneyOrder","params":[0,1,0,100,"0x22879dd7ce3e297b879a52225026f256d8758bb700c40d53b769472218cfe740",65536,1,"0x0000000000000003209096e27e1265ebc551c57833fddf8486cc57e24b76e982b071d07a8b2acec0078f69d2562aecf40d2e364607e14aa8b71bb642605d31b1bd396c9ca054e7df1d0a7c98d9976930a77a66e1678cefacac54e625122dbeb7c662ae366df31eab136af2e3db6fa5981ea564d6ea39a385a3a13e970720d1424e4fe358bca18af61d0a7c98d9976930a77a66e1678cefacac54e625122dbeb7c662ae366df31eab136af2e3db6fa5981ea564d6ea39a385a3a13e970720d1424e4fe358bca18af6000000000000000110683825db0f0dc939f4ecf23f57779ef81ab61e7186765c742a53c996dd1710","0x28787ac1792dd7e92089fa7f64e6f852785008284986b93a6257d0e3725f8744","0x1b20db3c09b5e26fd1d8e9b2061f02d6d3ca9b5f9cfd12642e774b3f2bafa9322b16fb351a58b63f0c8e011a206bb6cce49e8671a5d92c76206bbe2ba3a14f08035848e2723f5d4dfe30fbdd53346ab93bb6f843aa51dc803cde4131313c4f08",null],"id":61}' <IP>:<PORT>

JSON result

{
"jsonrpc": "2.0",
"id": 61,
"result": {
"operationHash": "0x105cbc9a6c55a5a525c81993a1a3f6c0d0b9786a38a76b63f5e6652423c946f2"
}
}