# Software for offline shielded transactions?

**URL:** <https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173>\
**Category:** General\
**Created:** [August 26, 2020, 5:33pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173 "2020-08-26T17:33:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robustus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/robustus/32/125_2.png) [@robustus](https://forum.zcashcommunity.com/u/robustus)\
**Post date:** [August 26, 2020, 5:33pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/1 "2020-08-26T17:33:34Z")

</div>

Is there any tooling for signing shielded transactions offline? Also, what’s the best way to do offline transactions in general (either t or z)? Thanks!

---

<div class="post-metadata">

**Author:** ![Autotunafish](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/autotunafish/32/7827_2.png) [@Autotunafish](https://forum.zcashcommunity.com/u/Autotunafish)\
**Post date:** [August 27, 2020, 3:16pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/2 "2020-08-27T15:16:46Z")

</div>

> <https://github.com/zcash/zcash/issues/3327>
>
> \### Describe the issue
> There is an error when signing a transaction on an offli…ne node as described at https://bitcoin.org/en/developer-examples#offline-signing.
> 
> \### Can you reliably reproduce the issue?
> \#### If so, please list the steps to reproduce below:
> 1. Setup an online node with the following zcash.conf. Continue once it's fully synced.
> \`\`\`
> testnet=1
> disablewallet=0
> server=1
> rpcuser=foo
> rpcpassword=bar
> rpcallowip=0.0.0.0/0
> rpcallowip=::/0
> rpcport=8762
> printtoconsole=1
> \`\`\`
> 2. Make sure there is at least one UTXO and run the following commands to build an unsigned transaction. I included my results.
> \`\`\`shell
> $ zcash-cli listunspent
> \[
> {
> "txid": "a4fca062739f85a98b56e985e930b1174a1eb52873b35d94ef754d779923dc3f",
> "vout": 1,
> "generated": false,
> "address": "tmRTaMngZ81K44GyGpPjqajmdkB9NLWirj4",
> "account": "",
> "scriptPubKey": "76a914acb6a5f2de3f6859daddccda56c9903c1623b56d88ac",
> "amount": 2.99900000,
> "confirmations": 1,
> "spendable": true
> }
> \]
> 
> $ zcash-cli getaddressesbyaccount ""
> \[
> "tmQHbuXodHL8mZtUsw8dYXxbcgS6PFo8rSd",
> "tmRTaMngZ81K44GyGpPjqajmdkB9NLWirj4"
> \]
> 
> $ zcash-cli dumpprivkey tmRTaMngZ81K44GyGpPjqajmdkB9NLWirj4
> cSXVP4HVBkW4cSoV2kv9F5jWz9gfRTwxJAW5gVA8uPGENyjz9CXU
> 
> $ zcash-cli createrawtransaction '\[{"txid": "a4fca062739f85a98b56e985e930b1174a1eb52873b35d94ef754d779923dc3f", "vout": 1}\]' '{"tmQHbuXodHL8mZtUsw8dYXxbcgS6PFo8rSd": "2.998"}'
> 030000807082c403013fdc2399774d75ef945db37328b51e4a17b130e985e9568ba9859f7362a0fca40100000000ffffffff01c095de11000000001976a9149fdba78a88de72be825a80fc6de4ad239a03851588ac0000000074ca030000
> \`\`\`
> 3. Switch to an offline node with the following zcash.conf. It doesn't have to be fully synced.
> \`\`\`
> testnet=1
> disablewallet=0
> server=1
> rpcuser=foo
> rpcpassword=bar
> rpcallowip=0.0.0.0/0
> rpcallowip=::/0
> rpcport=8762
> printtoconsole=1
> maxconnections=0
> \`\`\`
> 4. Sign the transaction from the 2nd step.
> \`\`\`shell
> $ zcash-cli signrawtransaction 030000807082c403013fdc2399774d75ef945db37328b51e4a17b130e985e9568ba9859f7362a0fca40100000000ffffffff01c095de11000000001976a9149fdba78a88de72be825a80fc6de4ad239a03851588ac0000000074ca030000 '\[{"txid": "a4fca062739f85a98b56e985e930b1174a1eb52873b35d94ef754d779923dc3f", "vout": 1, "scriptPubKey": "76a914acb6a5f2de3f6859daddccda56c9903c1623b56d88ac"}\]' '\["cSXVP4HVBkW4cSoV2kv9F5jWz9gfRTwxJAW5gVA8uPGENyjz9CXU"\]'
> {
> "hex": "030000807082c403013fdc2399774d75ef945db37328b51e4a17b130e985e9568ba9859f7362a0fca4010000006b483045022100ba4a8a53511842c41bc7883733bbb66e1cf51377ef6b72bf89c5424601b47e0702206586793dd0ad460f3632de6894eeb2be77cd007ba9bf017fc7d0ecc39befba19012102674cafc2d1afba93a76398e045e1cca26a822618f6201725e7f7941539a1c8cbffffffff01c095de11000000001976a9149fdba78a88de72be825a80fc6de4ad239a03851588ac0000000074ca030000",
> "complete": true
> }
> \`\`\`
> 5. Switch back to the online node and send the transaction from the previous step.
> \`\`\`shell
> $ zcash-cli sendrawtransaction 030000807082c403013fdc2399774d75ef945db37328b51e4a17b130e985e9568ba9859f7362a0fca4010000006b483045022100ba4a8a53511842c41bc7883733bbb66e1cf51377ef6b72bf89c5424601b47e0702206586793dd0ad460f3632de6894eeb2be77cd007ba9bf017fc7d0ecc39befba19012102674cafc2d1afba93a76398e045e1cca26a822618f6201725e7f7941539a1c8cbffffffff01c095de11000000001976a9149fdba78a88de72be825a80fc6de4ad239a03851588ac0000000074ca030000
> error code: -26
> error message:
> 16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)
> \`\`\`
> 
> \### Expected behaviour
> The transaction is successfully broadcasted. Its TXID is obtained.
> 
> \### Actual behaviour + errors
> \`sendrawtransaction\` fails with \`mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)\` error message. I performed the steps above with the latest Bitcoin Core (except it had addresstype=legacy in its conf file) and it worked.
> 
> 
> \### The version of Zcash you were using:
> Zcash Daemon version v1.1.0-42e302523-dirty
> 
> \### Machine specs:
> \- OS: Arch Linux, latest:
> \- CPU: Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8
> \- RAM: 15.5 GiB
> \- Disk size: 502.7 GB
> \- Disk Type (HD/SDD): SSD
> \- Linux kernel version (uname -a): Linux archlinux 4.16.13-1-ARCH #1 SMP PREEMPT Thu May 31 23:29:29 UTC 2018 x86\_64 GNU/Linux
> \- Compiler version (gcc -version): gcc version 8.1.0 (GCC)

This person used createrawtranasction on a synced online node, signrawtransaction on a synced offline node then sendrawtransaction on the online node, the problem they had looks like they weren’t fully synced and perhaps that Zcashd maybe wasn’t really designed for that idk

---

<div class="post-metadata">

**Author:** ![robustus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/robustus/32/125_2.png) [@robustus](https://forum.zcashcommunity.com/u/robustus)\
**Post date:** [August 27, 2020, 4:49pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/3 "2020-08-27T16:49:12Z")

</div>

Thanks for the link. Looks like it’s reasonably possible with zcashd, at least for t-addresses. Is this process any different for z-addr transactions though?

Also, that thread is over 2 years old. I’m a little surprised no offline-tx specific tooling exists yet.

---

<div class="post-metadata">

**Author:** ![Autotunafish](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/autotunafish/32/7827_2.png) [@Autotunafish](https://forum.zcashcommunity.com/u/Autotunafish)\
**Post date:** [August 27, 2020, 4:59pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/4 "2020-08-27T16:59:52Z")

</div>

The z address calls usually have a “z\_” pre-appended

> **[Zcash 4.5.1-1 RPC Docs](https://zcash-rpc.github.io/)**
>
> Zcash 4.5.1-1 RPC Docs

---

<div class="post-metadata">

**Author:** ![robustus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/robustus/32/125_2.png) [@robustus](https://forum.zcashcommunity.com/u/robustus)\
**Post date:** [August 27, 2020, 5:12pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/5 "2020-08-27T17:12:54Z")

</div>

Yeah, but is the signing process exactly the same?

---

<div class="post-metadata">

**Author:** ![Autotunafish](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/autotunafish/32/7827_2.png) [@Autotunafish](https://forum.zcashcommunity.com/u/Autotunafish)\
**Post date:** [August 27, 2020, 5:30pm UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/6 "2020-08-27T17:30:22Z")

</div>

Im not sure, it doesn’t specify permitted types (I’d try to help more but Im at work and not able at the moment)

---

<div class="post-metadata">

**Author:** ![daira](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/daira/32/43253_2.png) [@daira](https://forum.zcashcommunity.com/u/daira)\
**Post date:** [August 29, 2020, 10:32am UTC](https://forum.zcashcommunity.com/t/software-for-offline-shielded-transactions/37173/8 "2020-08-29T10:32:50Z")

</div>

There is somewhat recent development on this: [Add RPC methods for creating shielded transactions offline · Issue #2542 · zcash/zcash · GitHub](https://github.com/zcash/zcash/issues/2542) and [Understand demos for PCZTs (partially-created zcash transactions) · Issue #4544 · zcash/zcash · GitHub](https://github.com/zcash/zcash/issues/4544) . I encourage anyone interested in moving this along to comment on ticket #2542.
