hexresearch / hschain-utxo

UTXO-based contracts for hschain
0 stars 0 forks source link

Bitcoin style signatures #176

Closed anton-k closed 3 years ago

anton-k commented 3 years ago

Adds bitcoin style signatures. Two primitives are implemented:

checkSig :: Text -> Int -> Bool
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.