How to use the eth-crypto.createIdentity function in eth-crypto

To help you get started, we’ve selected a few eth-crypto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cryptoeconomics-study / code / ch1 / 1.5 / solutions / client.js View on Github external
constructor() {
    this.wallet = EthCrypto.createIdentity();
    // initialize the nonce
    this.nonce = 0;
  }
github cryptoeconomics-study / code / ch3 / nodeAgent.js View on Github external
constructor (wallet, genesis, network) {
    // Blockchain identity
    this.wallet = wallet
    // P2P Node identity -- used for connecting to peers
    this.p2pNodeId = EthCrypto.createIdentity()
    this.pid = this.p2pNodeId.address
    this.network = network
    this.state = genesis
    this.transactions = []
    this.invalidNonceTxs = {}
    this.nonce = 0
  }
github decentraland / explorer / kernel / packages / shared / session / sagas.ts View on Github external
async function createAuthIdentity() {
  const ephemeral = createIdentity()

  const ephemeralLifespanMinutes = 7 * 24 * 60 // 1 week

  let address
  let signer
  let hasConnectedWeb3 = false

  if (ENABLE_WEB3) {
    const result = await providerFuture
    if (result.successful) {
      const eth = Eth.fromCurrentProvider()!
      const account = (await eth.getAccounts())[0]

      address = account.toJSON()
      signer = async (message: string) => {
        let result
github cryptoeconomics-study / code / ch1 / 1.3 / Client.js View on Github external
constructor() {
    this.wallet = EthCrypto.createIdentity();
    // initialize the nonce
		// TODO
  }
github cryptoeconomics-study / code / c1_CentralPaymentOperator / paypalWithSigs.js View on Github external
/* Signed transaction format
tx = {
  contents: {
    type: string,  // either 'mint' or 'send'
    amount: int,   // some quantity of coins
    from: string,  // the address of the sender
    to: string,    // the address of the recipient
  },
  sig: string      // the signature of the sender
}
*/

var accounts = {
  'paypal': EthCrypto.createIdentity(),
  'aparna': EthCrypto.createIdentity(),
  'jing': EthCrypto.createIdentity()
}

var unsignedTxs = [
  {
    type: 'mint',
    amount: 100,
    from: accounts.paypal.address,
    to: accounts.paypal.address,
    nonce: 0
  },
  {
    type: 'send',
    amount: 65,
    from: accounts.paypal.address,
    to: accounts.aparna.address,
    nonce: 1
github cryptoeconomics-study / code / c3_ProofOfWork / proofOfWork.js View on Github external
constructor (wallet, genesis, network) {
    // Blockchain identity
    this.wallet = wallet
    // P2P Node identity -- used for connecting to peers
    this.p2pNodeId = EthCrypto.createIdentity()
    this.pid = this.p2pNodeId.address
    this.network = network
    this.state = genesis
    this.transactions = []
    this.blockchain = []    //longest chain
    this.allBlocks = []    //all blocks
    this.invalidNonceTxs = {}
    this.blockNumber = 0 //keep track of blocks added to blockchain despite getState()

    const genesisBlock = {
      nonce: 0,
      number: 0,
      coinbase: 0,
      difficulty: 9000,
      parentHash: 0,
      timestamp: 0,
github cryptoeconomics-study / code / ch1 / 1.2 / client.js View on Github external
constructor() {
    this.wallet = EthCrypto.createIdentity();
  }
github cryptoeconomics-study / code / ch1 / 1.2 / solution / Client.js View on Github external
constructor() {
        this.wallet = EthCrypto.createIdentity()
    }
github ShipChain / engine / src / entity / Wallet.ts View on Github external
static generate_identity() {
        return EthCrypto.createIdentity();
    }