Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rumblefishdev/eth-signer-kms

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rumblefishdev/eth-signer-kms

Sign ethereum transaction/messages using KMS service from AWS

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
526
decreased by-23.21%
Maintainers
0
Weekly downloads
 
Created
Source

@rumblefishdev/eth-signer-kms

Web3 signer that derives address and signs transactions using AWS KMS.

Install

$ npm i @rumblefishdev/eth-signer-kms

Requirements

aws-sdk

In order to work properly AWS KMS managed key must be:

  • asymmetric
  • able to sign and verify
  • ECC_SECG_P256K1 specified

IAM permissions

Client using the library should have the following IAM permissions to the key that it uses:

  - Effect: Allow
    Action:
      - 'kms:Sign'
      - 'kms:GetPublicKey'
    Resource: !Ref KMSKeyArn

Usage

* Before use, make sure that AWS SDK is properly configured! Find out how to do it here.

KMSSigner is an ethers Signer instance that uses AWS KMS stored keys to sign ethereum transactions.

keyId can be obtained via KMS package of aws-sdk or directly via AWS console. https://github.com/ethereumjs/ethereumjs-monorepo

Parameters:

ParameterTypeDefaultRequiredDescription
keyIdstringnull[x]Key ID of AWS KMS managed private key
providerproviders.Providernull[x]Official doc
kmsInstanceAWS.KMSnew AWS.KMS()[ ]KMS instance from Official doc

Examples

KmsSigner
new KMSSigner(provider, keyId, kms)
await kmsSigner.signMessage(...)
await kmsSigner._signTypedData(...)
function getEthAddressFromKMS
await getEthAddressFromKMS(...)

Migration from v1.7.0 to v2.0.0:

KMSProvider class became KMSSigner, as its instance no longer creates provider but receives one in constructor.

That approach extracts provider dependency from the package and as a result makes it more flexible in terms of use and testing.

Version 1.7.0:

ParameterTypeDefaultRequiredDescription
keyIdstringnull[x]Key ID of AWS KMS managed private key
providerOrUrlstring/objectnull[x]Official doc
chainSettingsCommon{}[ ]Common object used to configure tx options. If chainId is not passed, it will be obtained automatically via eth_chainId. For details instructions please refer to Common and Tx official docs
shareNoncebooleantrue[ ]Official doc
pollingIntervalnumber4000[ ]Official doc

Credits:

@lucashenning @truffle team

FAQs

Package last updated on 02 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc