Skip to content
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

get_stored_tx might be providing wrong slate which sometimes breaks tx posting #637

Open
marekyggdrasil opened this issue Jan 6, 2022 · 0 comments

Comments

@marekyggdrasil
Copy link

( please forgive me for not following the regular bug report scheme, this is a copy paste from #470 (comment) as @yeastplume requested to post it as separate issue )

Mainnet

Disclaimer

Those are tests run on Mainnet using real GRIN, however wallets were created just for those tests and own only negligible amount of coins. If you are reading it after the year 2039 and you figure out how to steal those coins based on the information below, please proceed and buy yourself a house on Mars.

CLI

Two wallets, alice and wallet2 (bob's not around today). Let's get their addresses.

$ grin-wallet -t /home/marek/wallets/alice -p "" address
20220106 02:28:09.715 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:28:09.715 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:28:09.715 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:28:09.715 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:28:10.140 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 02:28:10.142 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed

Address for account - default
-------------------------------------
grin1ugpltmnq9ey3jmgrus082tx52qkrs5tcc2zdmykqut796wtpmfdsrk6yj9

Command 'address' completed successfully
$ grin-wallet -t /home/marek/wallets/wallet2 -p "" address
20220106 02:29:11.392 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:29:11.392 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:29:11.392 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:29:11.392 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:29:11.796 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/wallet2/wallet_data/db/lmdb is 134217728
20220106 02:29:11.797 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/wallet2/wallet_data/wallet.seed

Address for account - default
-------------------------------------
grin1nzt5eee6ytka282a8w5rcj3k66t3rjytcqqmcdptepnhz4spsysqa9xckw

Command 'address' completed successfully

now (using CLI) let alice receive 0.001ツ from wallet2

$ grin-wallet -t /home/marek/wallets/alice -p "" invoice 0.001 -d grin1nzt5eee6ytka282a8w5rcj3k66t3rjytcqqmcdptepnhz4spsysqa9xckw
20220106 02:30:49.399 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:30:49.400 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:30:49.400 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:30:49.400 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:30:49.844 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 02:30:49.846 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 02:30:49.906 DEBUG grin_core::libtx::build - Building output: 1000000, Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976)
/home/marek/wallets/alice/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I1.slatepack

Slatepack data follows. Please provide this output to the other party

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. AXF64tLCdFBiixa cEbSSorqeRN1amc Razh4CbTPnU455r HEJtyFWa2objjCd FDwRfRFPES8frST GyAqHyP2NC62xUd JbVzSo1HcYMCs3M CNzPLb7QdMxeVDw C7yjfCxdd6zPLQn 3yay92SwVcdACxC g9kSbhuXe4VhEbT YBPGnVmXZb3363a GcMtLpSgJAW7EnA AMdm9oCExPeJkyD 6P2iMiV5H5jXBgX s4sXCVDcjApiGG6 yWVMg6nfbuZiBb1 PjmXpT858sKnidE ZbuyaxQ6anLUJVL 8c1E7BEDtk1nP43 ij3pEFdggoKSLdz qVohHF1TugrRyDM EfxBPMUtrtjYfkc hLMSw5DwzWmfNBf u7yXARKDsMJYckQ SJn5aMQkg8BXTzB cnqdb8uc1w6XkTB ZDS9V79iQL6FeCq v8wemDeztB8Fq13 ccXYNKkug3Rk1WS btnmfoUR397YmNu 39Jv1uqw1hz8L31 wiSgstVp2uZKV3L 6N72HQTo8eu6jBF dVzpdGhGqu5Piw3 2vt7shF8r9EH4RA hY5RtqD4AkjehUH vK4AFeUixRMoymg WCMRPhQhTxE3iuZ m55F77PjFWtdm7U 34RLNnJVYtZ6ctf sfrLHa3YjCVgmya WuhcjV5EYSxpDm6 K1ukeGRfj7mJPJV df7Rh8wKc8VZ2ks esoXXrSq2D2Vcfp BCgy. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/home/marek/wallets/alice/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I1.slatepack

The slatepack data is encrypted for the recipient only

Command 'invoice' completed successfully

now wallet2 will pay

$ grin-wallet -t /home/marek/wallets/wallet2 -p "" pay
20220106 02:31:58.220 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:31:58.220 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:31:58.220 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:31:58.220 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:31:58.628 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/wallet2/wallet_data/db/lmdb is 134217728
20220106 02:31:58.630 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/wallet2/wallet_data/wallet.seed
Please paste your encoded slatepack message:
BEGINSLATEPACK. AXF64tLCdFBiixa cEbSSorqeRN1amc Razh4CbTPnU455r HEJtyFWa2objjCd FDwRfRFPES8frST GyAqHyP2NC62xUd JbVzSo1HcYMCs3M CNzPLb7QdMxeVDw C7yjfCxdd6zPLQn 3yay92SwVcdACxC g9kSbhuXe4VhEbT YBPGnVmXZb3363a GcMtLpSgJAW7EnA AMdm9oCExPeJkyD 6P2iMiV5H5jXBgX s4sXCVDcjApiGG6 yWVMg6nfbuZiBb1 PjmXpT858sKnidE ZbuyaxQ6anLUJVL 8c1E7BEDtk1nP43 ij3pEFdggoKSLdz qVohHF1TugrRyDM EfxBPMUtrtjYfkc hLMSw5DwzWmfNBf u7yXARKDsMJYckQ SJn5aMQkg8BXTzB cnqdb8uc1w6XkTB ZDS9V79iQL6FeCq v8wemDeztB8Fq13 ccXYNKkug3Rk1WS btnmfoUR397YmNu 39Jv1uqw1hz8L31 wiSgstVp2uZKV3L 6N72HQTo8eu6jBF dVzpdGhGqu5Piw3 2vt7shF8r9EH4RA hY5RtqD4AkjehUH vK4AFeUixRMoymg WCMRPhQhTxE3iuZ m55F77PjFWtdm7U 34RLNnJVYtZ6ctf sfrLHa3YjCVgmya WuhcjV5EYSxpDm6 K1ukeGRfj7mJPJV df7Rh8wKc8VZ2ks esoXXrSq2D2Vcfp BCgy. ENDSLATEPACK.

This command will pay the amount specified in the invoice using your wallet's funds.
After you confirm, the following will occur: 

* 0.001000000 of your wallet funds will be added to the transaction to pay this invoice.
* The wallet will IMMEDIATELY attempt to send the resulting transaction to the wallet listening at: 'grin1ugpltmnq9ey3jmgrus082tx52qkrs5tcc2zdmykqut796wtpmfdsrk6yj9'.
* If other wallet is not listening, the resulting transaction will output as a slatepack which you can manually send back to the invoice creator.

Please review the above information carefully before proceeding

To proceed, type the exact amount of the invoice as displayed above (or Q/q to quit) > 0.001000000
20220106 02:32:17.172 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 02:32:17.178 DEBUG grin_wallet_libwallet::internal::selection - Building change outputs: total change: 976000000 (1 outputs)
20220106 02:32:17.190 DEBUG grin_core::libtx::build - Building output: 976000000, Commitment(090d2830d04373cf36b10722421b3a1bee9ecb091604758eb0e93e70e30e809c5d)
20220106 02:32:17.289 DEBUG grin_core::libtx::build - Building input (spending regular output): 1000000000, 0300000000000000000000000000000000
20220106 02:32:17.301 INFO grin_wallet_controller::command - Invoice processed: 0.001000000 grin (strategy 'smallest')
20220106 02:32:17.301 WARN grin_wallet_api::owner - Attempting to send transaction via TOR
20220106 02:32:17.301 INFO grin_wallet_impls::adapters::http - Starting TOR Process for send at Some(127.0.0.1:59050)
20220106 02:32:17.322 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.322 [notice] Tor 0.3.5.16 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma 5.2.4, and Libzstd 1.3.8.
20220106 02:32:17.322 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.322 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
20220106 02:32:17.323 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.323 [notice] Read configuration file "/home/marek/wallets/alice/tor/sender/torrc".
20220106 02:32:17.329 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.329 [warn] Path for DataDirectory (./data) is relative and will resolve to /home/marek/wallets/alice/tor/sender/./data. Is this what you wanted?
20220106 02:32:17.330 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.330 [notice] Opening Socks listener on 127.0.0.1:59050
20220106 02:32:17.330 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.330 [notice] Opened Socks listener on 127.0.0.1:59050
20220106 02:32:17.349 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.000 [notice] Bootstrapped 0%: Starting
20220106 02:32:17.774 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:17.000 [notice] Starting with guard context "default"
20220106 02:32:18.335 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:18.000 [notice] Bootstrapped 5%: Connecting to directory server
20220106 02:32:18.426 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:18.000 [notice] Bootstrapped 10%: Finishing handshake with directory server
20220106 02:32:18.743 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:18.000 [notice] Bootstrapped 15%: Establishing an encrypted directory connection
20220106 02:32:18.834 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:18.000 [notice] Bootstrapped 20%: Asking for networkstatus consensus
20220106 02:32:18.925 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:18.000 [notice] Bootstrapped 25%: Loading networkstatus consensus
20220106 02:32:19.740 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:19.000 [notice] I learned some more directory information, but not enough to build a circuit: We have no usable consensus.
20220106 02:32:19.831 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:19.000 [notice] Bootstrapped 40%: Loading authority key certs
20220106 02:32:20.235 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services.
20220106 02:32:20.236 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] Bootstrapped 45%: Asking for relay descriptors for internal paths
20220106 02:32:20.236 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 0/6850, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of end bw (no exits in consensus, using mid) = 0% of path bw.)
20220106 02:32:20.250 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 0/6850, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of end bw (no exits in consensus, using mid) = 0% of path bw.)
20220106 02:32:20.300 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] Bootstrapped 50%: Loading relay descriptors for internal paths
20220106 02:32:20.449 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] The current consensus contains exit nodes. Tor can build exit and internal paths.
20220106 02:32:20.692 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] Bootstrapped 55%: Loading relay descriptors
20220106 02:32:20.798 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] Bootstrapped 62%: Loading relay descriptors
20220106 02:32:20.992 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:20.000 [notice] Bootstrapped 67%: Loading relay descriptors
20220106 02:32:21.050 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:21.000 [notice] Bootstrapped 73%: Loading relay descriptors
20220106 02:32:21.103 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:21.000 [notice] Bootstrapped 80%: Connecting to the Tor network
20220106 02:32:21.344 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:21.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
20220106 02:32:21.361 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:21.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
20220106 02:32:21.475 DEBUG grin_wallet_impls::tor::process - Jan 06 02:32:21.000 [notice] Bootstrapped 100%: Done
20220106 02:32:21.476 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
20220106 02:32:21.503 DEBUG grin_wallet_api::owner - Send (TOR): Could not send Slate via TOR: Client Callback Error: Performing version check (is recipient listening?): Request error: Cannot make request: error sending request for url (http://4ib7l3tafzers3id4qphklgukawdqulyykcn3ewa4l6f2olb3jnxesad.onion/v2/foreign): error trying to connect: dns error: failed to lookup address information: Name or service not known
20220106 02:32:21.503 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
20220106 02:32:21.503 DEBUG grin_wallet_api::owner - Unable to send via TOR: Client Callback Error: Performing version check (is recipient listening?): Request error: Cannot make request: error sending request for url (http://4ib7l3tafzers3id4qphklgukawdqulyykcn3ewa4l6f2olb3jnxesad.onion/v2/foreign): error trying to connect: dns error: failed to lookup address information: Name or service not known
20220106 02:32:21.503 WARN grin_wallet_api::owner - Unable to send transaction via TOR
20220106 02:32:21.531 DEBUG grin_wallet_libwallet::internal::selection - Change amount is: 976000000
/home/marek/wallets/wallet2/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I2.slatepack

Slatepack data follows. Please provide this output to the other party

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. 7TRxXVe61gfcDeg z9E3WZrU1rVzGMc ngj8Wn8a4iRqVCL 77xHcpauGZAD25e odmJWghNjsfzaUE sTMm7UAxgWb6prA v5QuvMJ6YthromY JBFTsicFZJJp2KF QATD6UsVovwrmYB UoRvyxxAyt9dbbX kKBq1KAif7b2RHP dsMBJs5FgvFW2vZ BLkYkzgFxe2TaaL 8dNnUCipiBvNwF3 25Yoqzv8anjtaHf HECw15HE4MocZPS fzvgeRdwFAhvFNt jB77KtYJnJKFxTi LoWjLxzPrvBqPwm kALt1FRrspE3Hmb ZMf2HbYRwfYCvDh qiRmyzPCH9aKPkN ehcEDtz5SUrFwMK tUujkjmn7e2Q6wF DX1FCXGjhjrQrrA Tfx6VkfLbcEKKy9 UZdFDLpKgofi2qq KyscTY3hVYXaZza qapf6Dv6qeSDU1h rvCiqPsPooAxYf2 EkGjDXZ5Wb134pq FsPKZ5GKT5FK2mE LXzb1ZPxF1uP9uw 7hbxvCZ1GZeBHrh ob3rJiZXZTqL4BW sJ8BFURfbXT8QTB a1ja94fioXYnRc8 mwYazeRKqaUpvXT emah3iT4hNwat6T tqym9FvMSTPsfwA mNFyzsQr219ju5S gFjyVMdPQDvKkvx mZwdKVtES1UkFcJ hNSM5UdAqMZWu7m aYYSRKkB78aiSTy bmgLXbE6ync8oMM ncrpnHSd7zRRPVy pGtCfFZLbcQLE2x bNV8MRzU2UA6CJ8 M8rf4TMVYoD6zE4 YuiJAq8Y1NJaR5w szNq2s2RJkVBhHK dTJE42GoBYejMir s8usbsri1w493rT rfhpZdMD4KcX3mi 5MfgPQujSk6sovV bmQtGZpSu8e3aQJ 5MmvfpY2Yfnv5WS AfhPmvQS5rMgu2q Jq3JRPamu5jbZuu nYxm2mtK9v3neoh GNzb1ekfGEnMq3F xnXc8QDDHAXBMZc b2hpNc9cccVoJHA 7TKb6QbxYNXAuL5 nTT1oFJSoNTT53j Pqx7tcK2nQcUJmw XQTCGZTuHC3tsVr kte71nFs8iNUSjL CqanjwFcN1nCqMc VGoSiFo3xevqWSG 5VsUjrAsi1Aq8Yr 2vwViEszAno8C3Y hYbpYoWu7Yc59m7 pa72TGPgf7EFucb YA19meQh6coku3v dq4QfYbosJQWP2J UAGNsjSutWVxksU ftdbeKf4QdZTDVE PKfCB8SGY1Q6Wz3 JBBtQXE4nzmSuv2 Y7sNvbTq7dMGBzU Tng6V5Z7qtkh85Q mwBXPRrfLmA8XxB HAoa3VfRDCeZQLj 9cjNwtKBqvvYtB8 qu854u6ohfbTsxT bcrytyDVudCdxFD ZgcP5iKttPXcWEf 2531AuaXhcpQzKD 8VaGPnjGjMUkAdx W5dYxCdYiRGAdxk pEiWkCrmyKfMKmt qrfLuSodvNFjcKS jFKAap9sqkJRJ4A fEGiBQR8MGQpfj8 dg42oc3kC8pwJrL M1UA8RS6LvztkLb zhHvTZDR9Xg4YYd 6TyMPp9XHCAas9A oh942n89WJof6LD TH4iM8oNnYiToao jTmHWpRm2qtN32i Fs58L91LXdnu77N Vy7fn4bqMGNrnpy EjVaDGTAHSAu18K YU8HCmBRLv2wMt5 KWng74AiKbmDw5f S6idBYLPohsJmjM tzvFd1mREWyfXBZ 7UPjZSwQEAJ6mnJ 6N9vnPg1pEeVLNt bxbeLj8dtMQkZSm KWvaEYQFdfS1N4Z 3arYeMfjBezMnvZ BaCMknReSN6xvsS ACMyGCztdETNjB4 vqHWHan1dMKy8S8 qwgp1sdF9VBHwNE rDZiWjdUZpARmPb xcWmjAuEyckJTd4 Eaji4bCDjcwroX7 ARuBJwNBL85ZBKK BYwv9QMJC4urmRo QAk4svmSt3ojvSk na9db8DkQFg3Qyh wsVUm9. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/home/marek/wallets/wallet2/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I2.slatepack

The slatepack data is encrypted for the recipient only

Command 'pay' completed successfully

and alice finalizes

$ grin-wallet -t /home/marek/wallets/alice -p "" finalize
20220106 02:33:50.070 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:33:50.070 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:33:50.070 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:33:50.070 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:33:50.473 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 02:33:50.475 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
Please paste your encoded slatepack message:
BEGINSLATEPACK. 7TRxXVe61gfcDeg z9E3WZrU1rVzGMc ngj8Wn8a4iRqVCL 77xHcpauGZAD25e odmJWghNjsfzaUE sTMm7UAxgWb6prA v5QuvMJ6YthromY JBFTsicFZJJp2KF QATD6UsVovwrmYB UoRvyxxAyt9dbbX kKBq1KAif7b2RHP dsMBJs5FgvFW2vZ BLkYkzgFxe2TaaL 8dNnUCipiBvNwF3 25Yoqzv8anjtaHf HECw15HE4MocZPS fzvgeRdwFAhvFNt jB77KtYJnJKFxTi LoWjLxzPrvBqPwm kALt1FRrspE3Hmb ZMf2HbYRwfYCvDh qiRmyzPCH9aKPkN ehcEDtz5SUrFwMK tUujkjmn7e2Q6wF DX1FCXGjhjrQrrA Tfx6VkfLbcEKKy9 UZdFDLpKgofi2qq KyscTY3hVYXaZza qapf6Dv6qeSDU1h rvCiqPsPooAxYf2 EkGjDXZ5Wb134pq FsPKZ5GKT5FK2mE LXzb1ZPxF1uP9uw 7hbxvCZ1GZeBHrh ob3rJiZXZTqL4BW sJ8BFURfbXT8QTB a1ja94fioXYnRc8 mwYazeRKqaUpvXT emah3iT4hNwat6T tqym9FvMSTPsfwA mNFyzsQr219ju5S gFjyVMdPQDvKkvx mZwdKVtES1UkFcJ hNSM5UdAqMZWu7m aYYSRKkB78aiSTy bmgLXbE6ync8oMM ncrpnHSd7zRRPVy pGtCfFZLbcQLE2x bNV8MRzU2UA6CJ8 M8rf4TMVYoD6zE4 YuiJAq8Y1NJaR5w szNq2s2RJkVBhHK dTJE42GoBYejMir s8usbsri1w493rT rfhpZdMD4KcX3mi 5MfgPQujSk6sovV bmQtGZpSu8e3aQJ 5MmvfpY2Yfnv5WS AfhPmvQS5rMgu2q Jq3JRPamu5jbZuu nYxm2mtK9v3neoh GNzb1ekfGEnMq3F xnXc8QDDHAXBMZc b2hpNc9cccVoJHA 7TKb6QbxYNXAuL5 nTT1oFJSoNTT53j Pqx7tcK2nQcUJmw XQTCGZTuHC3tsVr kte71nFs8iNUSjL CqanjwFcN1nCqMc VGoSiFo3xevqWSG 5VsUjrAsi1Aq8Yr 2vwViEszAno8C3Y hYbpYoWu7Yc59m7 pa72TGPgf7EFucb YA19meQh6coku3v dq4QfYbosJQWP2J UAGNsjSutWVxksU ftdbeKf4QdZTDVE PKfCB8SGY1Q6Wz3 JBBtQXE4nzmSuv2 Y7sNvbTq7dMGBzU Tng6V5Z7qtkh85Q mwBXPRrfLmA8XxB HAoa3VfRDCeZQLj 9cjNwtKBqvvYtB8 qu854u6ohfbTsxT bcrytyDVudCdxFD ZgcP5iKttPXcWEf 2531AuaXhcpQzKD 8VaGPnjGjMUkAdx W5dYxCdYiRGAdxk pEiWkCrmyKfMKmt qrfLuSodvNFjcKS jFKAap9sqkJRJ4A fEGiBQR8MGQpfj8 dg42oc3kC8pwJrL M1UA8RS6LvztkLb zhHvTZDR9Xg4YYd 6TyMPp9XHCAas9A oh942n89WJof6LD TH4iM8oNnYiToao jTmHWpRm2qtN32i Fs58L91LXdnu77N Vy7fn4bqMGNrnpy EjVaDGTAHSAu18K YU8HCmBRLv2wMt5 KWng74AiKbmDw5f S6idBYLPohsJmjM tzvFd1mREWyfXBZ 7UPjZSwQEAJ6mnJ 6N9vnPg1pEeVLNt bxbeLj8dtMQkZSm KWvaEYQFdfS1N4Z 3arYeMfjBezMnvZ BaCMknReSN6xvsS ACMyGCztdETNjB4 vqHWHan1dMKy8S8 qwgp1sdF9VBHwNE rDZiWjdUZpARmPb xcWmjAuEyckJTd4 Eaji4bCDjcwroX7 ARuBJwNBL85ZBKK BYwv9QMJC4urmRo QAk4svmSt3ojvSk na9db8DkQFg3Qyh wsVUm9. ENDSLATEPACK.
20220106 02:33:53.956 DEBUG grin_core::libtx::build - Building output: 1000000, Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976)
20220106 02:33:54.036 DEBUG grin_wallet_libwallet::slate - Final Tx excess: Commitment(08eaac24df8c85d56bb7a9d6029cb289ae0fdc76e6d0b956a2323d0f4cee5abc63)
20220106 02:33:54.036 DEBUG grin_wallet_libwallet::slate - Validating final transaction
20220106 02:33:54.096 DEBUG grin_wallet_libwallet::api_impl::owner - api: post_tx: successfully posted tx: fd90d92a4bde, fluff? false
20220106 02:33:54.096 INFO grin_wallet_controller::command - Transaction sent successfully, check the wallet again for confirmation.
Transaction posted
Transaction finalized successfully
/home/marek/wallets/alice/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I3.slatepack

Slatepack data follows.

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. SeQ3uWrMQ5caEmf j7DCPVG9YpNd5Md jnJ5XEAmgyjovL4 cJbbhKdMxQzrUi8 zcTkTMrtB5QPgPB QbF8f4WjGTXzQ29 Nji7wn1eZY6KJYn z9dGSk1t6puwMed BDCnpNbZsfwyZTh oF5TKdDg5GUjriN Bd5Af3DbzgPhPHE fK6Crf8bVqxoj2c 1gpJZxzkUbSe4MS FpN1BrRkxpbcSBV WdBPUot3rbYrVFs oxZBMEAUG5qVVom hZN2EdYqQ4D4yV7 SGJHYKaPE2NQAD8 JjDFoU6svqviUTL yvFjy6Goi3yEL1J igsrYobnzKg8DcV sSfTo7P5JytJc9m 5AZ4vWRBD2YeUAK yrHonyPYuhPz7n9 tDGqhwe2RdUh3tn ds3RS28ydDn4Nin wJwDuw85873DCrq tB5nFwQ8sVZKNDA 44DgGEMSQguXKVp PPXZQMijU2tY6R6 qVnUsGnLkurPsu9 Gd6t6GhFK1t8Xg2 8QjPwXDUurVDPdV 3rfBomwmyV553tK czBb27DJrqjig4i Et7yPRnqZ3PMQxz eYsKqXVdZscYxzS UyNXq3C3UB98kNo uSXb5x2rW8Xz1Mh qLHZ581iAKhCxCW QEqE2qLAyZKAQ88 LLxXznYT7kK6zKK 4DvTaBoBggeuv1E tByaMhwkqYVAYz1 jdBy1gawGMNxDcL HLzGTBg4GzR3Sd5 LvHJQ5DusVBm5Zu Wqo98fBa52pRtQ6 PCHH1FcD9T32Eeg sMTkcR1nTu4UNPw nMu99budQgSYQFK VQUGZR5yn93Zu2m kAVbtdQFyorywBN yU8EEZBdM8voEvk JCMSpgVyLPzhE9j HpRoiCRQQbMBu7C GnrxX2Zf2uUoUXM t5Rjm2sKVVGBWkX dBVrTsJ3efN8uYy zX34wT2Q64S5ew9 oJmg84hPYGMnftK N6xsqFHN7senkgq MXCCCPQugXPjZvk 4wbpmsdNmsquUFW Df8jgbvGgDx6JfL TFt3CJ1BXx9FN4m G1pe8SZ9A8amct2 UVePLYXLd1Kqnyw eNreFkARE25X4dN WMvpvWHrrnoTtpp jPpMF2padUbg1uM MsmdMuTsd1BUtkj SqSKBTwWdecnkX7 gQvt7bscsDWoHRr NPyhNk9DTtN22VQ WdaBRNoPcHnDqud PdpD3pBMxeMQd8h 4wcxrAsNewXGUzL vsniByLkvc37mzj vEtmt2XsWPFmMCT j6VHBN622vf6EMU 7sr97wDYb79MefX fudLW9ZonNbtjWS p43eKPMWvfXHMFn CK8HrbDgbcHppZw aCihvePZoVz3PsM 9dsbLtCQKkFh4bW Hf17XNbQQLRC61B Zi9GigW5hCWFhBJ nFKF3LuvPozJkNc zk1P53tcB2oG7eV v5SC1yS1zcZwiur dCpHYiYw5bN5JiA Mvu1kaVcdMGLhEd CsJfWkwDDtcVxRS FMMzAG5M8zhprqy cHMuTL5h6F98pDM cEpAsMsyafGLDuK jKBBoLt7wZudLyH dskUePwzVhoTsFD QQWJxB4ZYTHFBg8 MAXZzkq8nCdDBBe VewKPgU26aNMuYX qtAZvFxHnQ1MeGb quto5Kq2xsp4Pw6 vo6SAaGrbx9e6ca WNR24c1Rqdr6CNc 8SxxXUe8kqaVDs5 8tVyCmqoJFH7jPL D7krAM1EDyZ5fhv LaRLdC5jwZNfXj4 yampEpgjVVbfwCD VTkQ6irku38Dwai YoqTXkdWpFrAYmk AMba6eXSu7bVcmg zdDbdttUm3tN9Nv Ymh9J4rT15HodgN esQGVES8svC6Zjb 5wVNA4pjTgpdg9k rjpuJuNyB23LCXc 8zGoDeATRMWMTfr U8LutSWfvA13EBt 2qzi2pitDLkAqun n59wTMbWFRET18A CV9JAKv6o4i4SNs VtsngbNT5LTu1bw qGPunodHV2Q85gS TnkQEmUCWdgUKgY 1dJSKbosDpZDkoe i2zJZhBcYwb99tW R6hwmcbdiroV2bR iGkkgmoTxNJHDDE v5xzLvnNqHcFzfJ kGc7opvKYics7eP 8JBcN2Sn2qhcjdW eYXekHvueHtTAer o9pn6KSCBtGGxuT f6KrXYWWnFRMUPH guDVE4nB9tgdSMg mQjfSMRZdy6gbcw BeWJWZT58Xq7mSq mFjtaKSUxY8q298 EEvLrsbSxdUe3yU V6ir4iJtQBsJx44 HZVYsLn6i6SvCnc 1nTyeCdwbsepPkH MwUBU94PELvKSRt ojBxE3vfXmwyaKv sMSgaLPVg8LWyDe nf5kFNTuhVtw6zw XuzU3b93y2AnnxE UnPpombi8Mit5fX tANevJqA2ouqcg7 KJHSMDs48VL3yF2 b7hfoqk6Rajc7kx XKKJRwqsrKoJCgW H339im1VqgMjSeN Radag6Z5jEjgSbg feu3MGLYDnZKhAC waMfuVj5RpHW9Aq Xqw9F5HwT1EpJY8 hMaprYqdrbZ62kG Bv9CPxZsmQFpnHR Rtv8n9LHLRcKJ8E 2QpfaaSGQTV1JmR VPfN5Ry3xFoCQHE oBUGVkKZTbnCJEA 2BwWsCNtJwCdFNt pdwndYHiqfcDrBr 6N5TyNrww3eubjP asaQcg9mdJ99vCC vdygnB55. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/home/marek/wallets/alice/slatepack/7d12974e-e778-4522-bc2e-f709b281fb25.I3.slatepack

The slatepack data is NOT encrypted

Command 'finalize' completed successfully

and we can quickly check

$ grin-wallet -t /home/marek/wallets/alice -p "" txs -t 7d12974e-e778-4522-bc2e-f709b281fb25
20220106 02:35:17.561 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:35:17.562 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 02:35:17.562 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:35:17.562 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:35:17.964 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 02:35:17.965 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 02:35:18.004 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating outputs from node
20220106 02:35:18.007 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 02:35:18.011 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating transactions
20220106 02:35:18.016 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Starting UTXO scan
20220106 02:35:18.016 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20220106 02:35:18.075 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Checking 390 outputs, up to index 10900555. (Highest index: 10900555)
20220106 02:35:18.075 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 02:35:18.119 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976), amount: 1000000, key_id: Identifier(0300000000000000000000000600000000), mmr_index: 10900553,
20220106 02:35:18.119 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 02:35:18.119 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Identified 1 wallet_outputs as belonging to this wallet
20220106 02:35:18.119 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 02:35:18.120 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete

