Adds bitcoin style signatures. Two primitives are implemented:
checkSig verifies single signature. It takes in public key as text and index to the vector boxInputRef'sigs.
Yhis vector containds all signatures that are needed to spend the input.
checkSig :: Text -> Int -> Bool
checkMultiSig verifies multiple signatures. M out of N. The M is the first argument, total number of signatures
N is derrived from the length of the list of public keys which is the second argument. The last argument is list of indices
to the vector boxInputRef'sigs
checkMultiSig :: Int -> [Text] -> [Int] -> Bool
Why do we need to store the signatures in special vector? Why not to reuse ByteString arguments for this task?
We do it because we have to include arguments into sign message and we need to omit the signatures. Otherwise
it'is possible to screw up the TxId. we can make valid transaction by changing signatures and it will change the TxId
that is expected by the user.
Adds bitcoin style signatures. Two primitives are implemented:
checkSig
verifies single signature. It takes in public key as text and index to the vectorboxInputRef'sigs
. Yhis vector containds all signatures that are needed to spend the input.checkMultiSig
verifies multiple signatures. M out of N. The M is the first argument, total number of signatures N is derrived from the length of the list of public keys which is the second argument. The last argument is list of indices to the vectorboxInputRef'sigs
Why do we need to store the signatures in special vector? Why not to reuse ByteString arguments for this task? We do it because we have to include arguments into sign message and we need to omit the signatures. Otherwise it'is possible to screw up the TxId. we can make valid transaction by changing signatures and it will change the TxId that is expected by the user.