2

How can I get transaction ring members using the monerod RPC methods?

2

First call get_transactions then translate the key_offsets and call get_outs.

For example, let's decode the ring members for the second input of this tx:

curl -sd '{"txs_hashes":["329c12515493165e5580cf5541d429ca3f59d7ac949ba918c0f84af9450f13a8"],\
  "decode_as_json":true}' http://localhost:18081/get_transactions

You can extract the key_offsets from get_transactions:

key_offsets: [ 18763375, 1355999, 49546, 5266, 1370, 14093, 15945, 6499, 3974, 636, 1119]

Which get translated to:

18763375, 20119374, 20168920, 20174186, 20175556, 20189649, 20205594, 20212093, 20216067, 20216703, 20217822

(each is the sum of the previous offsets)

Then call get_outs:

curl -sd '{"outputs":[{"index":18763375},\
  {"index":20119374},{"index":20168920},\
  {"index":20174186},{"index":20175556},\
  {"index":20189649},{"index":20205594},\
  {"index":20212093},{"index":20216067},\
  {"index":20216703},{"index":20217822}]}' http://localhost:18081/get_outs

Which returns the public keys:

{
  "credits": 0,
  "outs": [{
    "height": 2136433,
    "key": "fa78cea6203fe2093f8227bc70178752e6f980e74f97151f20e7a758c2993b4e",
    "mask": "0465b14419742fddd320c44165e8f62dfcbf7521baf35f08c8c11de0a669f651",
    "txid": "0000000000000000000000000000000000000000000000000000000000000000",
    "unlocked": true
  },{
    "height": 2171860,
    "key": "eb0ff1ffc50228a7858e45d2414030d3b76bc7a511f9148c67b07778b9b0c536",
    "mask": "48a1dfd783515eaa151482a8ec05b8cc544e89dd42ea7a238fd4fe757d437b7d",
    "txid": "0000000000000000000000000000000000000000000000000000000000000000",
    "unlocked": true
  }, etc etc {
    "height": 2173803,
    "key": "29e072904dda63d2837753ab56f9079e60d74b68ce8d3af4a3c9bd0338f7427a",
    "mask": "456d63570d1fd3ca38ba712e6f84cd20d1344d59b46077663dce6b1c4f383c43",
    "txid": "0000000000000000000000000000000000000000000000000000000000000000",
    "unlocked": true
  }],
  "status": "OK",
  "top_hash": "",
  "untrusted": false
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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