-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightwallet Daemon Mode, Watchonly Daemon Mode Inital Code #1003
Conversation
1. To run a server like this. All you need to do is run Veild with the flag -watchonly=1 placed in the veil.conf | ||
2. Then you can setup a api server to act as the passthrough to the veild via rpc commands | ||
2. On your local desktop, you must have the ability to launch veild with the flag -lightwallet=1. This flag makes veild act like a light wallet. It will not connect to peers, it will not sync the blockchain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. To run a server like this. All you need to do is run Veild with the flag -watchonly=1 placed in the veil.conf | |
2. Then you can setup a api server to act as the passthrough to the veild via rpc commands | |
2. On your local desktop, you must have the ability to launch veild with the flag -lightwallet=1. This flag makes veild act like a light wallet. It will not connect to peers, it will not sync the blockchain. | |
1. To run a server like this, all you need to do is run Veild with the flag `watchonly=1` placed in your veil.conf file. | |
2. Then you can setup an API server to act as the passthrough to this veild via RPC commands. | |
2. On your local desktop, you must have the ability to launch veild with the flag `-lightwallet=1`. This flag makes veild act like a light wallet. It will not connect to peers, and it will not sync the blockchain. |
----------------------------------------- | ||
|
||
## Importing Address | ||
Use watchonlyurl/importlightaddress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs: I'm not clear on this--are these RPC commands? Can you format it more nicely like importlightaddress <scansecret> <spendpublic> [<createdheight>]
to look more like the help output of RPC commands?
"pubkey_hash": "my7xLMLK5BeDJHq6tf3H6AMKosv9wnnZzc", | ||
"valueCommitment": "08dc7489a9453f4521dc21306326ef4361819791702d61c1df90042b87104af59c", | ||
"data_hex": "0309ad0806a60ab71a70fb9c05b1121c8a7a6e46019369b16b8a5b5b231fda9248", | ||
"raw": "02000000000000008c978b71472dc68831772d23b978dfa0c962acc2bdd9590d9d961a9b359033d501013cf4c74d7210521febdc4df0ce13dd9895a888ad95ca1743e49d3707b59fa5920200000002bc4f8e069f48fd78a60d3b8d306f38350102b265001c5b5b9dce6c92a23bca6a08dc7489a9453f4521dc21306326ef4361819791702d61c1df90042b87104af59c210309ad0806a60ab71a70fb9c05b1121c8a7a6e46019369b16b8a5b5b231fda9248fd040a451f656a8e0f02697437a45fb7d38825bb63a7d26b5af832cefc1deb0a31da74cc7c438e2a167a388fc560e729b6624e1561669222ad48513a7aa80c9f2731e9e6b9e160ba3c7e6f15bb5af08a6dcbe933da81630671ce238dbcfe7c51f45136d479e35df41f7e4ce747b5002686b8db7156b2a05f000b89c7132b1c21e34583134c40e82363b8299a6b58a4fe8626820d629906cd8cf0ea85b19966a7322a6ca7ec5401517ea372f98de31e9c1b81f6deeda3f6fef82c04e097f95ac21e6db9a5a9d8444d2247fb3ce800f7fb89dd879027539d0afc845fe002b9f66516a7b2cd8289198ec72912ebc172ca0ca93ae4dc9b73cc69793148a0c1369aa68b9308cec719ada73122d220ca21d861b6fb9ad5a7d9b0b9e9405232316c9336b29ca671b523fdffc90068ba3345f427ac4fc3264e45eb8a4e73b8fa6cb6aeccbb4fb871efc7a3aa7194d5493543594bb6d0b4366806b39cbe369f6183a3d4c3b4bc49d5fceea8430bd74a717a519b9ec9e9d1045ae1e53a8483192b91f6c68b9275676500f9bec87e04eef1ca60ffd65ee3205510c63b7141c22b5eccda41f4d47c2f7db450980c9f22bd404435b9a0d8959c4a50e213bb9960e611e14f920a9df1db250c350a4cfc383e495cf96a21e0984ac63527fb81079ef2018003f028d7877620beed42a529fe15633457ea4fc911d82ad6cede24b82f3e875a45d492e5582ae7cc9006315d0571f8aeaa7d19c47eb2de61ffe662689900737478f51d024eabe42c4470680421ba8f7a8dc9d6ad497618948ea24c43cb7abc7c7499019cd9166017e4ff9d0e0658ebcba901ffc73d295e41f04cb792efe71428d05b421c51431f7e376a206007151cdbf601287a634d38039d96c8f37797d2596916b55897fe58050e85a265ef57dd969cf31d989d0f4ff30f7464dfe191a8f771015136e56c50aa9fc16e939a6cb762c714f982f4ac2e4fb8357a866487298b88e3ec2eaafebc14566d6f26e981196d3588ea5c0447035f24730c1928be323ddfa6a871ceb81c1d3a8fa9778479c8eab76c1895896528d083f6f3041840c8bb0890dd30f262f7e2253ae83db23b7d4bedbfc6e1e8910ece79b6dff85666c33705540641c0dd782732f25f3c966ea26e338a808b8a081f3a05ec40599c6aa404317e4fd1cd7823cd8fb96c6c66f38abd072e76b9cbb45216766302fe1b08c33b223cdd4e66d5d038bfd3e280f946dcc86d8992b619f56ced984fc215e39e0e7be58094ca2a5591b0ee708b1cea55a23acef6ce8cb53a2f2aaa7b6f78ede270771a45b13a49cc05b0e477063fd4e0fc092450079abc45f0631d542075dbd3a3f58bde3d7c2da144d88cce85bce386d6cc7ce90ce35ac8da757439b56729d8573dd6e222b0fffb13ec23f7b9f6ff9efc03180c1461757fb0b2a327075cdf72af112e36f028ea52c37a93110dc090a8b1462519105b1ecbd56d83819fdee4cbcd8f7d26a1cc4c09e552a20c6ffeaae7536efea5d8b904ab153c97e9bc6931dc260af24025018f354f691baeea436d2fa552c74fff6b9c48e02df5563990851a4c6839a0292ccfe377059fec486a40c61dc17bc5e49e746d4b23b929fb5c291efd23b2674efcf60ab60e94c0fb0fcd2140328f3dcbed50ec5a58175353d17a77be9812587b1a7506d14fe8b84bb0b85a41a910d21e369fee98baaae2c262032a043731be4e45321e7d99f73e84775dde82bb54a751ce16a20177525f00b4e8776f47d1c0b28c1468b8563efabbbc2ee25c96bee828f8378f098f72ebc7c4192dc2e89a666282fe16afff04e6df9cd0f5bf8d82d25a68e4389ff568b4497b939be0dc328f005f305c5073361283bd4ba45d2ca8bc40309ef6c4c7c5f1df17f0966468c11ae0b8ed39bfefd1632f9820bc9270bc4a52bc4ab9b1423c264963309f19332050d98114a65cee861d2298948508956edc17b736fad70712e2e9ab2d3d63f5c9a475ee41fc34260adafe054d70f09117da8215d4acdf3ca3765893814f73e1ae00b95b591e49a56acccf8b73019c1b30081c49c179b46050a19e2371ee4ba24060eeeb2e8f2f9f40c4e6496804ba628e6a82b3bed834dc6cd2d47d6d6a2cfa69c7054fdbf30ef960bfdf1a1528c4a7034c35bfccb8433baa1fcc1baee704a826f9cff43cede5a7b3c29f09652cf6f54d78d7d86f924c97eb98c0d0061f24dd8a61866975d5ad89fb2a3a6ff28e962a9eafc0c76aae98d958bf4796c2f88a504572a8d4ca13fbb198f517c1ee5b80f30e3256c45901460c21688f42a3c20474f7e52cffc56abae00be3f771d2b5aa5c5ff0bc97175dd2f53f273ba4888a48783e5b8fe493cd548edb04cf2b0dfef9e8a6219ebff69965eb972653f9095eb34d3a6771770e064b66388f12f500f8c02283866ba913cdab6bced0592c12b8fbc2686fea022a77f28eea42fab7f39a1d76391d96e452e6806692abaf27814c1767cdb6d26f1a54a374d921a4492256ccb288dbe6aa5e548381693200a24c89c8041fb0cce877b8c3ca042149f83f56e84abdfd2cd8d111115318c33ab4f84616df836af42441f5136cd11ff219eade8607b5ba90384f555bb195669b0d85a1ae7d802c9cf98614d930ff6283a7c106a5d8456663c528322897108d2a41ef1fd6436b95fbe0c5cd1ebcae76433bac3b78523549e885c51c4a36aba276ad0d165aad198f14d4d231de20abd08b31eb7e3890b399a94b9c73caf1df21628b5a3d0a06b0fca309fd50bd45f2a29a80e4b9fd9daba8dcf7c0e239b2cd0a3156764c81a012d41493b7258ee6c7aef19c33972f0d20c161bc6b9b2f7cd7f9858a2f898bed4037d478c2960df849ff2b6fe85ab1d758223885f568a2af5f150fbe3c2132a34bbe69a30879a4822880c282ab6d0a85b146d46b1bfae9be59f6f6ad12afee16972a055b00d3e2556904df397fecf606902c887d77ee7a39eb45c1b11ebcbd96b4ed4398a5e792016fbace821417349c9b50c5d729d335e1f55eae66bb75c88e53f665c6fa9b45c9674537ba6234e3ced2b2520021ece2783ecaad4f027b8590f1bc1e436a7f1a611f0fedce9f9acfb698f6e304b1eb7c5a7c620791d6ce46052500710ca28ff7db37c2571957526279631cbb2b7358b527b6fd702cd169b1887e8652a3b967c598a4f1dfe4f47a469c39745b80bee5785646a574e5640b718222821512a06a1389411cd4e6293f05d2b84e1a36fe98a8632fa4ddf32cd2391120326212c4d98db128ad16456b2a468114305a83ffc763df4693298f2c80b86b5671db9f29e85debce2c1367b309558431c37fb993fdc0808aebe3b043cb428696bf4c52f285eef87314209ef2af11e8d9185c18fb79770c25fb41d822023008793807b49b2ee38a11b6b2b186db469afd6a7e23ee4c863d985f71f45d5ab790939eb04b94925a754e86e627c7bdc7a92dbc02dbe59c86067fcab42fcaf99ec9b4aa8a45445478eb90bedcfbfdc7368a0a6278566924fef6d5457eb44cf7538e863a3088928bc874a6b5744d33e3b3c64d18c91e43a03749d421709ba9c0da1cd06498eb75f3827d9cfc5cfffa8c94b41bafaf9b93d9352c1b47690478242cd9455558b9764c55e2dfe5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"raw": "02000000000000008c978b71472dc68831772d23b978dfa0c962acc2bdd9590d9d961a9b359033d501013cf4c74d7210521febdc4df0ce13dd9895a888ad95ca1743e49d3707b59fa5920200000002bc4f8e069f48fd78a60d3b8d306f38350102b265001c5b5b9dce6c92a23bca6a08dc7489a9453f4521dc21306326ef4361819791702d61c1df90042b87104af59c210309ad0806a60ab71a70fb9c05b1121c8a7a6e46019369b16b8a5b5b231fda9248fd040a451f656a8e0f02697437a45fb7d38825bb63a7d26b5af832cefc1deb0a31da74cc7c438e2a167a388fc560e729b6624e1561669222ad48513a7aa80c9f2731e9e6b9e160ba3c7e6f15bb5af08a6dcbe933da81630671ce238dbcfe7c51f45136d479e35df41f7e4ce747b5002686b8db7156b2a05f000b89c7132b1c21e34583134c40e82363b8299a6b58a4fe8626820d629906cd8cf0ea85b19966a7322a6ca7ec5401517ea372f98de31e9c1b81f6deeda3f6fef82c04e097f95ac21e6db9a5a9d8444d2247fb3ce800f7fb89dd879027539d0afc845fe002b9f66516a7b2cd8289198ec72912ebc172ca0ca93ae4dc9b73cc69793148a0c1369aa68b9308cec719ada73122d220ca21d861b6fb9ad5a7d9b0b9e9405232316c9336b29ca671b523fdffc90068ba3345f427ac4fc3264e45eb8a4e73b8fa6cb6aeccbb4fb871efc7a3aa7194d5493543594bb6d0b4366806b39cbe369f6183a3d4c3b4bc49d5fceea8430bd74a717a519b9ec9e9d1045ae1e53a8483192b91f6c68b9275676500f9bec87e04eef1ca60ffd65ee3205510c63b7141c22b5eccda41f4d47c2f7db450980c9f22bd404435b9a0d8959c4a50e213bb9960e611e14f920a9df1db250c350a4cfc383e495cf96a21e0984ac63527fb81079ef2018003f028d7877620beed42a529fe15633457ea4fc911d82ad6cede24b82f3e875a45d492e5582ae7cc9006315d0571f8aeaa7d19c47eb2de61ffe662689900737478f51d024eabe42c4470680421ba8f7a8dc9d6ad497618948ea24c43cb7abc7c7499019cd9166017e4ff9d0e0658ebcba901ffc73d295e41f04cb792efe71428d05b421c51431f7e376a206007151cdbf601287a634d38039d96c8f37797d2596916b55897fe58050e85a265ef57dd969cf31d989d0f4ff30f7464dfe191a8f771015136e56c50aa9fc16e939a6cb762c714f982f4ac2e4fb8357a866487298b88e3ec2eaafebc14566d6f26e981196d3588ea5c0447035f24730c1928be323ddfa6a871ceb81c1d3a8fa9778479c8eab76c1895896528d083f6f3041840c8bb0890dd30f262f7e2253ae83db23b7d4bedbfc6e1e8910ece79b6dff85666c33705540641c0dd782732f25f3c966ea26e338a808b8a081f3a05ec40599c6aa404317e4fd1cd7823cd8fb96c6c66f38abd072e76b9cbb45216766302fe1b08c33b223cdd4e66d5d038bfd3e280f946dcc86d8992b619f56ced984fc215e39e0e7be58094ca2a5591b0ee708b1cea55a23acef6ce8cb53a2f2aaa7b6f78ede270771a45b13a49cc05b0e477063fd4e0fc092450079abc45f0631d542075dbd3a3f58bde3d7c2da144d88cce85bce386d6cc7ce90ce35ac8da757439b56729d8573dd6e222b0fffb13ec23f7b9f6ff9efc03180c1461757fb0b2a327075cdf72af112e36f028ea52c37a93110dc090a8b1462519105b1ecbd56d83819fdee4cbcd8f7d26a1cc4c09e552a20c6ffeaae7536efea5d8b904ab153c97e9bc6931dc260af24025018f354f691baeea436d2fa552c74fff6b9c48e02df5563990851a4c6839a0292ccfe377059fec486a40c61dc17bc5e49e746d4b23b929fb5c291efd23b2674efcf60ab60e94c0fb0fcd2140328f3dcbed50ec5a58175353d17a77be9812587b1a7506d14fe8b84bb0b85a41a910d21e369fee98baaae2c262032a043731be4e45321e7d99f73e84775dde82bb54a751ce16a20177525f00b4e8776f47d1c0b28c1468b8563efabbbc2ee25c96bee828f8378f098f72ebc7c4192dc2e89a666282fe16afff04e6df9cd0f5bf8d82d25a68e4389ff568b4497b939be0dc328f005f305c5073361283bd4ba45d2ca8bc40309ef6c4c7c5f1df17f0966468c11ae0b8ed39bfefd1632f9820bc9270bc4a52bc4ab9b1423c264963309f19332050d98114a65cee861d2298948508956edc17b736fad70712e2e9ab2d3d63f5c9a475ee41fc34260adafe054d70f09117da8215d4acdf3ca3765893814f73e1ae00b95b591e49a56acccf8b73019c1b30081c49c179b46050a19e2371ee4ba24060eeeb2e8f2f9f40c4e6496804ba628e6a82b3bed834dc6cd2d47d6d6a2cfa69c7054fdbf30ef960bfdf1a1528c4a7034c35bfccb8433baa1fcc1baee704a826f9cff43cede5a7b3c29f09652cf6f54d78d7d86f924c97eb98c0d0061f24dd8a61866975d5ad89fb2a3a6ff28e962a9eafc0c76aae98d958bf4796c2f88a504572a8d4ca13fbb198f517c1ee5b80f30e3256c45901460c21688f42a3c20474f7e52cffc56abae00be3f771d2b5aa5c5ff0bc97175dd2f53f273ba4888a48783e5b8fe493cd548edb04cf2b0dfef9e8a6219ebff69965eb972653f9095eb34d3a6771770e064b66388f12f500f8c02283866ba913cdab6bced0592c12b8fbc2686fea022a77f28eea42fab7f39a1d76391d96e452e6806692abaf27814c1767cdb6d26f1a54a374d921a4492256ccb288dbe6aa5e548381693200a24c89c8041fb0cce877b8c3ca042149f83f56e84abdfd2cd8d111115318c33ab4f84616df836af42441f5136cd11ff219eade8607b5ba90384f555bb195669b0d85a1ae7d802c9cf98614d930ff6283a7c106a5d8456663c528322897108d2a41ef1fd6436b95fbe0c5cd1ebcae76433bac3b78523549e885c51c4a36aba276ad0d165aad198f14d4d231de20abd08b31eb7e3890b399a94b9c73caf1df21628b5a3d0a06b0fca309fd50bd45f2a29a80e4b9fd9daba8dcf7c0e239b2cd0a3156764c81a012d41493b7258ee6c7aef19c33972f0d20c161bc6b9b2f7cd7f9858a2f898bed4037d478c2960df849ff2b6fe85ab1d758223885f568a2af5f150fbe3c2132a34bbe69a30879a4822880c282ab6d0a85b146d46b1bfae9be59f6f6ad12afee16972a055b00d3e2556904df397fecf606902c887d77ee7a39eb45c1b11ebcbd96b4ed4398a5e792016fbace821417349c9b50c5d729d335e1f55eae66bb75c88e53f665c6fa9b45c9674537ba6234e3ced2b2520021ece2783ecaad4f027b8590f1bc1e436a7f1a611f0fedce9f9acfb698f6e304b1eb7c5a7c620791d6ce46052500710ca28ff7db37c2571957526279631cbb2b7358b527b6fd702cd169b1887e8652a3b967c598a4f1dfe4f47a469c39745b80bee5785646a574e5640b718222821512a06a1389411cd4e6293f05d2b84e1a36fe98a8632fa4ddf32cd2391120326212c4d98db128ad16456b2a468114305a83ffc763df4693298f2c80b86b5671db9f29e85debce2c1367b309558431c37fb993fdc0808aebe3b043cb428696bf4c52f285eef87314209ef2af11e8d9185c18fb79770c25fb41d822023008793807b49b2ee38a11b6b2b186db469afd6a7e23ee4c863d985f71f45d5ab790939eb04b94925a754e86e627c7bdc7a92dbc02dbe59c86067fcab42fcaf99ec9b4aa8a45445478eb90bedcfbfdc7368a0a6278566924fef6d5457eb44cf7538e863a3088928bc874a6b5744d33e3b3c64d18c91e43a03749d421709ba9c0da1cd06498eb75f3827d9cfc5cfffa8c94b41bafaf9b93d9352c1b47690478242cd9455558b9764c55e2dfe5" | |
"raw": "02000000000000008c978b71[...]" |
No need to have the whole thing.
## Checking if utxo is spent | ||
1. Fetch UTXO using getwatchonlytxes | ||
2. Get the keyimages from the txes using the lightwallet server | ||
1. rpc command (getkeyimages \"[txdata]\" \"spend_secret\" \"scan_secret\" \"spend_public\") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. rpc command (getkeyimages \"[txdata]\" \"spend_secret\" \"scan_secret\" \"spend_public\") | |
1. rpc command `getkeyimages \"[txdata]\" \"spend_secret\" \"scan_secret\" \"spend_public\"` |
"spent": false, | ||
} | ||
``` | ||
####S pent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
####S pent | |
#### Spent |
## Prerequisites | ||
1. You have a ringct wallet that has a balance | ||
2. You have the ability to generate the following keys for the given address | ||
1. Spend Secret Key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs instructions on how to generate these. Or they should be retrievable in the lightwallet itself so the user doesn't have to grab all these themselves (ideally the commands shouldn't have to prompt for them in that case, only check that the wallet is unlocked).
@@ -0,0 +1,158 @@ | |||
// Copyright (c) 2021 The Flux Core developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a line for Veil.
/** Global variable that points to the active watchonly database (protected by cs_main) */ | ||
extern std::unique_ptr<CWatchOnlyDB> pwatchonlyDB; | ||
|
||
//class CWatchOnlyTX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this if it's dead.
@@ -0,0 +1,127 @@ | |||
// Copyright (c) 2021 The Flux Core developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a line for Veil.
@@ -0,0 +1,58 @@ | |||
// Copyright (c) 2021 The Flux Core developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a line for Veil.
@Zannick Was there any issues related to the code or just the documentation of the code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 317f313
I don't know what happened to my other comment, maybe I changed my mind and removed it. My opinion on the code was that it seemed much like copied and modified code from elsewhere and so it was hard to follow what the new elements were; I was not able to finish the code review at that time. But I do not want to block this review on a refactor. So, the majority of comments for this pass are on documentation, and then in a couple of days I will make another pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 317f313
I'd still like to see improvements to the documentation before release, but I'm okay with a separate PR for that.
I'll take a day or so at least of testing, and maybe that will enable me to clarify the instructions a bit. |
@blondfrogs What can I do to test this? Can we use a Zelcore wallet in testnet mode? I have run in lightwallet mode, but not with every required component. But right now (when trying on testnet) I'm getting:
|
Not waiting for any further reviews. I've been running this on numerous active wallets for some time, so it at least doesn't break normal wallet operation. Time for Zelcore wallet. |
This is the first PR which includes the needed code for lightwallet ringct and stealth transactions.
the flag -lightwallet is added. If this flag is added to the veil.conf or as a startup flag this daemon will only act as an RPC server. It will not sync blocks, it will not connect to peers. This daemon will be used for building the ringct and stealth transactions.
the flag -watchonly is added. If this flag is added to the veil.conf or as a startup flag this daemon will act like a fullnode, however will not have a functional wallet. So we don't send veil to this wallets addresses. This daemon will act like the backend server which light wallet clients will connect to to retrieve information about their stealth addresses.
This PR has been tested on testnet as a normal veil node, lightwallet, and watchonly node. The node functions correctly in all states.
If you want to know more information on how lightwallet transactions work please visit the new README file in doc/lightwallet.md