Transaction Log - Account 'default' - Block Height: 1558217
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Id  Type         Shared Transaction Id                 Creation Time        TTL Cutoff Height  Confirmed?  Confirmation Time    Num.    Num.     Amount    Amount   Fee    Net         Payment   Kernel                                                              Tx  
                                                                                                                                 Inputs  Outputs  Credited  Debited         Difference  Proof                                                                         Data 
===========================================================================================================================================================================================================================================================================
 6   Received Tx  7d12974e-e778-4522-bc2e-f709b281fb25  2022-01-06 01:30:49  None               true        2022-01-06 01:34:43  1       2        0.001     0.0      0.023  0.001       None      08eaac24df8c85d56bb7a9d6029cb289ae0fdc76e6d0b956a2323d0f4cee5abc63  Yes 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Wallet Outputs - Account 'default' - Block Height: 1558217
------------------------------------------------------------------------------------------------------------------------------------------------------------
 Output Commitment                                                   MMR Index  Block Height  Locked Until  Status   Coinbase?  # Confirms  Value        Tx 
============================================================================================================================================================
 0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976  None       1558216       0             Unspent  false      2           0.001000000  6 
------------------------------------------------------------------------------------------------------------------------------------------------------------


Payment Proof - Transaction '6'
None
Command 'txs' completed successfully

