Question: Best Practice for Storing Temporary Keys for Escrow Contract #221
-
Hi - I am considering Celo for a project and the escrow contract is very appealing. I am wondering the best practice around storing temporary private keys. In a database? Any help is much appreciated! Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 5 replies
-
Adding a link to this question on Discord (for future reference). |
Beta Was this translation helpful? Give feedback.
-
It depends on how you are using the escrow contract and sharing keys. How are you sharing the key with users? How much value will be secured by these keys? It might be good to store the keys encrypted in a database so if they database gets compromised then the keys are safe. You'll need to be very careful with the decryption key(s), maybe use an HSM. |
Beta Was this translation helpful? Give feedback.
-
I pinged @isabellewei and she will get back to you asap. She will be best-placed to answer your question :) |
Beta Was this translation helpful? Give feedback.
-
Hi @jrweinb! Apologies that this isn't explained in the docs, but the new escrow flow in Valora no longer requires you to generate a temporary private key for the you can see the function that generates the paymentId: https://github.com/celo-org/wallet/blob/623bf8c483fb2fdcde6e6425070c021dfd8d3834/packages/mobile/src/escrow/utils.ts#L22-L37 and where it is used: https://github.com/celo-org/wallet/blob/623bf8c483fb2fdcde6e6425070c021dfd8d3834/packages/mobile/src/escrow/saga.ts#L154 |
Beta Was this translation helpful? Give feedback.
-
Quick ping because I transferred this discussion
to be more flexible in the types of discussions we have: Sorry for any inconvenience 🙏 |
Beta Was this translation helpful? Give feedback.
Hi @jrweinb! Apologies that this isn't explained in the docs, but the new escrow flow in Valora no longer requires you to generate a temporary private key for the
paymentId
and send it to the receiver. Instead, the phone hash and pepper is used to generate thepaymentId
. Instead of sending thepaymentId
to the invited user, when claiming escrowed transactions Valora uses their phone number to compute the paymentId, so the invited user just needs to download Valora and verify their numberyou can see the function that generates the paymentId: https://github.com/celo-org/wallet/blob/623bf8c483fb2fdcde6e6425070c021dfd8d3834/packages/mobile/src/escrow/utils.ts#L22-L37 and where it is used: ht…