Skip to content

Migrate Tezos to Rust #4434

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Migrate Tezos to Rust #4434

wants to merge 9 commits into from

Conversation

gupnik
Copy link
Collaborator

@gupnik gupnik commented Jun 30, 2025

Description

This PR migrates Tezos from C++ to Rust.

How to test

Run tests

Types of changes

Refactor

Checklist

  • Create pull request as draft initially, unless its complete.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description.

If you're adding a new blockchain

  • I have read the guidelines for adding a new blockchain.

@gupnik gupnik marked this pull request as ready for review July 8, 2025 05:32
@gupnik gupnik requested a review from satoshiotomakan as a code owner July 8, 2025 05:32
@gupnik gupnik changed the title [WIP]: Migrate Tezos to Rust Migrate Tezos to Rust Jul 8, 2025
Copy link

github-actions bot commented Jul 8, 2025

Binary size comparison

➡️ aarch64-apple-ios:

- 14.07 MB
+ 14.13 MB 	 +67 KB

➡️ aarch64-apple-ios-sim:

- 14.07 MB
+ 14.14 MB 	 +67 KB

➡️ aarch64-linux-android:

- 18.56 MB
+ 18.67 MB 	 +109 KB

➡️ armv7-linux-androideabi:

- 15.53 MB
+ 15.60 MB 	 +76 KB

➡️ wasm32-unknown-emscripten:

- 13.23 MB
+ 13.29 MB 	 +65 KB

Copy link
Collaborator

@satoshiotomakan satoshiotomakan left a comment

Choose a reason for hiding this comment

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

Good job! A few minor things please

Comment on lines 38 to 45
pub fn base58_to_hex(input: &str, prefix_length: usize) -> String {
let decoded = match decode_check(input, Alphabet::Bitcoin) {
Ok(d) => d,
Err(_) => return String::new(),
};

if decoded.len() < prefix_length {
return String::new();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't return an error instead?

Comment on lines 78 to 79
let decoded =
decode_check(private_key, Alphabet::Bitcoin).map_err(|_| KeyPairError::InvalidSecretKey)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please wrap to Zeroized

.map_err(|_| SigningErrorType::Error_internal)?;

let mut watermarked_data = Vec::new();
watermarked_data.push(0x03);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Magic value

// Optional modules:
type JsonSigner = NoJsonSigner;
type PlanBuilder = NoPlanBuilder;
type MessageSigner = NoMessageSigner;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we need to add a TezosMessageSigner module to be able to handle TWMessageSigner requests

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

Successfully merging this pull request may close these issues.

2 participants