pyring icon indicating copy to clipboard operation
pyring copied to clipboard

Deterministic public keys while signing?

Open desertkun opened this issue 3 years ago • 0 comments

As part of my blockchain project, I am trying to store a generated ring signature on a chain. Every public key exists on the same blockchain before, but the idea is to hide whoever signed the message from a particular group. Because of the blockchain nature, the order of the public keys is going to be deterministic.

ring_sign doc says

key_index: The index to the corresponding public key. Note that they key index should be unpredictable; shuffle the public keys before generating the ring signature if this is not the case.

Does that still imply that I am good to go with generation of public keys order just from the history of previous records?

Pseudo code:

public_keys = get_public_keys(blockchain)  # deterministic
index = public_keys.index(me)
signature = ring_sign(message, public_keys, index)
...
# later on from an observer that verifies the chain
rign_verify(message, public_keys)  # index is not known here

Since from the observer perspective, the keys are ordered as they're added to the chain, and not clear what index has been used, am I good to go? Or do I have to shuffle the keys and store shuffled public keys as part of signature? I am reluctant of doing that because it's just redundant info since public keys already present.

Thanks.

desertkun avatar Jul 04 '22 21:07 desertkun