Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@identity.com/prove-ethereum-wallet
Advanced tools
Library for providing a standard proof creation and verification for ethereum wallets
Readme
This library proves ownership of an Ethereum wallet to off-chain verifiers. To create proof of ownership, a signing function must be provided that allows the user to sign some typed-data with their private key, thus proving they own the wallet. The verifier will check that the signature of the signer matches the wallet address to check, and that the contents of the signed typed-message are valid. The proof consists of a string of a base64 version of the message concatenated with a '.' and the base64 version of the signature.
npm install @identity.com/prove-ethereum-wallet
or
yarn add @identity.com/prove-ethereum-wallet
Prove ownership of an Ethereum wallet
Prover side:
const { create } = require('@identity.com/prove-ethereum-wallet');
const ownerWallet = Wallet.createRandom();
const proof = await create((domain, types, message) => wallet._signTypedData(domain, types, message), { message: '<verifierUrl>' });
Verifier side:
const { verify } = require('@identity.com/prove-ethereum-wallet');
const success = await verify(expectedOwnerAddress, proof, { message: '<verifierUrl>' });
The prove() function generates some typed-data, including an expiry timestamp and message and signs it with the wallet private key. For the transaction to be verified by the verify() function, it must:
The prove and verify functions can be configured as follows:
domain
Optionally set the domain for the signed dataOptional Default:
export const defaultDomain: TypedDataDomain = {
name: "Proof Of Ethereum Wallet Ownership",
version: "1",
};
types
Optionally set the types to be used in the signed dataOptional Default:
export const defaultTypes: Record<string, Array<TypedDataField>> = {
PoWo: [
{ name: "expires", type: "string" },
{ name: "message", type: "string" },
],
};
message
Optional Default: empty
The message passed to check against the proof. This would normally be a nonce, or single use message to prevent the POWO from being re-used in a replay-attack.
FAQs
Library for providing a standard proof creation and verification for ethereum wallets
We found that @identity.com/prove-ethereum-wallet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).