there are 2 confirmations of this tx. Seems like it is working properly.

Owner API

I will repeat same flow using Owner API.

Starting Owner API

Let us start by running owner API listener on alice wallet.

$ pwd
/home/marek/wallets/wallet2
$ grin-wallet -t /home/marek/wallets/alice -p "" owner_api
20220106 02:41:25.376 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 02:41:25.376 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/wallet2/grin-wallet.toml
20220106 02:41:25.377 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 02:41:25.377 DEBUG grin_wallet - Built with profile "release", features "".
20220106 02:41:25.780 DEBUG grin_wallet_impls::lifecycle::seed - Seed file path: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 02:41:25.781 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 02:41:25.782 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 02:41:25.813 WARN grin_wallet_controller::controller - Starting HTTP Owner API server at 127.0.0.1:3420.
20220106 02:41:25.813 WARN grin_wallet_controller::controller - HTTP Owner listener started.

please note the line 20220106 02:41:25.376 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/wallet2/grin-wallet.toml indicates that the wallet configuration used is one from current directory and not one specified by -t option. Potential bug? Regardless, let's change directory to /home/marek/wallets/alice

$ pwd
/home/marek/wallets/alice
$ grin-wallet -t /home/marek/wallets/alice -p "" owner_api
20220106 03:01:55.214 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 03:01:55.214 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 03:01:55.214 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 03:01:55.215 DEBUG grin_wallet - Built with profile "release", features "".
20220106 03:01:55.652 DEBUG grin_wallet_impls::lifecycle::seed - Seed file path: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:01:55.653 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:01:55.655 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:01:55.700 WARN grin_wallet_controller::controller - Starting HTTP Owner API server at 127.0.0.1:3420.
20220106 03:01:55.701 WARN grin_wallet_controller::controller - HTTP Owner listener started.

