There is scriptSig and scriptPubKey. And when you provide scriptPubKey you provide your public key and some opcodes are added. But when you provide scriptSig what do you sign? What data you sign when spending your bitcoins: all data for the locked output or all data in new input? Just a little confused about the principle of the algorithm and how it works technically