Skip to content

Conversation

@DaughterOfMars
Copy link
Contributor

Description

Adds a new trait to the transaction builder crate, Signer, which defines one simple method sign to sign a transaction asynchronously. This is implemented for any type that implements IotaSigner and thus supports basic signing as well as passing the transaction to other services which hold the appropriate secrets.

Closes #436

@DaughterOfMars DaughterOfMars requested a review from a team as a code owner December 3, 2025 08:14
@coveralls
Copy link

coveralls commented Dec 3, 2025

Pull Request Test Coverage Report for Build 19886963795

Details

  • 14 of 28 (50.0%) changed or added relevant lines in 5 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.007%) to 85.047%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/iota-sdk-transaction-builder/src/error.rs 0 3 0.0%
crates/iota-sdk-transaction-builder/src/builder/mod.rs 2 7 28.57%
crates/iota-sdk-transaction-builder/src/builder/gas_station.rs 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
crates/iota-sdk-transaction-builder/src/builder/gas_station.rs 1 0.0%
crates/iota-sdk-types/src/crypto/signature.rs 1 74.78%
crates/iota-sdk-crypto/src/simple.rs 7 75.0%
Totals Coverage Status
Change from base Build 19879363869: -0.007%
Covered Lines: 20965
Relevant Lines: 24651

💛 - Coveralls

Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

What does this PR mean for the FFIs?

@DaughterOfMars
Copy link
Contributor Author

What does this PR mean for the FFIs?

No change to that API

@thibault-martinez
Copy link
Member

What does this PR mean for the FFIs?

No change to that API

I know but my point was that maybe it should? Bindings won't have traits so the existing methods still take a SimpleKeyPair, what will happen when we want another method for a new signer? We should at least rename the existing ones to have key_pair in the name?

/// This trait can be implemented downstream to enable signing when using the
/// [`TransactionBuilder`](crate::TransactionBuilder)
/// [`execute`](crate::TransactionBuilder::execute) function.
pub trait Signer {
Copy link
Member

@thibault-martinez thibault-martinez Dec 11, 2025

Choose a reason for hiding this comment

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

I have thought about our discussion a bit more and concluded that I would be fine with this only handling transaction signatures if we rename it to TransactionSigner. This ends up in the global scope of the bindings and having something called Signer than handles only one of the signature possibilities is just not ok. I can do it if you want.

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.

Enable signing operations through APIs that support the enclave principle

5 participants