dashhive / DashTx.js

Create TX hex for payments and such
MIT License
3 stars 0 forks source link

All the SigHash stuff needs to be refactored. #54

Closed coolaj86 closed 5 months ago

coolaj86 commented 6 months ago

Now that we understand what the SigHashType actually means, we need to clean that code up.

I suggest:

- Tx.createHashable()
- Tx.hashPartial()
- Tx._hash()
+ txSigHashInfo.inputs = Tx.createSigHashInputs(inputs, sigHashType)
+ txSigHashInfo.outputs = Tx.createSigHashOutputs(outputs, sigHashType);
+ let txSigHashHex = Tx.packSigHashTx(txSigHashInfo, sigHashType); 
+ let txSigHashBytes = Tx.utils.hexToBytes(txSigHashHex);
+ let sigBytes = Tx.doubleSha256(txSigHashBytes);
coolaj86 commented 5 months ago

Part of #60 (and prior PRs)