i have a device A that holds a private key Sk(A) and its respective public key Pk(A).
I’ve also a backend service B that holds a private key Sk(B) and its respective public key Pk(B).
A knows only the address string of B.
I want to create a 2/2 Multisig transaction, where both the signatures of A and B are required.
Is it possibile to send a signedTransaction (by A only) to the backend B (so a conversion of the transaction to a JSON format - like) and make B to append its signature to the transaction and then send it to the blockchain?
Yes this is possible. Take a look at this section: https://developer.algorand.org/docs/features/transactions/signatures/#multisignatures
Notice that the first account signs the tx. let rawSignedTxn = algosdk.signMultisigTransaction(txn, mparams, account1.sk).blob;
You can save off this signed tx and send to backend service which would then do:
let twosigs = algosdk.appendSignMultisigTransaction(rawSignedTxn, mparams, account2.sk).blob;
//submit the transaction
let tx = (await algodclient.sendRawTransaction(twosigs));
console.log("Transaction : " + tx.txId);
since my acct2 is the backend B and at this point i know only its public key (since the code is running on the client), i can write this address only in a String format and i couldn’t figure out how to convert it to the Ed25519PublicKey required by the code.