Producing an invoice

We make an API request to init_secure_api, open_wallet then finally issue_invoice_tx with params

{
    "amount": 1000000,
    "dest_acct_name": null,
    "target_slate_version": null
}

recipients

[
    "grin1nzt5eee6ytka282a8w5rcj3k66t3rjytcqqmcdptepnhz4spsysqa9xckw"
]

and it responds with following slate

{
    "amt": "1000000",
    "id": "82cf7e63-3216-4294-b931-1a97af82618b",
    "sigs": [
        {
            "nonce": "0369a3c7aded121d76a7b82caf168fcf105547962e2c9851e65afcb0c4bc93d6e9",
            "xs": "037981cde2e1ae84e057218d68c4a0978dbd255e87263153d33d4f2c6226fb5d97"
        }
    ],
    "sta": "I1",
    "ver": "4:3"
}

which using create_slatepack_message gives following slatepack

BEGINSLATEPACK. 9hpzVoxZSJBUYR9 6cUDJo7f8ybJwag NhuugDyELqr5Cp8 dVnzand7SpyZtqm iApr5F1WpCUE55q yetpjpx9kgP7v9h y1jnbN55sLjjezw H16ippCZyJXXEUU XKfysYSduNoCgmD RcVL6P82xeRgt6r CtbYUw4DBk4tP8t WPakLpnGQAqfg1L Kyr7bC6QbNbyYpB odaCU9v3yZnS3QT Ljgk64uhritiLMi Zhfts3JDdqYxCNr DGMB3eppDt37vDg HxdVsj1JEC1hcoy CWLusEtqru2kLH1 3NxZ18idARfnyh4 eKDkFvYZGDwbNiU gjhUNPdQUYJr4jS cUXBpTi1achnt4N SdeYEv7ZAeMQ3Q7 NzC1UGNPa1VWxPs VApBz5H7bpMq1eT GRot55V65yY5DZi jrT4hUsiWZKchmm k7i8PTwkKcUASKg TVXrzqbaUKcBwQC ma8x8MwXCKS9e4b pPkvHnHkhdK2nVX sQNhjK1keVQyRaP 4UTECh6TQGmWYv6 GRVYr537PKBZqG5 WXMLjez74aQfzkG 1p8qd2khaFB5XCN pQrSCEFHQvMcrnn Vosqroe2jznkQBw 8WQC3hQnNoafq6j DhCAgnhrsrzav9n. ENDSLATEPACK.

