calculate_dao_maximum_withdraw - Nervos

Calculates the maximum withdrawal one can get, given a referenced DAO cell, and a withdrawing block hash.


  • out_point - Reference to the DAO cell, the depositing transaction’s output.
  • kind - Two kinds of dao withdrawal amount calculation option.

Option 1, the assumed reference block hash for withdrawing phase 1 transaction, this block must be in the canonical chain, the calculation of occupied capacity will be based on the depositing transaction’s output, assuming the output of phase 1 transaction is the same as the depositing transaction’s output.

Option 2, the out point of the withdrawing phase 1 transaction, the calculation of occupied capacity will be based on corresponding phase 1 transaction’s output.


The RPC returns the final capacity when the cell out_point is withdrawn using the block hash or withdrawing phase 1 transaction out point as the reference.

In CKB, scripts cannot get the information about in which block the transaction is committed. A workaround is letting the transaction reference a block hash so the script knows that the transaction is committed at least after the reference block.



curl --location --request POST '' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": 42,
  "jsonrpc": "2.0",
  "method": "calculate_dao_maximum_withdraw",
  "params": [
      "index": "0x0",
      "tx_hash": "0x42e82575740ec53e0b52ce8a36e212ad62beb58d1beac997996363e0bfe3d9e5"


  "id": 42,
  "jsonrpc": "2.0",
  "result": "0x4a8b4e8a4"


The below parameter inputs do not work, please reference the section above instead.

Click Try It! to start a request and see the response here!