## privacy 隐私交易合约
# 测试准备
## 测试账户的SEED信息
cli seed generate -l 0
{
    "seed": "quantum frame fog mix way dignity surround peanut spin legal traffic neither penalty accident weasel"
}

## 保存SEED信息
cli seed save -s "quantum frame fog mix way dignity surround peanut spin legal traffic neither penalty accident weasel" -p 123456
{
    "isok": true,
    "msg": ""
}

## 挖矿地址
mine1   1PUiGcbsccfxW3zuvHXZBJfznziph5miAo
mine2   1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
mine3   12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv

## 测试账户地址（需要根据自己的实际情况调整）
shgA    1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t
shgB    13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU
shgC    1JSRSwp16NvXiTjYBYK9iUQ9wqp3sCxz2p

# 隐私交易命令查询功能命令清单
## 查看当前账户列表信息
cli account list

## 解锁
cli wallet unlock -p 123456

## 查看隐私账户在隐私合约上的账户余额
cli account balance -e privacy -a 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t

## 查看指定地址的公钥对
公钥对在接下来转账过程中需要用到  
cli privacy showpk -a 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t

## 查询指定地址的可用、冻结币信息
cli privacy showpai -d 0 -a 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t  
其中-d参数是有4个选择，分别是
- 0：只显示该账户上可用、冻结和总金额
- 1：在0的基础上增加可用输出清单
- 2：在0的基础上增加冻结输出清单
- 3：显示以上0、1、2的所有信息

## 查看隐私交易合约地址
cli exec addr -e privacy

## 从矿机上转账到隐私账户公开地址
cli send bty transfer -k 1PUiGcbsccfxW3zuvHXZBJfznziph5miAo -t 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -n 转账到隐私合约  -a 9999

## 将隐私账户上的币转到隐私合约中，以执行后续的交易
cli send bty transfer -k 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -t 1FeyE6VDZ4FYgpK1n2okWMDAtPkwBuooQd -n 转账到隐私合约  -a 8000

## 查询区块链上的交易
cli tx query -s 0x4833aae9bedad2b60b0e95cd39659ebc538c8f6d23880c47cde6a002e1235ca4

## 主动创建一个UTXO
cli privacy createutxos -f 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -p 92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389 -n createFromutxos -c 16 -a 1  
当当前账户可用UTXO不足时可以通过本命令，创建一批面值的UTXO。本交易需要扣除1coin的手续费

# 单步隐私交易功能清单
## 公开到隐私
公开到隐私，实际上是创建一个可用UTXO  
cli privacy pub2priv -f 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -p 92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389 -n pub2priv_create -a 100 

## 隐私到隐私
cli privacy priv2priv -f 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -p 6326126c968a93a546d8f67d623ad9729da0e3e4b47c328a273dfea6930ffdc87bcc365822b80b90c72d30e955e7870a7a9725e9a946b9e89aec6db9455557eb -n sendA2B -a 3

## 隐私到公开
cli privacy priv2pub -f 13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU -t 1JSRSwp16NvXiTjYBYK9iUQ9wqp3sCxz2p -n priv2pub -a 21

# 多步隐私交易功能命令清单
## 创建公开到隐私的交易
cli bty pub2priv -p 92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389 -n public2privacy -a 5

## 创建隐私到隐私的交易
cli bty priv2priv -n privacy2privacy -p 6326126c968a93a546d8f67d623ad9729da0e3e4b47c328a273dfea6930ffdc87bcc365822b80b90c72d30e955e7870a7a9725e9a946b9e89aec6db9455557eb -s 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -a 5

## 创建隐私到公开的交易
cli bty priv2pub -n privacy2public -f 13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU -o 1JSRSwp16NvXiTjYBYK9iUQ9wqp3sCxz2p -a 5

## 签名
cli wallet sign -m 1 -a 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -d 0xa64296792f90f364371e0b66fdac622080ceb7b2537ff9152e189aa9e88e61bd

## 发送交易
cli wallet send -m 1 -d 0xa64296792f90f364371e0b66fdac622080ceb7b2537ff9152e189aa9e88e61bd

## 查询当前未发送的交易
cli wallet queryctx -a 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t

## 删除当前未发送的交易
cli wallet deletectx -x 0xfe9283397b1cffc9598b37e35e374bdc40867297f474a9d958ae82fdcf7fc318

# 多步合并命令清单
## 创建公开到隐私的交易
cli send bty pub2priv -p 92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389 -n public2privacy -k 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -a 5 -m 1

## 创建隐私到隐私的交易
cli send bty priv2priv -n privacy2privacy -p 6326126c968a93a546d8f67d623ad9729da0e3e4b47c328a273dfea6930ffdc87bcc365822b80b90c72d30e955e7870a7a9725e9a946b9e89aec6db9455557eb -s 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -a 5 -k 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -m 1

## 创建隐私到公开的交易
cli send bty priv2pub -n privacy2public -f 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -o 1JSRSwp16NvXiTjYBYK9iUQ9wqp3sCxz2p -k 1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t -a 5 -m 1
