Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added wallet cache #477

Merged
merged 9 commits into from
Dec 13, 2024
Merged

feat: Added wallet cache #477

merged 9 commits into from
Dec 13, 2024

Conversation

macterra
Copy link
Collaborator

@macterra macterra commented Dec 11, 2024

To enable the wallet cache, set KC_WALLET_CACHE=true in your .env. This applies to the CLI and to keymaster-api.

Benchmarks to create 20 credentials using ./kc perf-test 20

benchmarks unencrypted encrypted
no cache 1.4s 63.2s
with cache 1.3s 4.7s

With unencrypted wallets, the cache has little effect (as expected). With encrypted wallets the cache make credential issuance substantially faster (at the expense of keeping the private keys in memory so there is a security trade off to consider here).

If the wallet cache is used, and the deployment scenario has multiple services using the same wallet, then they should be configured to have keymaster-api be the interface to the wallet, and the rest should be configured to use keymaster-api. To that end, the satoshi-mediator was refactored to use keymaster SDK so that there is no contention for the wallet.

Likewise, if you use the CLI you should set KC_KEYMASTER_URL=http://localhost:4226 in your .env so it uses the REST API.

@macterra macterra linked an issue Dec 11, 2024 that may be closed by this pull request
@macterra macterra marked this pull request as draft December 11, 2024 15:33
@macterra macterra requested a review from Bushstar December 11, 2024 18:33
@macterra macterra marked this pull request as ready for review December 11, 2024 18:33
Bushstar
Bushstar previously approved these changes Dec 12, 2024
@macterra macterra merged commit e81f71c into main Dec 13, 2024
9 checks passed
@macterra macterra deleted the 475-encrypted-wallet branch December 13, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encrypted wallet performance
2 participants