0

I have been playing around with state channels and am starting to see the power of signing information/transactions, but haven't got a completely clear idea of what I can do with them. I think I can do the following, and would really appreciate, clarification, extra thoughts, and where I am just plain ol' wrong!

  1. Signing a payment but not sending it to the blockchain, but instead sending it to someone else to then send to the blockchain.

The signed transaction acts like a cheque(GB)/check(US). I sign a payment, but instead of sending the data to the blockchain, can I send that to the person I owe money to, and they send it to the blockchain, and therefore they pay the transaction fee, a bit like how a state channel sends the signed message to the other party, without going via the blockchain at all.

  1. Signing a payment, but in doing so cancelling an old one.

Imagine I do the above, but then before the recipient of the signed transaction commits it to the blockchain, I owe them more money. So I sign a new transaction that is the total of the original + the new money I owe. Is there an implementation I can use to mean that the old transaction wouldn't work if they submit the new one (or vice versa?) - I'm vaguely thinking nonces/sequence numbers or something. I can't quite visualise it, but I know that with state channels for say a game of chess if I submit a move to the blockchain, I can't submit previous ones based on sequence number. What about future ones....? Any quirky approaches here?

  1. Paying the transaction fees on behalf of a signed transaction

If I sign a transaction but send it to someone else, rather than to the blockchain so they can submit it, who pays the transaction fee? The person who paid sent the transaction, or the person who signed the transaction?

  1. Signing a transaction to deploy a contract

Imagine I have a contract that hasn't been deployed to the blockchain. Someone else wants to submit it so that they are the contract owner. Can they sign a transaction that means that I can deploy that contract on their behalf? If so, whats the mechanism here? The benefit being they pay for the contract to be deployed, rather than me. Or is the only way, if I don't have their private key, for me to deploy it and transfer ownership to them?

  1. If I have money in my wallet, and I want to buy something on a smart contract on behalf of someone else, who has no money in their wallet, can they sign a transaction and send it to me, so that I can send it to the contract and pay the costs myself, but they will be registered on the blockchain as the payer. I realise this may not show up in the transaction as them being the person who paid, but from the perspective of the smart contract, lets say there is a payable function, I pay that function, but the function records within the contract their address (perhaps their address is in the data field of the transaction) - is there a standard approach to this?

Thanks!

1 Answer 1

0

Signing a payment but not sending it to the blockchain, but instead sending it to someone else to then send to the blockchain.

A can sign a transaction that states that some amount of tokens or ether will go to B, and B can then submit it to the blockchain. However, A can at the same time move all his funds to another account such that the transaction sent to B becomes invalid.

For this reasons in state channels, the participants lock an amount of ether or tokens. These are stored in a smart contract, then B can send the transaction signed to the smart contract being secure that the funds can not be moved by A.

Signing a payment, but in doing so cancelling an old one.

The key here is the nonce. Imagine A pay B x Ether, they agree that B will submit it later. Imagine that a new payment to B must be done by A, and B has not submitted the previous bill. A can issue a new payment with the same nonce and the updated amount. Only one of those transactions will be valid and B for sure will submit the one with the full amount.

  1. Paying the transaction fees on behalf of a signed transaction
  2. Signing a transaction to deploy a contract 5.

The account is signed by the account who sign it.

You can, of course, build a contract that let one person to pay for something and send it to someone else, but not through the mechanism that you describe.

I hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.