New logs that appear in the Owner API

20220106 03:07:50.592 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:07:50.594 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:07:50.633 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:07:50.634 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:07:51.041 DEBUG grin_core::libtx::build - Building output: 1000000, Commitment(08fdf389d6b34bb0f21e7b3a3f39e0aca105c0e86dfc0194e4a6924327b5f4d54a)

Paying the invoice

This I will do on wallet2 side using CLI

$ grin-wallet -t /home/marek/wallets/wallet2 -p "" pay
20220106 03:12:00.075 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 03:12:00.076 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/wallet2/grin-wallet.toml
20220106 03:12:00.076 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 03:12:00.076 DEBUG grin_wallet - Built with profile "release", features "".
20220106 03:12:00.516 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/wallet2/wallet_data/db/lmdb is 134217728
20220106 03:12:00.519 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/wallet2/wallet_data/wallet.seed
Please paste your encoded slatepack message:
BEGINSLATEPACK. 9hpzVoxZSJBUYR9 6cUDJo7f8ybJwag NhuugDyELqr5Cp8 dVnzand7SpyZtqm iApr5F1WpCUE55q yetpjpx9kgP7v9h y1jnbN55sLjjezw H16ippCZyJXXEUU XKfysYSduNoCgmD RcVL6P82xeRgt6r CtbYUw4DBk4tP8t WPakLpnGQAqfg1L Kyr7bC6QbNbyYpB odaCU9v3yZnS3QT Ljgk64uhritiLMi Zhfts3JDdqYxCNr DGMB3eppDt37vDg HxdVsj1JEC1hcoy CWLusEtqru2kLH1 3NxZ18idARfnyh4 eKDkFvYZGDwbNiU gjhUNPdQUYJr4jS cUXBpTi1achnt4N SdeYEv7ZAeMQ3Q7 NzC1UGNPa1VWxPs VApBz5H7bpMq1eT GRot55V65yY5DZi jrT4hUsiWZKchmm k7i8PTwkKcUASKg TVXrzqbaUKcBwQC ma8x8MwXCKS9e4b pPkvHnHkhdK2nVX sQNhjK1keVQyRaP 4UTECh6TQGmWYv6 GRVYr537PKBZqG5 WXMLjez74aQfzkG 1p8qd2khaFB5XCN pQrSCEFHQvMcrnn Vosqroe2jznkQBw 8WQC3hQnNoafq6j DhCAgnhrsrzav9n. ENDSLATEPACK.

This command will pay the amount specified in the invoice using your wallet's funds.
After you confirm, the following will occur: 

* 0.001000000 of your wallet funds will be added to the transaction to pay this invoice.
* The resulting transaction will output as a slatepack which you can manually send back to the invoice creator.

Please review the above information carefully before proceeding

To proceed, type the exact amount of the invoice as displayed above (or Q/q to quit) > 0.001000000
20220106 03:12:23.129 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 03:12:23.136 DEBUG grin_wallet_libwallet::internal::selection - Building change outputs: total change: 952000000 (1 outputs)
20220106 03:12:23.152 DEBUG grin_core::libtx::build - Building output: 952000000, Commitment(094ce172923fe947013bcc957f03afdee2fe0a65a1b7364808bcea8a714a67a386)
20220106 03:12:23.253 DEBUG grin_core::libtx::build - Building input (spending regular output): 976000000, 0300000000000000000000000100000000
20220106 03:12:23.266 INFO grin_wallet_controller::command - Invoice processed: 0.001000000 grin (strategy 'smallest')
20220106 03:12:23.266 DEBUG grin_wallet_api::owner - Send (TOR): Destination is not SlatepackAddress Error { inner: 

SlatepackAddress error: invalid length }
20220106 03:12:23.266 WARN grin_wallet_api::owner - Destination is not a valid Slatepack address. Will output Slatepack.
20220106 03:12:23.292 DEBUG grin_wallet_libwallet::internal::selection - Change amount is: 952000000
/home/marek/wallets/wallet2/slatepack/82cf7e63-3216-4294-b931-1a97af82618b.I2.slatepack

Slatepack data follows. Please provide this output to the other party

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. 4fiUrA5WFsKwfQC aVcW3QWq2iEFd3q H7D8vF7ti5ejue5 SUVYoroJ6HZH9gx 9vy7RD82ZE9qvja 3vKhZgzMXqe7cPs KSG6mv1G8gW2j7g YCL4twPYe9zQRuh 5WCBax3AMub9zHE YWtZQ7auAt5vFdB taMbzbstatgo1v8 qNkDEbHPdPhveZ8 Zsj6k5wd73m1SVD kgigACAz2u9T6sX rFSo2JTDeFAH3F3 ZS6Mr5t35dCWZt8 cfq7GeCCnRaxEVT KHaF4sRh7FAgCsv 4cgmSB5axmE6djD TMZsrEujH5s682f DDdswuuiFN9gPS8 GKTE1RxAYFedmqw nF56QdiQZKDJgt5 b9CQjTRRz3AYV9J q3mzFGUeZ7qUY6r Fv7QWvLNcepdZFY grcB4Pt6BxRrFVN FQbaKtHUoU5WfpM 5AKpRLu216sRv3Y 1zXF4kguLNRH9r2 sZZZxNjtiKowN1M mido84zVCV9xVqy NX9texHMudXrb3L 7HqwhxWx94EQrHw DqveVRh7H8hCSX3 NNrLyGJGEya9Rd1 11g3NU5DBArHNAT MtswTQtsXzpKUFK vcASpzsEs8pdMvG DZbjHtcnmdq1h5N 4tKCyLa9jYNdJCY kKHStGhFzcjh1Sg aHRTqf92LQhUa81 aHTbnAVhLFytvVs S9VssQBXgnfUgE3 ua3phuHgUAjBw6V ffPeKgM4Zkwhe9g 9kFccoCqWJqfPuY tYvFdVqD2cPisKx b2jz34KdT4Lqwvs Zy8qhUvJ4vEyVox rzs6Tg9u1VEftCn tu6zCz5Comb8u3X VG9swat6Zb59wJS 3m3vvzv36sDGWYd 3waoK7xGgzd2vZk f9yJUYz5AJQD9qM zEfgwYgtNiZKUTu mzQBFHaFMoJUUpk WQsNmQrjePwietL Wch5fWHzU5DQ7Sv 9TYJUs8KMms5oMp t8pgcHZSxF7rKa6 G7DeQy6YQz1ZZFp 61rFTQkkf5f1kGK V6K2V4qNGQSf4rw 4Kp9Md9xuapDVq3 L9UD2tEd5ZWQwSP YGqp5NLg3AAcF1w c8TB65NoCZ9H4QY Sbs3eQfMUaEoMbQ kGXMcVHzY6n5Kt9 jVCimBwUSH8bvBL 5mCa2MGDvS3qsSp 7n2DZuucAjhhgMt Jwe9rCDdQE6zXxP 96Kgs6ifJdDk48A WGcWHNtii9YtyZp njFyAyhzZDBiPn1 BEZmvp299cbroyV fchywNfGaNsrwYP KPV8ABemQJ7m3A1 jaEBxc6G7WsNE8k anF7WbpWpQAoRBJ j29CzcBjGPkKVyy qTiXpsw2dxXnUyQ nGXqem2Le1TA4v7 m6DwUDdwmE2WpoH 1ZTQiyNTcfN7ACN sphAf1LSETJ4W75 cfLP2A1vbiKijei PVrz2WRsxQ7FeRQ XjiPuJr1iGrtwRm t78JRL9ALvYufrv XTuX. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/home/marek/wallets/wallet2/slatepack/82cf7e63-3216-4294-b931-1a97af82618b.I2.slatepack

The slatepack data is NOT encrypted

Command 'pay' completed successfully

Finalize using Owner API

As previously we make an API request to init_secure_api, open_wallet then we decode the slate from wallet2 using decode_slatepack_message and decoded slate appears to be

