Skip to content

feat(protocol): [1] solana support#2598

Merged
shamardy merged 24 commits intodevfrom
initial_solana_wallet_support
Sep 11, 2025
Merged

feat(protocol): [1] solana support#2598
shamardy merged 24 commits intodevfrom
initial_solana_wallet_support

Conversation

@onur-ozkan
Copy link
Copy Markdown

@onur-ozkan onur-ozkan commented Aug 18, 2025

Implements solana coin and token activations along with various wallet functions (things like balance query, current block query, etc.).

Documentation issues will be opened at the end of the whole implementation.

All the code is backed with enable-solana feature and is disabled by default.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the initial_solana_wallet_support branch from a704456 to 57bf36c Compare August 20, 2025 08:42
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the initial_solana_wallet_support branch from 3a2edf9 to 30b720d Compare August 26, 2025 09:46
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan marked this pull request as ready for review August 28, 2025 04:24
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the initial_solana_wallet_support branch from 4d0c41c to 4582945 Compare August 28, 2025 04:32
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This is only an initial quick review, more in depth review should follow.

Comment thread mm2src/coins/solana/solana_coin.rs Outdated
Comment thread mm2src/mm2_main/Cargo.toml Outdated
}

let priv_key = match priv_key_policy {
PrivKeyBuildPolicy::IguanaPrivKey(priv_key) => priv_key,
Copy link
Copy Markdown
Collaborator

@shamardy shamardy Aug 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to decide if we want to continue supporting iguana for new protocols or not. It's fine to do this for this preliminary PR until I have more info on this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we will continue to support iguana for solana. Resolving this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolving again as this iguana private key (an secp256k1 secret) shouldn't be used as the seed for an ed25519 keypair. I would rather hardcode the solana derivation path (m/44'/501'/0'/0') and generate one ed25519 keypair to be used but this requires some work on our crypto crate, we will also have problems when implementing things such as orderbook_address as we can't generate the solana address (which is an ed25519 pubkey) from the secp256k1 pubkey, same issues are faced in SIA implementation btw https://github.com/KomodoPlatform/komodo-defi-framework/blob/1ae24a37c122ad0cc3b121bec4342a84a20c2467/mm2src/mm2_main/src/lp_ordermatch.rs#L6296-L6298
For iguana in SIA, we did the same as what you did here and used the private key bytes as seed. I can allow it but it's not right at all. Another reason why iguana should be treated as legacy and disabled for non‑secp256k1 protocols like Solana and SIA.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would postpone finding the right solution and focus on the missing parts first. Then during the swap implementation, we can revisit this. Since we don't yet have a functional Solana implementation, I would prefer to get that working first and then brainstorm on this problem.

I can leave a TODO note if you would agree on this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would postpone finding the right solution and focus on the missing parts first.

ok.

Then during the swap implementation, we can revisit this. Since we don't yet have a functional Solana implementation, I would prefer to get that working first and then brainstorm on this problem.

By then, SIA PR would have been merged probably and someone would have fixed this problem for SIA and Solana can reuse the solution easily.

I can leave a TODO note if you would agree on this.

Sure thing.

Comment thread mm2src/coins/solana/solana_coin.rs Outdated
Comment thread mm2src/coins/lp_coins.rs Outdated
Comment thread mm2src/coins/lp_coins.rs Outdated
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the initial_solana_wallet_support branch from 64cfae0 to 25b5821 Compare September 1, 2025 08:06
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan requested a review from shamardy September 8, 2025 11:57
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next review iteration focusing on deps!

Comment thread Cargo.lock Outdated
Comment thread mm2src/coins/Cargo.toml Outdated
Comment thread mm2src/coins/Cargo.toml Outdated
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes! Last review from my side :)

Comment thread Cargo.lock
Comment thread Cargo.lock
Comment thread mm2src/coins/solana/solana_token.rs Outdated
Comment thread mm2src/coins_activation/src/solana_with_assets.rs Outdated
Comment thread mm2src/coins/solana/solana_coin.rs Outdated
Comment thread mm2src/coins/solana/solana_token.rs Outdated
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the initial_solana_wallet_support branch from 17de031 to 0bb9a3b Compare September 10, 2025 09:28
@onur-ozkan onur-ozkan requested a review from shamardy September 10, 2025 09:44
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@shamardy shamardy merged commit d6e2324 into dev Sep 11, 2025
19 of 25 checks passed
@shamardy shamardy deleted the initial_solana_wallet_support branch September 11, 2025 07:36
dimxy pushed a commit that referenced this pull request Oct 15, 2025
Implements solana coin and token activations along with various wallet functions (things like balance query, current block query, etc.). All the code is backed with enable-solana feature and is disabled by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants