R1 is responsible to create some service on the behalf of R2. (This can happens in case R1 is owning some resources that he can share with R2 after some agreement)
Once R1 created the service S1, R1 is the owner of the service and thus the only one to be able to manage it. But S1 is intended to be own be R2, so R1 needs a way to transfer the ownership of S1 from R1 to R2.
To do this securely, we can use a normal public key encryption flow:
R1 sends a request of transfer to R2. The request contains the address where R2 can reach R1 and the public key of R1.
R2 respond to the request transfer by sending it's own public key to R1 encrypted with the public key of R1
R1 receive the encrypted public key of R2, verify that it can decrypt it with its private key
R1 then encrypt the service S1 secret with the public key of R2 and send it to R2
Issue migrated from [https://api.github.com/repos/zero-os/0-robot/issues/268](), opened by @zaibon
Considering we have 2 robots, R1 and R2.
R1 is responsible to create some service on the behalf of R2. (This can happens in case R1 is owning some resources that he can share with R2 after some agreement) Once R1 created the service S1, R1 is the owner of the service and thus the only one to be able to manage it. But S1 is intended to be own be R2, so R1 needs a way to transfer the ownership of S1 from R1 to R2. To do this securely, we can use a normal public key encryption flow: