Skip to content

Azure key vault integration to secure Algorand mnemonic phrase and sign transactions securely from the keyvault

License

Notifications You must be signed in to change notification settings

gconnect/algorand-azure-keyvault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Azure Key Vault for Algorand Wallet Transactions using JavaScript

Azure Key Vault is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this tutorial, you create a key vault, then use it to store a secret and retrieve the secret to sign transactions on Algorand.

Setup Instructions

  • Create free or paid azure account

Screenshot 2022-03-25 at 05 49 52

  • Login in to the portal

Screenshot 2022-03-25 at 05 49 23

- Create resource group

Screenshot 2022-03-31 at 04 03 43

Screenshot 2022-03-31 at 02 41 00

Screenshot 2022-03-31 at 02 43 20

- Search for Key Vault

Screenshot 2022-03-17 at 02 54 16

  • Create Key Vault

Screenshot 2022-03-31 at 02 51 12

Screenshot 2022-03-31 at 03 03 23

Screenshot 2022-03-31 at 03 05 34

- Select and create secret

Screenshot 2022-03-31 at 03 06 05

Screenshot 2022-03-31 at 03 53 37

Screenshot 2022-03-31 at 03 53 28

Screenshot 2022-03-31 at 03 56 02

Code Structure

  • src/Transaction.js The code here handles connecting to the Algorand Purestake API client, creating a payment transaction, Signing the transaction with secret from Azure KeyVault.
  • src/VaultSecret.js This handles connecting to the azure identity and secret client and making a request to get the secret.
  • src/RecoverAccount.js This handles recovering of Algorand wallet using the secret from Azure KeyVault

NOTE Create .env file at the root of your project to store sensitive information. Your .env file should look like this. The value should not be quotted.

API_KEY = YOUR PURESTAKE API KEY
KEY_VAULT_URI = YOUR KEY VAULT URI
SECRET_NAME =   YOUR SECRET NAME
ALGOD_SERVER = https://testnet-algorand.api.purestake.io/ps2/
PORT = 

Dependencies

To install required dependencies do npm install

Run Code

NOTE Ensure you are logged in using the azure cli, to be able to access the secret before running the below code. To login to azure using the cli do az login. To run the below code ensure you are in the src folder.

  • To run the VaultSecret code run node VaultSecret.js
  • To run the transaction code run node Transaction.js
  • To run the recovery code run node RecoverAccount.js

License

Distributed under the MIT License. See for more information. LICENSE

Blog and Video Tutorial

For more detailed step by step guide checkout the blog post here. And here is the link to the youtube demo

Disclaimer

This project is not audited and should not be used in a production environment.

About

Azure key vault integration to secure Algorand mnemonic phrase and sign transactions securely from the keyvault

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published