title: i am trying to send a transaction but it throws an error
body: <p><strong>eror on terminal</strong></p>
  <pre><code> if (!cond) throw new Error(msg)
               ^
  
  Error: Expected private key to be an Uint8Array with length 32
  </code></pre>
  <p><strong>my Code</strong></p>
  <p>its about signing eror.
  I am absolutely lost as to why this is not working as I have copied every piece of code directly from the guide and now its not working.</p>
  <pre><code>const Web3 = require('web3')
  const Tx = require('ethereumjs-tx').Transaction
  const web3 = new Web3('http://127.0.0.1:8545')
  
  const account1 = '0x97F70e1a18B6237603e9382920C93853992ab174'
  const account2 = '0xA838152E5C21f8d3Df51f696431AEb1D3C2Ff2F7'
  
  const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1,'hex')
  const privateKey2 = Buffer.from(process.env.PRIVATE_KEY_2,'hex')
  
  const contractAddress = '0xd9145CCE52D386f254917e481eB44e9943F39138'
  const contractABI = //had to remove to be a shorten code
  var contract = new web3.eth.Contract(contractABI, contractAddress);
  const data = contract.methods.transfer(account2,20000).encodeABI();
  
  
  web3.eth.getTransactionCount(account1, (err, txCount) =&gt; {
  
  //create the transaction object
  const txObject = {
      nonce: web3.utils.toHex(txCount), 
      gasLimit:web3.utils.toHex(210000) ,
      gasPrice: web3.utils.toHex(web3.utils.toWei('10', 'gwei')),
      to: contractAddress,  
      data: data
  }
   
  //sign the transaction
  const tx = new Tx(txObject)
  tx.sign(privateKey1)
  
  const serializedTx = tx.serialize()
  const raw = '0x' + serializedTx.toString('hex')
  
  //broadcast the transaction
  web3.eth.sendSignedTransaction(raw, (err , txHash) =&gt;{
      console.log('err:', err , 'txHash:', txHash);
      //use this txHash to find contract on Etherscan!
  })
  })
  </code></pre>
  <p>thats it</p>