pubkey/eth-crypto sits at 924 stars on GitHub, written primarily in JavaScript. Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Encrypts the message with the publicKey so that only the corresponding privateKey can decrypt it. Returns (async) the encrypted data as object with hex-strings.
Signs a raw transaction with the privateKey. Returns a Promise that resolves a serialized tx-string which can be submitted to the node.
const identity = EthCrypto.createIdentity();
const rawTx = {
from: identity.address,
to: '0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0',
value: new BN('1000000000000000000'),
gasPrice: 5000000000,
nonce: 0,
gasLimit: 21000
};
const signedTx = await EthCrypto.signTransaction(
rawTx,
identity.privateKey
);
console.log(signedTx);
// > '071d3a2040a2d2cb...'
// you can now send the tx to the node
const receipt = await web3.eth.sendSignedTransaction(signedTx);
txDataByCompiled()
Creates the data-string which must be submitted with an transaction to create a contract-instance.
const SolidityCli = require('solidity-cli');
// create compiled solidity-code
const compiled = await SolidityCli.compileCode(
'contract ExampleContract {...'
)[':ExampleContract'];
const createCode = EthCrypto.txDataByCompiled(
compiled.interface, // abi
compiled.bytecode, // bytecode
[identity.address] // constructor-arguments
);
// now you can submit this to the blockchain
const serializedTx = await EthCrypto.signTransaction(
{
from: identity.address,
nonce: 0,
gasLimit: 5000000,
gasPrice: 5000000000,
data: createCode
},
identity.privateKey
);
const receipt = await web3.eth.sendSignedTransaction(serializedTx);
calculateContractAddress()
Calculates the address for the contract from the senders address and the nonce, without deploying it to the blockchain.
// pre-calculate address
const calculatedAddress = EthCrypto.calculateContractAddress(
account.address, // address of the sender
3 // nonce with which the contract will be deployed
);
const rawTx = {
from: account.address,
gasPrice: parseInt(gasPrice),
nonce: 3,
data: compiled.code
};
const receipt = await state.web3.eth.sendTransaction(rawTx);
console.log(receipt.contractAddress === calculatedAddress);
// > true
hex compress/decompress
"Compress" or "decompress" a hex-string to make it smaller. You can either compress to utf16 which reduces the size to about 1/4, or to base64 which reduces the size to about 4/5. This is not a real compression, it just make your string smaller when you have to store it in utf-16 anyways.
How does pubkey/eth-crypto compare to other Security projects?
pubkey/eth-crypto is tracked by TopGit in the Security category, with 924 GitHub stars and written in JavaScript. Browse the Security topic page on TopGit to compare it against similar projects by stars and activity.
Is pubkey/eth-crypto open source?
Yes — pubkey/eth-crypto ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/pubkey/eth-crypto.
What else is in the Security space?
pubkey/eth-crypto is tracked by TopGit under the Security category, alongside 20 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is pubkey/eth-crypto?
pubkey/eth-crypto (pubkey/eth-crypto) is a JavaScript project on GitHub. From the project's own README: Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Where do I read more about pubkey/eth-crypto?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/pubkey/eth-crypto is the definitive source.
Why is pubkey/eth-crypto categorized under Security?
TopGit places pubkey/eth-crypto in the Security category based on its GitHub topics and description (tagged: "blockchain", "cipher", "dapp"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Want a second opinion on eth-crypto?
Ask an AI that can read this page — one click and you get its take on eth-crypto.