I have payment signing key and staking signing key of my wallet. How can I get transaction unspent outputs with cardano-cli/cardano-serialization-lib/pycardano.

I expect to get string like this 82825820eef507b798abbb8a1360efbd113f51eda22e2fbaae3cc32c78724c8644c164a40082583900756e62ff9667b187209b6fe1b577061491cf6f93a81e1f91741e2e3accb864ae67087f69bbd9ab74f71781d13ae40aab86e1de30ca7e21171a1dcd6500.

Thank you.

1 Answer 1


You don't need your payment signing key nor your staking signing key to get the list of UTxOs of any address, as this is public information. Though, you will need your spending private key to use a UTxO as input for a transaction.

With that said, you can get the list of UTxOs using function utxos from pycardano. Check the code here: https://github.com/cffls/pycardano/blob/22ab109fcfd75f4ba23d0aea620c09d92e1201c1/pycardano/backend/blockfrost.py#L111

What this function will do is to get the list of UTxOs using this Blockfrost API under the hood.

  • Thank you for reply, but this method returns this {'index': 1, 'transaction_id': TransactionId(hex='2a4c7fb343a525d6bd044dce725882eed41a1f20cad9fdc21855dbb250eec761')}, 'output': {'address': addr1q8r32a0d8a6lp6ycrd02g9j5xljnzqvx2mkntpg4lzd6zkcyvp55w2vasj3favjz3uqcccef4vhet3z29596j2lf6shscxdf4y, 'amount': 20099765, 'datum_hash': None}, and I expect exactly another value like in my topic.
    – Pavel R
    Jun 9, 2022 at 21:09
  • I am trying to automate the nft purchase process on jpeg.store. Purchase trx build request contains this value "collateral":["82825820733717b579bfdace...8eafb97d2e60b0951a004c4b40"]. But I have no idea how to get it.
    – Pavel R
    Jun 9, 2022 at 21:13
  • If I deserialize it from CBOR I will recive follow data [[h'0E5569B3E2A645A849E5DB422A86F4705E947A294DFB0E7D04D88A5162482428', 1], [h'01709C2F10828D291925C6887375E90289B001C1521DEB3D3AA2F779E6C0E49B65E74CDDEAADA2C3A37CDC01416A6269ADAF84D82F49DA3BD9', 14320544]]
    – Pavel R
    Jun 9, 2022 at 22:56
  • I don't know what is that value you are expecting really. Can you explain a little more where did you get that value from? Jul 10, 2022 at 2:30
  • I want to automate the purchase process on jpg.store and to build the transaction I need to send this data to the server. imgur.com/a/E5Nbr4R
    – Pavel R
    Aug 3, 2022 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.