🔌 Available Routes
set_data
​
Sets data in the Redis instance and marks it for pending retrieval in the server. To send data to Bob, we could use the following headers in the set_data
call:
{
"address": "76e...dd6", // Bob's public key address
"public_key": "a4c...e45", // Alice's public key
"signature": "b9f...506" // Alice's signature of Bob's address, using his public key
}
The body of the set_data
call would contain the data being exchanged:
{
"data": "hello Bob"
}
The headers that Alice sends in her call will be validated by the Valence, after which they'll be stored at Bob's address for his later retrieval using the get_data
call.
get_data
​
Gets pending data from the server for a given address. To retrieve data for Bob, he only has to supply his credentials in the call header:
[
{
"address": "76e...dd6", // Bob's public key address
"signature": "b9f...506", // Bob's signature of the public key
"public_key": "a4c...e45" // Bob's public key corresponding to his address
}
]
Again, the Valence will validate the signature before returning the data to Bob.
For best practice, it's recommended that Alice and Bob encrypt their data using their private keys, before exchanging it with each other. This ensures that the data exchange is E2E encrypted, and that the Valence maintains no knowledge of the data's content.