-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign transaction API #220
Comments
This is very nice idea, I think the One thing lacking unfortunately in Flow is the key management. ( especially wallet side ) |
Thank you. Signer is already defined as an interface in GO SDK no? https://github.com/onflow/flow-go-sdk/blob/master/crypto/crypto.go#L103 |
@sideninja, I thought this would be another What I was thinking was making this Main problem currently is I have to give keyIndex ( which should not be necessary actually, SDK can resolve that from account keys ) |
Yes, my plan was to create an interface that would hold be used to pass arguments to the signing method. I've already started some work on this, hopefully be out soon. |
It can be nice if it can support reverse of the logic. Maybe something like Signer interface providing the public keys (with algo) it can sign for. And SDK choosing from that options with some priority. ( or some priority of Signer interfaces ) In here ( address, keyIndex ) is actually just used to lookup ( privatekey ) which ( pubkey ) also can be used. This allows somehow not looser coupling. Also allows some kind of back up scenarios, let's say can't reach KMS can sign with local key, or can send signing request to user etc |
The current SDK API for signing exposes two methods:
SignPayload
andSignEnvelope
which must be used in correct order to produce a valid signature, although these methods are valuable for advance usage I believe a simpler methodSign
could be added to hide "implementation details" of signing a transaction which could be quite complex for new adopters.Proposed API addition:
Based on the transaction parameters (authorizers, proposer, payer) the method can figure out how to sign the payload and the envelope. Signers array should contain a key index and address along with the signer function.
The text was updated successfully, but these errors were encountered: