Upgrading to Privacy-v2

Converting your PRV coins

The big change in Privacy protocol means coin owners will need to convert their current coins to version 2. Our App will handle this automatically.
You can also create a converting transaction using privacy.wasm. Use the function createConvertTx
1
createConvertTx(txParams, lockTime=0, cb)
Copied!
it takes the same parameters as createTransaction except that inputs must be version 1 PRV coins.
In version 1, any output coins with the same receiver are linkable; this is mitigated by the new One Time Address feature in version 2.
Example:
1
{
2
"SenderSK": "ThHKrr8n8sJ1fRjRpU7WK4ihCcNDPgBpCSB+Yl1OGg0=",
3
"PaymentInfo": [],
4
"InputCoins": [{
5
"Version": "1",
6
"Info": "",
7
"Index": "",
8
"PublicKey": "12vM99DZPnpNZnwKXCJwuK1jA1B7ts99uuAwkpgAqEf22sYhVTZ",
9
"Commitment": "12jhaduMcTiQZmcpXvPcm2pFExEL6GiNiT7goDsj7wyLtY1XA7B",
10
"KeyImage": "12j3ZfQon9xsFCh9soFXgC8wz2iMXzg1Vrfe6YjRcJDc5LHgMFt",
11
"SharedRandom": "",
12
"SharedConcealRandom": "",
13
"TxRandom": "",
14
"Randomness": "123mE3d7WvvbytxRmr8x5N5ck9fv3DcW8h8o9svBhGyeRpqEqPy",
15
"Value": "40000000000000",
16
"CoinDetailsEncrypted": "",
17
"SNDerivator": "1ib54Ya9f8DTKH9ewhhmC3znF8q7TY4musFCYNzsuhipEevp57",
18
"AssetTag": ""
19
}],
20
"Fee": 100,
21
"CoinCache": null
22
}
Copied!
Resulting TX:
1
{
2
"Version": 2,
3
"Type": "cv",
4
"LockTime": 1609823038,
5
"Fee": 100,
6
"Info": "",
7
"SigPubKey": "/NPaKTA3pYTjYxdWpSvOlsp+hAzbwc6Q8x0qynd2+ao=",
8
"Sig": "ipwV35kEEKyfvx+mUid8ibv6YL8XZPwSlDyOUvuBHwnbHCzbNkA5O51WpMFDZGE2Qv2Iss0tr4bg+ad4xSyjBA==",
9
"Proof": "/wGtIPzT2ikwN6WE42MXVqUrzpbK...",
10
"PubKeyLastByteSender": 170,
11
"Metadata": null
12
}
Copied!

Converting your pToken coins

