# Multisigi transaction from Java to Javascript

**URL:** https://forum.algorand.co/t/multisigi-transaction-from-java-to-javascript/2027
**Category:** General
**Created:** [September 5, 2020, 8:49pm UTC](https://forum.algorand.co/t/multisigi-transaction-from-java-to-javascript/2027 "2020-09-05T20:49:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mister\_Enzo](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Mister\_Enzo](https://forum.algorand.co/u/Mister_Enzo)
#### Post date: [September 5, 2020, 8:49pm UTC](https://forum.algorand.co/t/multisigi-transaction-from-java-to-javascript/2027/1 "2020-09-05T20:49:32Z")

</div>

Hi there,  
I have a client A that uses the JavaSDK to produce a multisig address composed by the account A and B and a signed transaction. The transaction is signed by A only.

A wants to send the transaction to the backend B, so B can sign it and send to the blockchain.

A sends to B this JSON:

{“multiSigAccount”:{  
“publicKeys”:[“wFJi8oEISKHen0LDeEk+yXD3zHQNeultuTF+xVbnQzw=”,  
“dRQsIsSYbCE4YhxNGMFV0ykS1WBvrl5O7vX+3SvjDy0=”],  
“threshold”:2,  
“version”:1},  
“signedTransaction”:{  
“msig”:{  
“subsig”:[{“pk”:“wFJi8oEISKHen0LDeEk+yXD3zHQNeultuTF+xVbnQzw=”,  
“s”:“jNxed0mD+7jPAP7sGBIEq0hBoVk5RJ8+l9GxMypISMI+dKwWeiGGNse2vsCBjrqR860sfJsuC4py23dxDdUFBg==”},{“pk”:“dRQsIsSYbCE4YhxNGMFV0ykS1WBvrl5O7vX+3SvjDy0=”,  
“s”:“AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==”}],  
“thr”:2,  
“v”:1},  
“txn”:{“close”:“NcSelNBbzNvQC5PSu0I8yJvwTjdPxlSerO8UI+5T6Ic=”,  
“fee”:1000,  
“fv”:9061117,  
“gen”:“testnet-v1.0”,  
“gh”:“SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=”,  
“lv”:9062117,  
“note”:“2VB7ImRpYWdub3Npc0tleXMiOlsiWUJKR0Y0VUJCQkVLRFhVN0lMQlhRU0o2WkZZUFBURFVCVjVPUzNOWkdGN01LVlhISU02RUxNWUxZVSJdfQ==”,  
“rcv”:“NcSelNBbzNvQC5PSu0I8yJvwTjdPxlSerO8UI+5T6Ic=”,  
“snd”:“bQFchr8rr7rK8BjoH3qAmh3oQYq1ELXjZSIfkQeLRII=”,  
“type”:“pay”}}}

Now B has to parse the json to reconstruct all the objects he needs to complete the transaction and send it to the blockchain.

How can i achieve this in JavascriptSDK? Is there some JSON parser that i can use? Thanks!

---

<div class="post-metadata">

### Author: ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)
#### Post date: [September 8, 2020, 12:50pm UTC](https://forum.algorand.co/t/multisigi-transaction-from-java-to-javascript/2027/2 "2020-09-08T12:50:47Z")

</div>

It is usually simplest to serialize all the data in msgpack, instead of JSON.

You should be able to use the transaction method `.bytes()` ([https://github.com/algorand/java-algorand-sdk/blob/develop/src/main/java/com/algorand/algosdk/transaction/Transaction.java#L1202](https://github.com/algorand/java-algorand-sdk/blob/develop/src/main/java/com/algorand/algosdk/transaction/Transaction.java#L1202)) to serialize the transaction in Java.

Then, in JS, you can use [https://github.com/algorand/js-algorand-sdk/blob/3999aa43fc3d945b38419339c593bb5fd72e49c6/src/main.js#L195](https://github.com/algorand/js-algorand-sdk/blob/3999aa43fc3d945b38419339c593bb5fd72e49c6/src/main.js#L195), if you just need to append a multisig signature.  
You can also use `algosdk.decodeObj` to decode the transaction, followed by [https://github.com/algorand/js-algorand-sdk/blob/3999aa43fc3d945b38419339c593bb5fd72e49c6/src/transaction.js#L141](https://github.com/algorand/js-algorand-sdk/blob/3999aa43fc3d945b38419339c593bb5fd72e49c6/src/transaction.js#L141)
