Sending funds on testnet


#1

I've mined quite a few blocks on testnet but it seems it's not possible to send them, even though they've matured:

zcash/src/zcash-cli getinfo
{
"version" : 1000000,
"protocolversion" : 170002,
"walletversion" : 60000,
"balance" : 3.62950000,
"blocks" : 220,
"timeoffset" : 0,
"connections" : 2,
"proxy" : "",
"difficulty" : 1.49495796,
"testnet" : true,
"keypoololdest" : 1475180473,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"relayfee" : 0.00005000,
"errors" : "WARNING: check your network connection, 0 blocks received in the last 4 hours (96 expected)"
}

zcash/src/zcash-cli getbalance
3.62950000

zcash/src/zcash-cli sendtoaddress mkUE3wx2m2thqMUaRwWaETP9mQESrh9jot 1
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}

zcash/src/zcash-cli listtransactions "" 1
[
{
"account" : "",
"address" : "mkUE3wx2m2thqMUaRwWaETP9mQESrh9jot",
"category" : "send",
"amount" : -1.00000000,
"vout" : 1,
"fee" : -0.00016610,
"confirmations" : -1,
"txid" : "85003b58b38e1fa1358143c2b78b539fa4bc373fcf9f1d5876339241e52e4b5f",
"walletconflicts" : [
"f61e8651bdc9180820341c4186e674c66c9fb5adccc1d494aebbf329abd68650",
"4bb9286126cf76384a01c0040ea7874a33dabf72eb8ef57ae19b5b712227f075",
"83ee6114ad9dc6efff5848e92ab30fa4391343de62f02dfeeb27af5622fe7393",
"cb6936842fd03e2e033bc48c26d0167f85682c49b5ad206ef3bad73bb41069bd",
"8da96b55e3e87f3930368fe3519124c27ab6a46a3f72c0c22605af78eeadc9ca"
],
"time" : 1475226185,
"timereceived" : 1475226470
}
]

All transactions get rejected with orphan state (-1) in listtransactions


#2

Mined coinbase must be spent to a z-addr. More specifically, any transaction that contains coinbase as an input must have no transparent outputs (excluding fees). This is enforced by consensus rules.


#3

Hmm, that means any mined funds must be moved to a z address before they can be spent as usual? Is a z address a special generated address or just a mainnet address beginning with 'z'?


#4

specially generated

~/zcash/./src/zcash-cli zcrawkeygen
~/zcash/./src/zcash-cli zcrawjoinsplit "$(~/zcash/./src/zcash-cli createrawtransaction '[{"txid":"TransparentAddieofBlock","vout":0}]' '{}')" '{}' "{\"AnonAddressYouWantToSendTo":1}" 1 0
~/zcash/./src/zcash-cli signrawtransaction "$RAWTXN_FROM_ZCRAWJOINSPLIT"
~/zcash/./src/zcash-cli sendrawtransaction "$RAWTXN_FROM_SIGNRAWTRANSACTION"


#5

mined coin can not be used directly

https://github.com/zcash/zcash/wiki/Beta-Guide


#6

A z-addr is a shielded address used for JoinSplits. You can generate one with z_getnewaddress.


#7

Thanks guys, good I'm testing this all before mainnet launch.