Cardano-node: [FR] - Sign stakepool certificate transaction in multiple stages

Created on 25 May 2020  路  13Comments  路  Source: input-output-hk/cardano-node

Summary
If a pool's owner and operator are different people, in a trust-less financial system, it is desirable to never expose your private keys. The current signing of a stakepool certificate requires the owner's private keys as well as the operator's cold keys for the pool.

Problem
Either the owner is exposing all of their funds to the operator, or the operator is exposing control of the stakepool to the owner.

Describe alternatives you've considered
I've attempted to sign the transaction in stages, but it appears that the current implementation of cardano-cli shelley transaction sign... command requires that the input be unsigned.

ShelleyCmdTransactionError (ShelleyTxCardanoApiError (ApiErrorCBOR (DecoderErrorDeserialiseFailure "TxUnsigned" (DeserialiseFailure 2 "Found unknown tag 177 while decoding TxUnsigned"))))

Additional context / screenshots
As you can see in this screenshot, during the We sign: step, both the operator's cold key and the owner's private key have to be exposed in the same step.
Screenshot from 2020-05-25 08-35-55

Recommendation
Allow incremental signing of a stakepool certificate transaction so that it can be passed from operator to owner. Each can sign privately without exposing their important keys.

cli revision enhancement priority high shelley mainnet test required

Most helpful comment

This is now covered by:

$ cardano-cli shelley transaction witness
Usage: cardano-cli shelley transaction witness --tx-body-file FILE
                                               --witness-signing-key-file FILE 
                                               [--mainnet | 
                                                 --testnet-magic NATURAL]
                                               --out-file FILE
  Witness a transaction

Available options:
  --tx-body-file FILE      Input filepath of the TxBody.
  --witness-signing-key-file FILE
                           Filepath of the witness signing key.
  --mainnet                Use the mainnet magic id.
  --testnet-magic NATURAL  Specify a testnet magic id.
  --out-file FILE          The output file.

and
```$ cardano-cli shelley transaction sign-witness
Usage: cardano-cli shelley transaction sign-witness --tx-body-file FILE
--witness-file FILE
--out-file FILE
Sign and witness a transaction

Available options:
--tx-body-file FILE Input filepath of the TxBody.
--witness-file FILE Filepath of the witness.
--out-file FILE The output file.
```
The name of the second command isn't sensible and it's help text is not great, but it's there.

IMHO, it should be called something like "assemble" since there is no signing, just just assembling the tx body with the witnesses. The help text should also make clear that the --witness-file can be used any number of times, since it's a set of witnesses.

All 13 comments

As an additional idea, perhaps it is also possible to have a type of "phantom pledge address" which is made up of a phantom pledge equalling the summation of all pledges from individual pledge addresses making up that stakepool.

Requiring access to both owner and pool keys in the same command is a temporary hack to have something that works for the time being. We fully agree.

@disassembler Many of the people who have talked to me about pledging are investors first and computer people second. In an ideal world, they'd be most comfortable doing the pledge in a GUI environment like Daedalus instead of the cardano-cli. I've been putting together some WIP documentation for them in anticipation of it being in cardano-cli, but the feedback so far from them is they're not comfortable with it given the amounts of Ada they anticipate pushing around.

https://hackmd.io/uaRZCsgsTOunL6u0AoT5RA
https://hackmd.io/GK90CC7jRdu7AqsHEbv0Mw

Yes, at the end of the day investors like me want to help with pledging, but messing around with any kind of code or command line gives me great pause. In a perfect world, I'd like to pledge in a similar way as I delegate through dadalus wallet. That would be ideal and foster the most participation with pledging from regular investors like me

This is the multi-signature transaction functionality. It is also covered by #1042, which I will close

Just to clarify because this has triggered some thinking here ...

I did an experiment with Andrew regarding that. I made a point that all an operator needs to be able to register a stake pool with one or more owners, is to have access to the stake.skey/vkey pair of the owner.

Andrew sent me a fresh stake.skey/vkey pair that he had just registered on chain.

With that information only, I was able to register a stake pool with my pool operator credentials (pool operator stake.skey/vkey) and his owner credentials.

I signed the transaction using all skey required. node.skey, operator.skey and of course owner.skey (he gave me earlier)

All is fine, and I never had to access Andrew's utxo funds that reside in the base address (utxo) linked to the stake.skey/vkey credentials he gave me.

Therefore, as long as the operator is able to cover the pool certification fees alone, he does not need any access to owner funds directly. This should ease up a bit the relations once we hit mainnet.

As a conclusion, the drawback is that the owner should be proficient enough in CLIs to generate and register himself a base address with staking rights.

Edit : And that is why I'd rather have whales delegating normally, rather than doing this kind of things.

The way we'll do this is to have separate witnesses: CLI commands to construct a separate witness, and to assemble a complete tx from the tx body and a set of witnesses.

This functionality already exists, so it's just a matter of exposing it in the CLI.

So this is not specific to stake pools, but it will be useful for the case of stake pools (with separate owner vs operator, or multiple owners) and for the case of multi-sig scripts.

@dcoutts Will there be a way for a witness to inspect what they're signing? For example, if I hand off a stakepool certificate to an owner to sign, they'll want to know what pool parameters they're agreeing to.

I am not Duncan ... But the specs are clearly stating that there should be a sufficient amount of trust for this to work.

@AndrewWestberg yes, they can print out the tx body using

cardano-cli shelley text-view decode-cbor

Not perfect, but hopefully ok.

This is now covered by:

$ cardano-cli shelley transaction witness
Usage: cardano-cli shelley transaction witness --tx-body-file FILE
                                               --witness-signing-key-file FILE 
                                               [--mainnet | 
                                                 --testnet-magic NATURAL]
                                               --out-file FILE
  Witness a transaction

Available options:
  --tx-body-file FILE      Input filepath of the TxBody.
  --witness-signing-key-file FILE
                           Filepath of the witness signing key.
  --mainnet                Use the mainnet magic id.
  --testnet-magic NATURAL  Specify a testnet magic id.
  --out-file FILE          The output file.

and
```$ cardano-cli shelley transaction sign-witness
Usage: cardano-cli shelley transaction sign-witness --tx-body-file FILE
--witness-file FILE
--out-file FILE
Sign and witness a transaction

Available options:
--tx-body-file FILE Input filepath of the TxBody.
--witness-file FILE Filepath of the witness.
--out-file FILE The output file.
```
The name of the second command isn't sensible and it's help text is not great, but it's there.

IMHO, it should be called something like "assemble" since there is no signing, just just assembling the tx body with the witnesses. The help text should also make clear that the --witness-file can be used any number of times, since it's a set of witnesses.

It has apparently been tested manually now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cardanians picture cardanians  路  6Comments

vae520283995 picture vae520283995  路  6Comments

deepfire picture deepfire  路  3Comments

AndrewWestberg picture AndrewWestberg  路  6Comments

dorin100 picture dorin100  路  3Comments