{
    "coms": [
        {
            "c": "090d2830d04373cf36b10722421b3a1bee9ecb091604758eb0e93e70e30e809c5d"
        },
        {
            "c": "094ce172923fe947013bcc957f03afdee2fe0a65a1b7364808bcea8a714a67a386",
            "p": "7b5d6b69ee4b7c10ccf24e81998e9ef043afa77a83748e2622927bce7a95efca004de11a4f54602ec76a6695a64298538f7996ecfc4c5d4d3b4d9c5744d30aa3084d1ac030735b981e585abd756310435284d0634b0e9cd6683b29f222ae1c558a00f966e351916e3a2057c7c4f9735daaebd74beea0d73a2a91d867e36f30258a1089a4ad52976a7d1d222afe4f1b042d5aa081efaf87a0c96ea09c7fd28647b36e8d94013458f7d97dd8ec90976860099560f9c3795e98618ad4032e4fb9951de2bd90779ee2a220a9afa6441458ec3bcadf5537fac69ce0288e672bf87390bf3178aae6a6b4d08a6ceb09e8401f54bf00cf8dc319ce0880c991223187aef869cf935ecc9512d72145e3306ac04a444c8dbbeca6cf7ec174f0fd7526629b3937a7437407ae5e77eee851e802e5f9b0a6acf8c7a2f9af192c80abd6fa272ac2235b6408f1c956340bd39b509da428a8fb950349206fce06e369217b7dba5b01143803e6adc1fc34f0dea8b3665b971070c31753079c458ef38c8e50bce3bbba13bc21d906c348a401d90d473b600d0aeb86e9d77493553bbc27b62e757bdebe70c1207e4ea61e9c0ad21b62962030a82c8eef53e0ce25c3972262b9724fa857e34e2810c34f1a898f930af999de74e2478e0b0d2a67c6694290f727364b78a1979c67e105fe915ab6c6ae12063130c73c7cc84f1ab55bbe327311671a9cd7dd58b7cd74c6dcb874470d3bcb8765ea314c45d19b6a024319227d42540ccca899d1097cb00b6bbbd32c8bf4e77b047e82b26c1d2f0afc379aab6ea6c385d34ade17a937665d38e8c731b447c03233700162af19b6868a169d8be831cfbb766f4e6ba132f4e7cbaac79c3cbfd6ae480fd383d7b374434060e6fffa039ea9f05ebd8daf439719c0cdff2d25e2a19e3c0e9e1b9839b44bf540d58e25213d6187942de74eae"
        }
    ],
    "fee": "23000000",
    "id": "82cf7e63-3216-4294-b931-1a97af82618b",
    "off": "3d763596693cb8331a6c0b74aa6065e31b0e452e57e18632ac31e7e1ea937909",
    "sigs": [
        {
            "nonce": "03833f2820eb18bb3ab32aa85331b1a9e087bea81ca834e4dae019c0394a6a1856",
            "part": "56186a4a39c019e0dae434a81ca8be87e0a9b13153a82ab33abb18eb20283f832fd522fd37efc9c375b868bc95bc6566289dfb5054e719e9170db39671919f9b",
            "xs": "03bed4c8269fa74c9479ff1773f6f5c50a797a0340573f42aa3a470292dc67d242"
        }
    ],
    "sta": "I2",
    "ver": "4:3"
}

right after we run tx_lock_outputs provided the above slate and finalize_tx which gives us a new slate

{
    "coms": [
        {
            "c": "090d2830d04373cf36b10722421b3a1bee9ecb091604758eb0e93e70e30e809c5d"
        },
        {
            "c": "08fdf389d6b34bb0f21e7b3a3f39e0aca105c0e86dfc0194e4a6924327b5f4d54a",
            "p": "e6b756ce221decc05365817f939529e214cbc554a1d369439cf52fe6fda285435e8b0bfc90165326265bc79b11c59c5c3430964a82e78e8b14f6a6d499f502800c979774d98dee680f1c06b91c01238e32e3c045f8527ab04ce5bed298fe8963b23e415bcd403ffbe3e0a1d7634fa550c08c293f747a8a303e8a7eb1e052e6a39ff2baaaf0ffaf52038eafefae96beaff63465a452630aa4a93475e7279951eaef81c03bb5ca5d9fb65adc5b8e509e334462f1fd49a51d7919930073b4b2739dc5dce720ddfbe25ff9d6b7662348f49c57844ee43b6886b593522ea0ac4f478559e58c98fc7ed6c3dad05f0114f8f9bf8152961587f8363d8c18366a09bb6a9344219dc205facad752819edb5077530dc758bab3a64e20ba3c9bbaefb67e9a5af59206ea892dfee3c13f01e43bd6fa3860eaf4213d584f7d6d5c38de063c490c1f6f7f49524dd137138506b51de77f4ff76f69f4f66dffd1e4ca166b3f7ca5f74b1403a1957e0f6a39b5f9be1defdc2050b87daf545a3c724120862cd2246ce6f2d6209377daa1e87e987466de5557b3b28757413a64c4c3176e5a18b311fa18715b9b1ed98961cd746ebfc33ac159911f639f2bf8e65c2d0fd6b6ae2b0160f9cbeb75d06c985327d2b50629006cafa455bccea95a95b0ebb1564606c344827b8daa755b6e994cbe00a441aa1efb89089ef0dc6dac9e0d28f3574746fd248661c6b75951e1369fe09e6ba2f1fdafbeda2a443a5b32cdf79df1829fd2964d28f1d8d7e1226769f8854d3a394eaca1556d32b22ddcf2664bf1244ce99d767c589c709aa9f562d556bd7e281afaf37c08205bdc9efd0d954deca8aa3063c94b2fc2d86ba7c10649b8e8ded79f57b19e52f4f1dc82cc5a188bbda9d9a06e576ebbc3aa3d0f5895574dac157d794568e55ac976f426b646d3a9fb3ec03b9d16d39384cb7d77"
        },
        {
            "c": "094ce172923fe947013bcc957f03afdee2fe0a65a1b7364808bcea8a714a67a386",
            "p": "7b5d6b69ee4b7c10ccf24e81998e9ef043afa77a83748e2622927bce7a95efca004de11a4f54602ec76a6695a64298538f7996ecfc4c5d4d3b4d9c5744d30aa3084d1ac030735b981e585abd756310435284d0634b0e9cd6683b29f222ae1c558a00f966e351916e3a2057c7c4f9735daaebd74beea0d73a2a91d867e36f30258a1089a4ad52976a7d1d222afe4f1b042d5aa081efaf87a0c96ea09c7fd28647b36e8d94013458f7d97dd8ec90976860099560f9c3795e98618ad4032e4fb9951de2bd90779ee2a220a9afa6441458ec3bcadf5537fac69ce0288e672bf87390bf3178aae6a6b4d08a6ceb09e8401f54bf00cf8dc319ce0880c991223187aef869cf935ecc9512d72145e3306ac04a444c8dbbeca6cf7ec174f0fd7526629b3937a7437407ae5e77eee851e802e5f9b0a6acf8c7a2f9af192c80abd6fa272ac2235b6408f1c956340bd39b509da428a8fb950349206fce06e369217b7dba5b01143803e6adc1fc34f0dea8b3665b971070c31753079c458ef38c8e50bce3bbba13bc21d906c348a401d90d473b600d0aeb86e9d77493553bbc27b62e757bdebe70c1207e4ea61e9c0ad21b62962030a82c8eef53e0ce25c3972262b9724fa857e34e2810c34f1a898f930af999de74e2478e0b0d2a67c6694290f727364b78a1979c67e105fe915ab6c6ae12063130c73c7cc84f1ab55bbe327311671a9cd7dd58b7cd74c6dcb874470d3bcb8765ea314c45d19b6a024319227d42540ccca899d1097cb00b6bbbd32c8bf4e77b047e82b26c1d2f0afc379aab6ea6c385d34ade17a937665d38e8c731b447c03233700162af19b6868a169d8be831cfbb766f4e6ba132f4e7cbaac79c3cbfd6ae480fd383d7b374434060e6fffa039ea9f05ebd8daf439719c0cdff2d25e2a19e3c0e9e1b9839b44bf540d58e25213d6187942de74eae"
        }
    ],
    "fee": "23000000",
    "id": "82cf7e63-3216-4294-b931-1a97af82618b",
    "off": "a7066cc6eefe12bcb04d2b2b7bbaeb98c79f33c13027261556a2e00772239a8b",
    "sigs": [
        {
            "nonce": "03833f2820eb18bb3ab32aa85331b1a9e087bea81ca834e4dae019c0394a6a1856",
            "part": "56186a4a39c019e0dae434a81ca8be87e0a9b13153a82ab33abb18eb20283f832fd522fd37efc9c375b868bc95bc6566289dfb5054e719e9170db39671919f9b",
            "xs": "03bed4c8269fa74c9479ff1773f6f5c50a797a0340573f42aa3a470292dc67d242"
        },
        {
            "nonce": "0369a3c7aded121d76a7b82caf168fcf105547962e2c9851e65afcb0c4bc93d6e9",
            "part": "e9d693bcc4b0fc5ae651982c2e96475510cf8f16af2cb8a7761d12edadc7a3696297641bac083687e210ba526ca0cc03e64d4ef5ae61123319120d4efc04e460",
            "xs": "037981cde2e1ae84e057218d68c4a0978dbd255e87263153d33d4f2c6226fb5d97"
        }
    ],
    "sta": "I3",
    "ver": "4:3"
}