Your parameters need to specify what token you want (TokenID) and which coins to convert (TokenInputs - in version 1)
Some PRV for fee is needed for this transaction. And the PRV must be version 2. So convert your PRV before converting tokens.
Example parameters:
1
{
2
"SenderSK": "ThHKrr8n8sJ1fRjRpU7WK4ihCcNDPgBpCSB+Yl1OGg0=",
3
"PaymentInfo": [],
4
"InputCoins": [{
5
"Version": "2",
6
"Info": "",
7
"Index": "1Qpf76F",
8
"PublicKey": "128kPvNRT6NsowdNTymKJ9BZTWrKBkeUUurRwzfVH9m7Ni88VRj",
9
"Commitment": "1mgvscU21mMmLS5sFksrwtN8XBCTbavQovQLR7xgjBbTEgvNDD",
10
"KeyImage": "12hoKoBCiTvX6TdkN2ZDJ7pvVjq38bsfuPmfY3GkhoXpknmrnDB",
11
"SharedRandom": "",
12
"SharedConcealRandom": "",
13
"TxRandom": "12EpJ2nwTwfcCtTjwpQWd8NFrrovmqhTpjKbSYh3Kzdb3pMywifbH7zYkMVXBAvgmHew8i7j2CRJJuzoKeQett19Dot3266FuYvS",
14
"Randomness": "1yCuaCdaoPKonhhefo1RzauTCGhEyhpB2k54TjMqszNexQJ5T1",
15
"Value": "38249999999460",
16
"CoinDetailsEncrypted": "12jh5v2gPMSVoNJPVnrsi4vAyiDGnUkgMYHKM3v8cvZum8U9WWY",
17
"SNDerivator": "",
18
"AssetTag": ""
19
}],
20
"Fee": 100,
21
"HasPrivacy": false,
22
"TokenID": null,
23
"Metadata": null,
24
"Info": "",
25
"CoinCache": {
26
"Indexes": [4, 3],
27
"Commitments": [
28
"12iVg2mTehTpMxvkMChkzVUhUswmJKmVDxiJZVyt7VRY6hXtjJS",
29
"1mgvscU21mMmLS5sFksrwtN8XBCTbavQovQLR7xgjBbTEgvNDD"
30
],
31
"PublicKeys": [
32
"1kvBKj1yxpy8aazcNEcGHtChxEppFscytoXEiybva3HEtZXjNp",
33
"128kPvNRT6NsowdNTymKJ9BZTWrKBkeUUurRwzfVH9m7Ni88VRj"
34
],
35
"AssetTags": []
36
},
37
"TokenParams": {
38
"PaymentInfo": [],
39
"InputCoins": [{
40
"Version": "1",
41
"Info": "",
42
"Index": "",
43
"PublicKey": "12vM99DZPnpNZnwKXCJwuK1jA1B7ts99uuAwkpgAqEf22sYhVTZ",
44
"Commitment": "1e3Kg51cGLeroMdun5hbFLo6SY6QxXpqPiWbmSqkWh22L25vz8",
45
"KeyImage": "12WB74JEZ3Gfv1mu2AeZd7aK6XiV7rDfZY5GVzrES8zkLRSdaSV",
46
"SharedRandom": "",
47
"SharedConcealRandom": "",
48
"TxRandom": "",
49
"Randomness": "12BbmwHNRY5ivsZ7EgjpuTamhiBbgS8Ub8vM3Wq6fKUTn48u9hb",
50
"Value": "50000",
51
"CoinDetailsEncrypted": "",
52
"SNDerivator": "1WA1PQWXAwZ9Szfm5a8rNoAdTZDvryjyL6kntceVherTWhHeLe",
53
"AssetTag": ""
54
}],
55
"TokenID": "699a3006d1865ebdc437053b33df6a62c6c7c2f554f2fd0adf99a60f5117f945",
56
"CoinCache": null
57
}
58
}
Copied!
Resulting TX:
1
{
2
"Tx": {
3
"Version": 2,
4
"Type": "tcv",
5
"LockTime": 1609823151,
6
"Fee": 100,
7
"Info": "",
8
"SigPubKey": "CAEBAwEDAQQBBAECAQQBAgEC",
9
"Sig": "AiB+aIJRfqEKiNtiAqYz...",
10
"Proof": "AgAAAuIBpeId2...",
11
"PubKeyLastByteSender": 170,
12
"Metadata": null
13
},
14
"TxTokenPrivacyData": {
15
"PropertyID": "699a3006d1865ebdc437053b33df6a62c6c7c2f554f2fd0adf99a60f5117f945",
16
"PropertyName": "",
17
"PropertySymbol": "",
18
"SigPubKey": "/NPaKTA3pYTjYxdWpSvOlsp+hAzbwc6Q8x0qynd2+ao=",
19
"Sig": "obkcXKS1hE7nL7c7uG9CbJ9WJgtvvGAEl6DpL74iYAmTV+mMvDcBcp7lMyorOGfAkPbROqynr+E1TelVtTcLBg==",
20
"Proof": "/wGpIPzT2ikwN6WE4...",
21
"Type": 1,
22
"Mintable": false
23
}
24
}
Copied!
A converted output coin does not have its amount hidden; but once it is spent, later output coins from it do hide their amounts.
Last modified 10mo ago