Skip to content

Commit

Permalink
feat!: add change metadata to encrypted data (#6713)
Browse files Browse the repository at this point in the history
Description
---
- Added receiver address, amount, and payment ID to encrypted data so a
view-only wallet can identify the receiver when importing a change
output.
- Fixed payment ID not propagated for interactive transactions.
- Added payment ID to burn transactions.
- **Edit** Removed `message` from transactions - payment ID is now used
consistently throughout

_**Note:** Burn transaction status for change outputs needs to be fixed,
see #6726_

Motivation and Context
---
Change data needs to be available for wallet recovery. This is
especially useful for view-only wallets.

How Has This Been Tested?
---
System-level testing

**one-sided**

- Sender wallet, one-sided

![image](https://github.com/user-attachments/assets/42ed1cc2-1d18-41f6-a532-47ab9161aed3)

- Receiver wallet, one-sided

![image](https://github.com/user-attachments/assets/f7f5d1dc-7e55-4f20-9922-6641db57d7fd)

- View-only wallet, one-sided

![image](https://github.com/user-attachments/assets/35ab57b1-eb11-4827-af2d-9c86c69afae0)


**interactive**

- Sender wallet, interactive

![image](https://github.com/user-attachments/assets/3a3d4609-6730-4696-a720-019897a9ae48)

- Receiver wallet, interactive

![image](https://github.com/user-attachments/assets/a97d8033-02a7-4e46-8b20-44445c490125)

- View-only wallet, interactive

![image](https://github.com/user-attachments/assets/e32c67c3-58d1-49a2-9d85-8282a4558eeb)


**burn**

- Sender wallet, burn

![image](https://github.com/user-attachments/assets/6e12b1ad-fd33-4224-be54-990cdaa415a9)

- View-only wallet, burn

![image](https://github.com/user-attachments/assets/91d4ad9f-0306-4cd3-979b-533e21686f4a)


What process can a PR reviewer use to test or verify this change?
---
Code review
System-level testing

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [ ] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [X] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
BREAKING CHANGE: 
- Console wallet command line arguments: 
  - `--message` is not supported anymore, only `--payment-id`
- Wallet FFI: 
  - `fn completed_transaction_get_message(` removed
  - `fn pending_outbound_transaction_get_message(` removed
  - `fn pending_outbound_transaction_get_payment_id(` added
  - `fn pending_inbound_transaction_get_message(` removed
  - `fn pending_inbound_transaction_get_payment_id(` added
  - `fn wallet_send_transaction(` has interface change
- Wallet gRPC methods:
  - `message CreateBurnTransactionRequest {` has interface change
  - `message PaymentRecipient {` has interface change
  - `message TransactionInfo {` has interface change
  - `message CoinSplitRequest {` has interface change
  - `message ImportUtxosRequest {` has interface change
  - `message TransactionEvent {` has interface change
  - `message RegisterValidatorNodeRequest {` has interface change
  • Loading branch information
hansieodendaal authored Dec 13, 2024
1 parent 37c30be commit 686e7fd
Show file tree
Hide file tree
Showing 56 changed files with 1,759 additions and 1,059 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions applications/minotari_app_grpc/proto/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ message SendShaAtomicSwapRequest {
message CreateBurnTransactionRequest{
uint64 amount = 1;
uint64 fee_per_gram = 2;
string message = 3;
bytes claim_public_key = 4;
bytes payment_id = 5;
}


message PaymentRecipient {
string address = 1;
uint64 amount = 2;
uint64 fee_per_gram = 3;
string message = 4;
enum PaymentType {
STANDARD_MIMBLEWIMBLE = 0;
ONE_SIDED = 1;
Expand Down Expand Up @@ -191,7 +190,6 @@ message TransactionInfo {
bool is_cancelled = 8;
bytes excess_sig = 9;
uint64 timestamp = 10;
string message = 11;
bytes payment_id = 12;
}

Expand Down Expand Up @@ -257,8 +255,8 @@ message CoinSplitRequest {
uint64 amount_per_split = 1;
uint64 split_count = 2;
uint64 fee_per_gram = 3;
string message = 4;
uint64 lock_height = 5;
bytes payment_id = 6;
}

message CoinSplitResponse {
Expand All @@ -267,6 +265,7 @@ message CoinSplitResponse {

message ImportUtxosRequest {
repeated UnblindedOutput outputs = 1;
bytes payment_id = 2;
}

message ImportUtxosResponse {
Expand Down Expand Up @@ -330,7 +329,6 @@ message TransactionEvent {
string status = 5;
string direction = 6;
uint64 amount = 7;
string message = 8;
bytes payment_id = 9;
}

Expand All @@ -342,7 +340,7 @@ message RegisterValidatorNodeRequest {
bytes validator_node_public_key = 1;
Signature validator_node_signature = 2;
uint64 fee_per_gram = 3;
string message = 4;
bytes payment_id = 5;
}

message RegisterValidatorNodeResponse {
Expand Down
Loading

0 comments on commit 686e7fd

Please sign in to comment.