tweag / cooked-validators

MIT License
39 stars 11 forks source link

Transaction signers described at different levels #180

Closed carlhammann closed 1 year ago

carlhammann commented 1 year ago

At the moment, there are two ways to specify the signers of a transaction, the SignedBy constraint and the mechanisms of MonadMockChain, namely signingWith. At first, the two seem redundant, but as far as I understand, they are there for different reasons:

Another distinction is when the signatures are needed. As far as I understand it:

Are my comments above accurate?

mmontin commented 1 year ago

I think you explained the distinction between the two very well. The way I see it is that singingWith brings in scope wallets which can then be used in SignedBy, in addition to be used for collaterals and reimbursements. This is very confusing though and can be the subject to many errors and misinterpretations. I am wondering if we could make it clearer. A way would be to automatically propagate the list of signatories at the MockChain level to actual signatories in the sent transaction, but I don't know if that is 100% sound.

0xd34df00d commented 1 year ago

I think it's related to your second bullet, but it's worth pointing out explicitly: if a transaction doesn't have a SignedBy constraint with a given key, then the outside world (including scripts etc) won't be able to see that it has been actually signed by this key. That is, according to my understanding, which very well might be incomplete.