Blockquote
The sender_sig field is calculated by signing the concatenation of the 11 bytes \x0Aic-request (the domain separator) and the 32 byte request id with the secret key that belongs to the key specified in the last delegation or, if no delegations are present, the public key specified in sender_pubkey .
But this doesn’t actually make sense, as no private key is sent to the client inside a delegation.
Can somebody please confirm whether the documentation is wrong or I’m missing something?
A delegation is a signature on a public key. The client must possess the corresponding secret key. According to the specification, if a delegation is used, the message must be signed with the secret key corresponding to the delegated public key. If no delegation is used, the message must be signed with the secret key corresponding to the public key included directly in the message.
That makes sense. The the secret key that belongs to the key specified in the last delegation snippet is a bit confusion, and rephrasing it to the secret key that belongs to the delegated public key in the last delegation might help.