F
Flow6mo ago
joshua

joshua | Flow (2024-06-10)

Am I able to create key pairs and sign "off-chain" data in the Cadence testing framework? I don't see anything in the crypto contract or the docs about it
10 Replies
Needle
Needle6mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
joshua
joshuaOP6mo ago
@mpeter ?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
joshua
joshuaOP6mo ago
no, I mean generating a private key and signing an off-chain message that I can verify in a smart contract or even signing a message with a key in flow.json not signing a transactions or adding keys to an account, just signing a piece of data I don't see anything in the crypto contract for signing things just verifying @Cadence Does anyone know?
turbolent
turbolent6mo ago
what exactly would you like to do?
joshua
joshuaOP6mo ago
I want to sign a payload in the testing framework and verify it in a smart contract It is for Circle's OnChainMultiSig https://github.com/joshuahannan/flow-usdc/blob/cadence-1-multisig/transactions/onChainMultiSig/add_new_payload.cdc To execute transactions, they sign a message with the text of the transaction and store the signed text on-chain, then the different signers all have to sign and submit their version of it and once there is enough signatures, the actual transaction can be executed So I am wondering if it is possible to sign non-transaction data in the Cadence testing framework so it can be submitted to a contract like this Before, they were just doing it with the Go SDK :https://github.com/joshuahannan/flow-usdc/blob/cadence-1-multisig/lib/go/util.go#L205 go with the flow in this case but I'd like to do it in Cadence if possible
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
joshua
joshuaOP6mo ago
Just the code that I linked, but the Go code super old and uses an ancient version of Go With the Flow. I have to do this this week, so if it isn't possible in the Cadence testing framework right now, I will just do it in Go
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
turbolent
turbolent6mo ago
As far as I understand what you're trying to do, I don't think we provide any means to do that at the moment, but that could probably be added could you please open a feature request issue?
Want results from more Discord servers?
Add your server