Owner API log got following messages in the mean time

20220106 03:24:12.535 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:24:12.537 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:24:25.648 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:24:25.650 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:24:26.083 DEBUG grin_wallet_libwallet::internal::selection - Change amount is: 1000000
20220106 03:24:26.116 DEBUG grin_core::libtx::build - Building output: 1000000, Commitment(08fdf389d6b34bb0f21e7b3a3f39e0aca105c0e86dfc0194e4a6924327b5f4d54a)
20220106 03:24:26.171 DEBUG grin_wallet_libwallet::slate - Final Tx excess: Commitment(099fa493b18fb6d06f4d795e47f0357436d5773bb26b836a3a9bdd4b1b96318c76)
20220106 03:24:26.171 DEBUG grin_wallet_libwallet::slate - Validating final transaction

Posting the transaction using Owner API

As previously we make an API request to init_secure_api, open_wallet then we run get_stored_tx to fetch the slate 82cf7e63-3216-4294-b931-1a97af82618b again and run post_tx provided that fetched slate. We also set fluff argument to true. Owner API responds with null but status is ok.

Owner API log got following messages in the mean time

20220106 03:32:38.176 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:32:38.179 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:32:38.576 DEBUG grin_wallet_libwallet::api_impl::owner - api: post_tx: successfully posted tx: 14f16a06f58b, fluff? true

Check the txs using CLI

$ grin-wallet -t /home/marek/wallets/alice -p "" txs -t 82cf7e63-3216-4294-b931-1a97af82618b
20220106 03:34:35.686 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 03:34:35.686 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 03:34:35.686 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 03:34:35.686 DEBUG grin_wallet - Built with profile "release", features "".
20220106 03:34:36.088 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 03:34:36.090 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 03:34:36.130 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating outputs from node
20220106 03:34:36.132 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 03:34:36.139 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating transactions
20220106 03:34:36.150 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Starting UTXO scan
20220106 03:34:36.150 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20220106 03:34:36.260 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Checking 774 outputs, up to index 10901337. (Highest index: 10901337)
20220106 03:34:36.260 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 03:34:36.287 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976), amount: 1000000, key_id: Identifier(0300000000000000000000000600000000), mmr_index: 10900553,
20220106 03:34:36.287 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 03:34:36.309 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Identified 1 wallet_outputs as belonging to this wallet
20220106 03:34:36.309 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 03:34:36.309 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete

Transaction Log - Account 'default' - Block Height: 1558269
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Id  Type         Shared Transaction Id                 Creation Time        TTL Cutoff Height  Confirmed?  Confirmation Time  Num.    Num.     Amount    Amount   Fee    Net         Payment   Kernel                                                              Tx  
                                                                                                                               Inputs  Outputs  Credited  Debited         Difference  Proof                                                                         Data 
=========================================================================================================================================================================================================================================================================
 7   Received Tx  82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:07:51  None               false       None               1       2        0.001     0.0      0.023  0.001       None      099fa493b18fb6d06f4d795e47f0357436d5773bb26b836a3a9bdd4b1b96318c76  Yes 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 8   Sent Tx      82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:24:26  None               false       None               0       1        0.001     0.0      None   0.001       None      08bed4c8269fa74c9479ff1773f6f5c50a797a0340573f42aa3a470292dc67d242  Yes 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Wallet Outputs - Account 'default' - Block Height: 1558269






Payment Proof - Transaction '7'
None

Payment Proof - Transaction '8'
None
Command 'txs' completed successfully

Observe that

  1. There are two txs with 82cf7e63-3216-4294-b931-1a97af82618b id.
  2. Confirmation Time is None

I will wait 20 minutes and run it again.

( poooof )

Ok one more time

$ grin-wallet -t /home/marek/wallets/alice -p "" txs -t 82cf7e63-3216-4294-b931-1a97af82618b
20220106 04:00:09.228 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 04:00:09.228 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 04:00:09.228 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 04:00:09.228 DEBUG grin_wallet - Built with profile "release", features "".
20220106 04:00:09.655 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:00:09.657 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:00:09.687 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating outputs from node
20220106 04:00:09.690 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 04:00:09.698 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating transactions
20220106 04:00:09.708 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Starting UTXO scan
20220106 04:00:09.708 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20220106 04:00:09.804 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Checking 705 outputs, up to index 10901388. (Highest index: 10901388)
20220106 04:00:09.804 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:00:09.836 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976), amount: 1000000, key_id: Identifier(0300000000000000000000000600000000), mmr_index: 10900553,
20220106 04:00:09.836 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:00:09.869 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Identified 1 wallet_outputs as belonging to this wallet
20220106 04:00:09.869 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:00:09.870 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete

Transaction Log - Account 'default' - Block Height: 1558292
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Id  Type         Shared Transaction Id                 Creation Time        TTL Cutoff Height  Confirmed?  Confirmation Time  Num.    Num.     Amount    Amount   Fee    Net         Payment   Kernel                                                              Tx  
                                                                                                                               Inputs  Outputs  Credited  Debited         Difference  Proof                                                                         Data 
=========================================================================================================================================================================================================================================================================
 7   Received Tx  82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:07:51  None               false       None               1       2        0.001     0.0      0.023  0.001       None      099fa493b18fb6d06f4d795e47f0357436d5773bb26b836a3a9bdd4b1b96318c76  Yes 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 8   Sent Tx      82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:24:26  None               false       None               0       1        0.001     0.0      None   0.001       None      08bed4c8269fa74c9479ff1773f6f5c50a797a0340573f42aa3a470292dc67d242  Yes 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Wallet Outputs - Account 'default' - Block Height: 1558292






Payment Proof - Transaction '7'
None

Payment Proof - Transaction '8'
None
Command 'txs' completed successfully

and I can see

20220106 04:00:09.836 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976), amount: 1000000, key_id: Identifier(0300000000000000000000000600000000), mmr_index: 10900553,

in the logs. Which makes me think that probably (1.) there are two entries in txs because there is also change and (2.) only one slate gets posted. The slate that is posted is one returned using get_stored_tx Owner API method. Let us investivate which slate is being returned using get_stored_tx if provided 82cf7e63-3216-4294-b931-1a97af82618b as ID.

Slate from get_stored_tx investigation

As previously we make an API request to init_secure_api, open_wallet then we run get_stored_tx to fetch the slate 82cf7e63-3216-4294-b931-1a97af82618b and it gives us

