Hey everyone, does anybody know if it is possible to “read” a raw-build transaction file?
Lets say I build a transaction (tx.raw) using the command-line-tool including inputs/outouts/certificates/etc. if i open the file I see a large hex-code which obviously is not human-readable. Any idea how I can make it human readable again?
Best
Maybe this will work, I didn’t use it but u can try
http://www.unit-conversion.info/texttools/hexadecimal/
Cheers,
unforunately doesn’t work at least for my tx-file
Perhaps u need to adapt it
for example:
48 65 6c 6c 6f 2c 0d 0a 0d 0a 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 6d 65 73 73 61 67 65 21 0d 0a 0d 0a
Or if u can identify the transaction ID u can search for details on cardano block explorer
A Block Explorer allows anyone to search addresses, transactions, epochs and slots that have taken place on a blockchain. IOHK has built the Cardano Block Explorer specifically for Cardano that all...
I just happen to come across a solution. Of course, the guys of iohk provide already a tool for it with cardano-cli. If you want to see the details of a previously build transaction tx.test
:
cardano-cli transaction build-raw \
--allegra-era \
--tx-in c2642218ef9c5b2bc1ef66bf27c37640c0dfd159a0274c8100c852ca0b03d484#1\
--tx-out addr1qxergj4s957mq7nz6eqw9wn0xp7tqtemhqvkaq07dzlgk7qv88n9r72kflhm2gcfkgg7dadfd057u2nh8tkxjyse0z0q94fv3q+0\
--ttl 25000000 \
--fee 0 \
--out-file tx.test
You can use the command-line-interface to convert the tx-file to a cbor output.
cardano-cli text-view decode-cbor --in-file <tx.raw>
the output should look like this:
82 # list(2)
a4 # map(4)
# key
00 # int(0)
# value
81 # list(1)
82 # list(2)
58 20 c2 64 22 18 ef 9c 5b 2b c1 ef 66 bf 27 c3
76 40 c0 df d1 59 a0 27 4c 81 00 c8 52 ca 0b 03
d4 84 # bytes(32)
01 # int(1)
# key
01 # int(1)
# value
81 # list(1)
82 # list(2)
58 39 01 b2 34 4a b0 2d 3d b0 7a 62 d6 40 e2 ba
6f 30 7c b0 2f 3b b8 19 6e 81 fe 68 be 8b 78 0c
39 e6 51 f9 56 4f ef b5 23 09 b2 11 e6 f5 a9 6b
e9 ee 2a 77 3a ec 69 12 19 78 9e # bytes(57)
00 # int(0)
# key
02 # int(2)
# value
00 # int(0)
# key
03 # int(3)
# value
1a 01 7d 78 40 # int(25000000)
f6 # null
I found a website which can convert the trasaction back to json, cbor.me
which will give you again
[
{0:
[
[h'C2642218EF9C5B2BC1EF66BF27C37640C0DFD159A0274C8100C852CA0B03D484',
1
]
],
1: [
[h'01B2344AB02D3DB07A62D640E2BA6F307CB02F3BB8196E81FE68BE8B780C39E651F9564FEFB52309B211E6F5A96BE9EE2A773AEC691219789E',
0
]
],
2: 0,
3: 25000000
},
null
]
If anybody has a better way please let me know. So far this is the only way I found.
Looking for the same thing. The text-view or json isn’t exactly human readable… You still have to known what each field means. I would love it if there’s some tool that add labels and formats this.
If you have eternl installed on chrome you could use the CIP30 api to have a preview:
await (await cardano.eternl.enable()).signTx('84a40081825820c8da3848010af1728d19555c9864dd4ace97ad56972b6bb352bbdc0f8ffb0d5200018282581d617a6a5ccbaf3e6308d8c09ccfa45b34cc7cccaa242dc2dc05ba2a72201a00d2eee782583901d07f6a9dc8cba4b368d04225c4cd36ce21b1800bc54e7924e65689d9ddbe7a587e6bdd2674bf53fc093226bbd43af035f4ea07d7811679661b000000037d3c3680021a0002b099031a047d9ea2a0f5f6', true)
1 Like