Map Signer Key to Reward Slots
sbond14 opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
I would like to be able to collect reward slots by the signer that that stacker is stacked to.
In my specific use case, I run a signer that is delegated to by Stacking DAO. Since they use the same POX address for delegations to multiple signers, it is currently impossible for me to determine which reward slots correspond to the STX stacked to my individual signer.
Describe the solution you'd like
An inclusion of a signer_key field in the response of the first 4 reward queries here https://docs.hiro.so/stacks/api/stacking-rewards. This mapping of (signer key -> reward slot) would likely need to be done at the application level in order to allow the API to query for it.
Describe alternatives you've considered
I have tried collecting these rewards by POX address, but since the same POX address is used on multiple signers, this doesn't allow me to query reward slots for a specific signer. I understand that rewards are earned by stackers (not signers), which is why only POX address is currently included, but the additional mapping of a signer key would be very useful to me to help monitor my individual signer processes.
@sbond14 actually, I think this (work-in-progress) PR in the stacks-core repo should meet your requirements:
Add RPC endpoint
/v3/signer/{signer_pubkey}/{reward_cycle}
that returns number of blocks signed by signer during given reward cycle
If so, please close this issue and watch that one instead. Thanks!
@diwakergupta that is not exactly what I am looking for. Your linked PR would return how many block were signed by the signer post-Nakamoto (which would be all blocks in the cycle in an ideal scenario)
What I am requesting is a way to tie reward slots to a signer.
Say a single stacker has 2 delegations to 2 separate signers, and uses the same POX address for both of them. The reward slots assigned to that stacker would be indistinguishable from each other. I would like the signer address which that delegation of STX is attached to to also be returned when querying for that reward slot.
Currently we only have /v3/stacker_set/{cycle_number} which returns the reward set and the list of signing keys and their total amount of signing weight. There is no API call though that maps a specific locked amount of stacks to an associated signer. You would have to search for the associated stack-stx and aggregate transactions to know. I don't think there is a reason to NOT provide this API call though or a link to the associated txid per signing key.