Skip to content

Commit fc3e0e7

Browse files
committed
Upstream merge to iota v1.22.1
Summary: - [ ] tokio version update to: - - [ ] fastcrypto version update to rev = "-" - [x] iota-sdk-types (`https://github.com/iotaledger/iota-rust-sdk.git`) update to rev = 7c1434aabb2e7b11681722edaf1a51ac52941b84 - [x] changes in iota_interaction/src/sdk_types - [ ] iota_interaction_ts: new peerDep. version for @iota/iota-sdk: _ - [x] pin all iota.git dependencies to `tag = "v1.22.1"`
1 parent 1d3480d commit fc3e0e7

6 files changed

Lines changed: 27 additions & 55 deletions

File tree

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ bcs = "0.1.6"
2222
cfg-if = "1.0.0"
2323
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto" }
2424
hyper = "1"
25-
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
26-
iota-sdk-types = { git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "e19c78a1bee17e0bf85fcd5b16a2f080cef26274", features = ["hash", "serde", "schemars"] }
27-
move-binary-format = { git = "https://github.com/iotaledger/iota.git", package = "move-binary-format", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
28-
move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
29-
move-bytecode-utils = { git = "https://github.com/iotaledger/iota.git", package = "move-bytecode-utils", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
25+
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v1.22.1" }
26+
iota-sdk-types = { git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "7c1434aabb2e7b11681722edaf1a51ac52941b84", features = ["hash", "serde", "schemars"] }
27+
move-binary-format = { git = "https://github.com/iotaledger/iota.git", package = "move-binary-format", tag = "v1.22.1" }
28+
move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", tag = "v1.22.1" }
29+
move-bytecode-utils = { git = "https://github.com/iotaledger/iota.git", package = "move-bytecode-utils", tag = "v1.22.1" }
3030
phf = { version = "0.11.2", features = ["macros"] }
3131
secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.3.0" }
3232
serde = { version = "1.0", default-features = false, features = ["alloc", "derive", "rc"] }

iota_interaction/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ thiserror.workspace = true
3131

3232
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
3333
hyper.workspace = true
34-
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
35-
move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", rev = "96196f0da231883ec69cda04892c600ef6afa982" }
34+
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v1.22.1" }
35+
move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", tag = "v1.22.1" }
3636
tokio = { workspace = true, optional = true }
3737

3838
[target.'cfg(target_arch = "wasm32")'.dependencies]

iota_interaction/src/sdk_types/iota_types/crypto.rs

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -200,34 +200,19 @@ pub enum PublicKey {
200200
Ed25519(Ed25519PublicKeyAsBytes),
201201
Secp256k1(Secp256k1PublicKeyAsBytes),
202202
Secp256r1(Secp256r1PublicKeyAsBytes),
203-
ZkLogin(ZkLoginPublicIdentifier),
203+
#[deprecated(note = "zkLogin is deprecated and was never enabled on IOTA")]
204+
ZkLoginDeprecated,
204205
Passkey(Secp256r1PublicKeyAsBytes),
205206
}
206207

207-
/// A wrapper struct to retrofit in [enum PublicKey] for zkLogin.
208-
/// Useful to construct [struct MultiSigPublicKey].
209-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
210-
pub struct ZkLoginPublicIdentifier(pub Vec<u8>); // #[schemars(with = "Base64")]
211-
212-
impl ZkLoginPublicIdentifier {
213-
/// Consists of iss_bytes_len || iss_bytes || padded_32_byte_address_seed.
214-
pub fn new(iss: &str, address_seed: &Bn254FrElement) -> IotaResult<Self> {
215-
let mut bytes = Vec::new();
216-
let iss_bytes = iss.as_bytes();
217-
bytes.extend([iss_bytes.len() as u8]);
218-
bytes.extend(iss_bytes);
219-
bytes.extend(address_seed.padded());
220-
221-
Ok(Self(bytes))
222-
}
223-
}
224208
impl AsRef<[u8]> for PublicKey {
225209
fn as_ref(&self) -> &[u8] {
226210
match self {
227211
PublicKey::Ed25519(pk) => &pk.0,
228212
PublicKey::Secp256k1(pk) => &pk.0,
229213
PublicKey::Secp256r1(pk) => &pk.0,
230-
PublicKey::ZkLogin(z) => &z.0,
214+
#[allow(deprecated)]
215+
PublicKey::ZkLoginDeprecated => &[],
231216
PublicKey::Passkey(pk) => &pk.0,
232217
}
233218
}
@@ -306,7 +291,8 @@ impl PublicKey {
306291
PublicKey::Ed25519(_) => SignatureScheme::ED25519, // Equals Ed25519IotaSignature::SCHEME
307292
PublicKey::Secp256k1(_) => SignatureScheme::Secp256k1, // Equals Secp256k1IotaSignature::SCHEME
308293
PublicKey::Secp256r1(_) => SignatureScheme::Secp256r1, // Equals Secp256r1IotaSignature::SCHEME
309-
PublicKey::ZkLogin(_) => SignatureScheme::ZkLoginAuthenticator,
294+
#[allow(deprecated)]
295+
PublicKey::ZkLoginDeprecated => SignatureScheme::ZkLoginAuthenticatorDeprecated,
310296
PublicKey::Passkey(_) => SignatureScheme::PasskeyAuthenticator,
311297
}
312298
}
@@ -621,7 +607,7 @@ impl<S: IotaSignatureInner + Sized> IotaSignature for S {
621607
&self,
622608
value: &IntentMessage<T>,
623609
author: IotaAddress,
624-
scheme: SignatureScheme,
610+
_scheme: SignatureScheme,
625611
) -> Result<(), IotaError>
626612
where
627613
T: Serialize,
@@ -631,17 +617,11 @@ impl<S: IotaSignatureInner + Sized> IotaSignature for S {
631617
let digest = hasher.finalize().digest;
632618

633619
let (sig, pk) = &self.get_verification_inputs()?;
634-
match scheme {
635-
SignatureScheme::ZkLoginAuthenticator => {} // Pass this check because zk login does
636-
// not derive address from pubkey.
637-
_ => {
638-
let address = IotaAddress::from(pk);
639-
if author != address {
640-
return Err(IotaError::IncorrectSigner {
641-
error: format!("Incorrect signer, expected {author:?}, got {address:?}"),
642-
});
643-
}
644-
}
620+
let address = IotaAddress::from(pk);
621+
if author != address {
622+
return Err(IotaError::IncorrectSigner {
623+
error: format!("Incorrect signer, expected {author:?}, got {address:?}"),
624+
});
645625
}
646626

647627
pk.verify(&digest, sig)
@@ -659,7 +639,8 @@ pub enum SignatureScheme {
659639
Secp256r1,
660640
BLS12381, // This is currently not supported for user Iota Address.
661641
MultiSig,
662-
ZkLoginAuthenticator,
642+
#[deprecated(note = "zkLogin is deprecated and was never enabled on IOTA")]
643+
ZkLoginAuthenticatorDeprecated,
663644
PasskeyAuthenticator,
664645
MoveAuthenticator,
665646
}
@@ -673,7 +654,8 @@ impl SignatureScheme {
673654
SignatureScheme::MultiSig => 0x03,
674655
SignatureScheme::BLS12381 => 0x04, // This is currently not supported for user Iota
675656
// Address.
676-
SignatureScheme::ZkLoginAuthenticator => 0x05,
657+
#[allow(deprecated)]
658+
SignatureScheme::ZkLoginAuthenticatorDeprecated => 0x05,
677659
SignatureScheme::PasskeyAuthenticator => 0x06,
678660
SignatureScheme::MoveAuthenticator => 0x07,
679661
}
@@ -702,7 +684,8 @@ impl SignatureScheme {
702684
0x02 => Ok(SignatureScheme::Secp256r1),
703685
0x03 => Ok(SignatureScheme::MultiSig),
704686
0x04 => Ok(SignatureScheme::BLS12381),
705-
0x05 => Ok(SignatureScheme::ZkLoginAuthenticator),
687+
#[allow(deprecated)]
688+
0x05 => Ok(SignatureScheme::ZkLoginAuthenticatorDeprecated),
706689
0x06 => Ok(SignatureScheme::PasskeyAuthenticator),
707690
0x07 => Ok(SignatureScheme::MoveAuthenticator),
708691
_ => Err(IotaError::KeyConversion("Invalid key scheme".to_string())),

iota_interaction/src/sdk_types/iota_types/digests.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,18 +494,6 @@ impl fmt::Debug for ObjectDigest {
494494
}
495495
}
496496

497-
498-
/// A digest of a ZkLoginInputs, which commits to the signatures as well as the
499-
/// tx.
500-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
501-
pub struct ZKLoginInputsDigest(Digest);
502-
503-
impl ZKLoginInputsDigest {
504-
pub const fn new(digest: [u8; 32]) -> Self {
505-
Self(Digest::new(digest))
506-
}
507-
}
508-
509497
/// MoveAuthenticatorDigest is the hash (digest) of the `GenericSignature`
510498
/// payload when the transaction uses a `MoveAuthenticator` as its signature
511499
/// scheme. It is evaluated during the authentication phase of a transaction and

iota_interaction/src/sdk_types/iota_types/iota_serde.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ impl<T> Display for BigInt<T>
317317

318318
#[serde_as]
319319
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Copy, JsonSchema)]
320+
#[schemars(rename = "SequenceNumberBigInt")]
320321
pub struct SequenceNumber(#[schemars(with = "BigInt<u64>")] u64);
321322

322323
impl SerializeAs<super::base_types::SequenceNumber> for SequenceNumber {

product_common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async-trait.workspace = true
2323
bcs = { workspace = true, optional = true }
2424
cfg-if.workspace = true
2525
fastcrypto = { workspace = true, optional = true }
26-
iota-keys = { package = "iota-keys", git = "https://github.com/iotaledger/iota.git", rev = "96196f0da231883ec69cda04892c600ef6afa982", optional = true }
26+
iota-keys = { package = "iota-keys", git = "https://github.com/iotaledger/iota.git", tag = "v1.22.1", optional = true }
2727
iota-sdk-types = { workspace = true, features = ["serde"] }
2828
itertools = { version = "0.13.0", optional = true }
2929
lazy_static = { version = "1.5.0", optional = true }

0 commit comments

Comments
 (0)