{
    "coms": [
        {
            "c": "090d2830d04373cf36b10722421b3a1bee9ecb091604758eb0e93e70e30e809c5d"
        },
        {
            "c": "08fdf389d6b34bb0f21e7b3a3f39e0aca105c0e86dfc0194e4a6924327b5f4d54a",
            "p": "e6b756ce221decc05365817f939529e214cbc554a1d369439cf52fe6fda285435e8b0bfc90165326265bc79b11c59c5c3430964a82e78e8b14f6a6d499f502800c979774d98dee680f1c06b91c01238e32e3c045f8527ab04ce5bed298fe8963b23e415bcd403ffbe3e0a1d7634fa550c08c293f747a8a303e8a7eb1e052e6a39ff2baaaf0ffaf52038eafefae96beaff63465a452630aa4a93475e7279951eaef81c03bb5ca5d9fb65adc5b8e509e334462f1fd49a51d7919930073b4b2739dc5dce720ddfbe25ff9d6b7662348f49c57844ee43b6886b593522ea0ac4f478559e58c98fc7ed6c3dad05f0114f8f9bf8152961587f8363d8c18366a09bb6a9344219dc205facad752819edb5077530dc758bab3a64e20ba3c9bbaefb67e9a5af59206ea892dfee3c13f01e43bd6fa3860eaf4213d584f7d6d5c38de063c490c1f6f7f49524dd137138506b51de77f4ff76f69f4f66dffd1e4ca166b3f7ca5f74b1403a1957e0f6a39b5f9be1defdc2050b87daf545a3c724120862cd2246ce6f2d6209377daa1e87e987466de5557b3b28757413a64c4c3176e5a18b311fa18715b9b1ed98961cd746ebfc33ac159911f639f2bf8e65c2d0fd6b6ae2b0160f9cbeb75d06c985327d2b50629006cafa455bccea95a95b0ebb1564606c344827b8daa755b6e994cbe00a441aa1efb89089ef0dc6dac9e0d28f3574746fd248661c6b75951e1369fe09e6ba2f1fdafbeda2a443a5b32cdf79df1829fd2964d28f1d8d7e1226769f8854d3a394eaca1556d32b22ddcf2664bf1244ce99d767c589c709aa9f562d556bd7e281afaf37c08205bdc9efd0d954deca8aa3063c94b2fc2d86ba7c10649b8e8ded79f57b19e52f4f1dc82cc5a188bbda9d9a06e576ebbc3aa3d0f5895574dac157d794568e55ac976f426b646d3a9fb3ec03b9d16d39384cb7d77"
        },
        {
            "c": "094ce172923fe947013bcc957f03afdee2fe0a65a1b7364808bcea8a714a67a386",
            "p": "7b5d6b69ee4b7c10ccf24e81998e9ef043afa77a83748e2622927bce7a95efca004de11a4f54602ec76a6695a64298538f7996ecfc4c5d4d3b4d9c5744d30aa3084d1ac030735b981e585abd756310435284d0634b0e9cd6683b29f222ae1c558a00f966e351916e3a2057c7c4f9735daaebd74beea0d73a2a91d867e36f30258a1089a4ad52976a7d1d222afe4f1b042d5aa081efaf87a0c96ea09c7fd28647b36e8d94013458f7d97dd8ec90976860099560f9c3795e98618ad4032e4fb9951de2bd90779ee2a220a9afa6441458ec3bcadf5537fac69ce0288e672bf87390bf3178aae6a6b4d08a6ceb09e8401f54bf00cf8dc319ce0880c991223187aef869cf935ecc9512d72145e3306ac04a444c8dbbeca6cf7ec174f0fd7526629b3937a7437407ae5e77eee851e802e5f9b0a6acf8c7a2f9af192c80abd6fa272ac2235b6408f1c956340bd39b509da428a8fb950349206fce06e369217b7dba5b01143803e6adc1fc34f0dea8b3665b971070c31753079c458ef38c8e50bce3bbba13bc21d906c348a401d90d473b600d0aeb86e9d77493553bbc27b62e757bdebe70c1207e4ea61e9c0ad21b62962030a82c8eef53e0ce25c3972262b9724fa857e34e2810c34f1a898f930af999de74e2478e0b0d2a67c6694290f727364b78a1979c67e105fe915ab6c6ae12063130c73c7cc84f1ab55bbe327311671a9cd7dd58b7cd74c6dcb874470d3bcb8765ea314c45d19b6a024319227d42540ccca899d1097cb00b6bbbd32c8bf4e77b047e82b26c1d2f0afc379aab6ea6c385d34ade17a937665d38e8c731b447c03233700162af19b6868a169d8be831cfbb766f4e6ba132f4e7cbaac79c3cbfd6ae480fd383d7b374434060e6fffa039ea9f05ebd8daf439719c0cdff2d25e2a19e3c0e9e1b9839b44bf540d58e25213d6187942de74eae"
        }
    ],
    "fee": "23000000",
    "id": "82cf7e63-3216-4294-b931-1a97af82618b",
    "off": "a7066cc6eefe12bcb04d2b2b7bbaeb98c79f33c13027261556a2e00772239a8b",
    "sigs": [],
    "sta": "S3",
    "ver": "4:3"
}

and that is NOT the slate we obtained from finalize_tx earlier!

Post the slate from finalize tx

I will try to post again using Owner API only this time I will post the slate that we obtained using finalize_tx earlier and not the one provided from get_stored_tx under ID 82cf7e63-3216-4294-b931-1a97af82618b.

New logs

20220106 04:07:33.151 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:07:33.153 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:07:33.189 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:07:33.190 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:12:38.560 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:12:38.562 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:13:13.866 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:13:13.867 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:13:14.291 DEBUG grin_wallet_libwallet::api_impl::owner - api: post_tx: successfully posted tx: def9b4a62b89, fluff? true

Check the txs using CLI again

$ grin-wallet -t /home/marek/wallets/alice -p "" txs -t 82cf7e63-3216-4294-b931-1a97af82618b
20220106 04:14:18.494 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Debug, min. level: Debug
20220106 04:14:18.494 INFO grin_wallet - Using wallet configuration file at /home/marek/wallets/alice/grin-wallet.toml
20220106 04:14:18.494 INFO grin_wallet - This is Grin Wallet version 5.1.0-alpha.1 (git v4.0.0-59-g34d23eb), built for x86_64-unknown-linux-gnu by rustc 1.57.0 (f1edd0429 2021-11-29).
20220106 04:14:18.494 DEBUG grin_wallet - Built with profile "release", features "".
20220106 04:14:18.895 DEBUG grin_store::lmdb - DB Mapsize for /home/marek/wallets/alice/wallet_data/db/lmdb is 134217728
20220106 04:14:18.897 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/marek/wallets/alice/wallet_data/wallet.seed
20220106 04:14:18.946 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating outputs from node
20220106 04:14:18.948 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20220106 04:14:18.961 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Updating transactions
20220106 04:14:18.998 DEBUG grin_wallet_libwallet::api_impl::owner - Kernel Retrieved: (TxKernel { features: Plain { fee: FeeFields(23000000) }, excess: Commitment(099fa493b18fb6d06f4d795e47f0357436d5773bb26b836a3a9bdd4b1b96318c76), excess_sig: Signature(2e280b7a7bc899bf9192b5bcb2e9beea2f2c8c3e22b373cd1b1c7e9ca60eabedfc83966de4c01f311c2c49034649eb0e6a325d020f22c9584afff7e418876c91) }, 1558301, 6570620)
20220106 04:14:19.004 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Starting UTXO scan
20220106 04:14:19.004 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20220106 04:14:19.082 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Checking 586 outputs, up to index 10901408. (Highest index: 10901408)
20220106 04:14:19.082 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:14:19.096 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(0938a38e524807edadf3d7b7cf66a013cbc970e09367bede73b154c3e70d5ba976), amount: 1000000, key_id: Identifier(0300000000000000000000000600000000), mmr_index: 10900553,
20220106 04:14:19.096 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:14:19.124 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Output found: Commitment(08fdf389d6b34bb0f21e7b3a3f39e0aca105c0e86dfc0194e4a6924327b5f4d54a), amount: 1000000, key_id: Identifier(0300000000000000000000000700000000), mmr_index: 10901405,
20220106 04:14:19.124 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:14:19.124 DEBUG grin_wallet_libwallet::api_impl::owner_updater - Identified 2 wallet_outputs as belonging to this wallet
20220106 04:14:19.124 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20220106 04:14:19.125 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete

Transaction Log - Account 'default' - Block Height: 1558301
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Id  Type         Shared Transaction Id                 Creation Time        TTL Cutoff Height  Confirmed?  Confirmation Time    Num.    Num.     Amount    Amount   Fee    Net         Payment   Kernel                                                              Tx  
                                                                                                                                 Inputs  Outputs  Credited  Debited         Difference  Proof                                                                         Data 
===========================================================================================================================================================================================================================================================================
 7   Received Tx  82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:07:51  None               true        2022-01-06 03:14:18  1       2        0.001     0.0      0.023  0.001       None      099fa493b18fb6d06f4d795e47f0357436d5773bb26b836a3a9bdd4b1b96318c76  Yes 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 8   Sent Tx      82cf7e63-3216-4294-b931-1a97af82618b  2022-01-06 02:24:26  None               true        2022-01-06 03:14:18  0       1        0.001     0.0      None   0.001       None      08bed4c8269fa74c9479ff1773f6f5c50a797a0340573f42aa3a470292dc67d242  Yes 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Wallet Outputs - Account 'default' - Block Height: 1558301






Payment Proof - Transaction '7'
None

Payment Proof - Transaction '8'
None
Command 'txs' completed successfully

now it shows as confirmed!

Conclusion

The reason why it was working with CLI and not working with Owner API was that Owner API was not used correctly. The get_stored_tx method provided the tx ID was not providing the slatepack resulting from finalize_tx which eventually was causing incorrect slate being broadcasted using post_tx.

I am not sure if that behaviour is correct. Could someone review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant