* SDK: Add `NullSigner` implementation
* SDK: Split `Transaction::verify()` to gain access to results
* CLI: Minor refactor of --sign_only result parsing
* CLI: Enable paritial signing
Signers specified by pubkey, but without a matching --signer arg
supplied fall back to a `NullSigner` when --sign-only is in effect.
This allows their pubkey to be used for TX construction as usual,
but leaves their `sign_message()` a NOP. As such, with --sign-only
in effect, signing and verification must be done separately, with
the latter's per-signature results considered
* CLI: Surface/report missing/bad signers to user
* CLI: Suppress --sign-only JSON output
* nits
* Docs for multi-session offline signing
(cherry picked from commit 98228c392e
)
Co-authored-by: Trent Nelson <trent@solana.com>
This commit is contained in:
@@ -82,6 +82,72 @@ Output
|
||||
4vC38p4bz7XyiXrk6HtaooUqwxTWKocf45cstASGtmrD398biNJnmTcUCVEojE7wVQvgdYbjHJqRFZPpzfCQpmUN
|
||||
```
|
||||
|
||||
## Offline Signing Over Multiple Sessions
|
||||
|
||||
Offline signing can also take place over multiple sessions. In this scenario,
|
||||
pass the absent signer's public key for each role. All pubkeys that were specified,
|
||||
but no signature was generated for will be listed as absent in the offline signing
|
||||
output
|
||||
|
||||
### Example: Transfer with Two Offline Signing Sessions
|
||||
|
||||
Command (Offline Session #1)
|
||||
|
||||
```text
|
||||
solana@offline1$ solana transfer Fdri24WUGtrCXZ55nXiewAj6RM18hRHPGAjZk3o6vBut 10 \
|
||||
--blockhash 7ALDjLv56a8f6sH6upAZALQKkXyjAwwENH9GomyM8Dbc \
|
||||
--sign-only \
|
||||
--keypair fee_payer.json \
|
||||
--from 674RgFMgdqdRoVtMqSBg7mHFbrrNm1h1r721H1ZMquHL
|
||||
```
|
||||
|
||||
Output (Offline Session #1)
|
||||
|
||||
```text
|
||||
Blockhash: 7ALDjLv56a8f6sH6upAZALQKkXyjAwwENH9GomyM8Dbc
|
||||
Signers (Pubkey=Signature):
|
||||
3bo5YiRagwmRikuH6H1d2gkKef5nFZXE3gJeoHxJbPjy=ohGKvpRC46jAduwU9NW8tP91JkCT5r8Mo67Ysnid4zc76tiiV1Ho6jv3BKFSbBcr2NcPPCarmfTLSkTHsJCtdYi
|
||||
Absent Signers (Pubkey):
|
||||
674RgFMgdqdRoVtMqSBg7mHFbrrNm1h1r721H1ZMquHL
|
||||
```
|
||||
|
||||
Command (Offline Session #2)
|
||||
|
||||
```text
|
||||
solana@offline2$ solana transfer Fdri24WUGtrCXZ55nXiewAj6RM18hRHPGAjZk3o6vBut 10 \
|
||||
--blockhash 7ALDjLv56a8f6sH6upAZALQKkXyjAwwENH9GomyM8Dbc \
|
||||
--sign-only \
|
||||
--keypair from.json \
|
||||
--fee-payer 3bo5YiRagwmRikuH6H1d2gkKef5nFZXE3gJeoHxJbPjy
|
||||
```
|
||||
|
||||
Output (Offline Session #2)
|
||||
|
||||
```text
|
||||
Blockhash: 7ALDjLv56a8f6sH6upAZALQKkXyjAwwENH9GomyM8Dbc
|
||||
Signers (Pubkey=Signature):
|
||||
674RgFMgdqdRoVtMqSBg7mHFbrrNm1h1r721H1ZMquHL=3vJtnba4dKQmEAieAekC1rJnPUndBcpvqRPRMoPWqhLEMCty2SdUxt2yvC1wQW6wVUa5putZMt6kdwCaTv8gk7sQ
|
||||
Absent Signers (Pubkey):
|
||||
3bo5YiRagwmRikuH6H1d2gkKef5nFZXE3gJeoHxJbPjy
|
||||
```
|
||||
|
||||
Command (Online Submission)
|
||||
|
||||
```text
|
||||
solana@online$ solana transfer Fdri24WUGtrCXZ55nXiewAj6RM18hRHPGAjZk3o6vBut 10 \
|
||||
--blockhash 7ALDjLv56a8f6sH6upAZALQKkXyjAwwENH9GomyM8Dbc \
|
||||
--from 674RgFMgdqdRoVtMqSBg7mHFbrrNm1h1r721H1ZMquHL \
|
||||
--signer 674RgFMgdqdRoVtMqSBg7mHFbrrNm1h1r721H1ZMquHL=3vJtnba4dKQmEAieAekC1rJnPUndBcpvqRPRMoPWqhLEMCty2SdUxt2yvC1wQW6wVUa5putZMt6kdwCaTv8gk7sQ \
|
||||
--fee-payer 3bo5YiRagwmRikuH6H1d2gkKef5nFZXE3gJeoHxJbPjy \
|
||||
--signer 3bo5YiRagwmRikuH6H1d2gkKef5nFZXE3gJeoHxJbPjy=ohGKvpRC46jAduwU9NW8tP91JkCT5r8Mo67Ysnid4zc76tiiV1Ho6jv3BKFSbBcr2NcPPCarmfTLSkTHsJCtdYi
|
||||
```
|
||||
|
||||
Output (Online Submission)
|
||||
|
||||
```text
|
||||
ohGKvpRC46jAduwU9NW8tP91JkCT5r8Mo67Ysnid4zc76tiiV1Ho6jv3BKFSbBcr2NcPPCarmfTLSkTHsJCtdYi
|
||||
```
|
||||
|
||||
## Buying More Time to Sign
|
||||
|
||||
Typically a Solana transaction must be signed and accepted by the network within
|
||||
|
Reference in New Issue
Block a user