@@ -20,6 +20,7 @@ use aptos_types::{
20
20
block_metadata:: BlockMetadata ,
21
21
block_metadata_ext:: BlockMetadataExt ,
22
22
contract_event:: { ContractEvent , EventWithVersion } ,
23
+ oidb,
23
24
transaction:: {
24
25
authenticator:: {
25
26
AccountAuthenticator , AnyPublicKey , AnySignature , MultiKey , MultiKeyAuthenticator ,
@@ -28,7 +29,6 @@ use aptos_types::{
28
29
webauthn:: { PartialAuthenticatorAssertionResponse , MAX_WEBAUTHN_SIGNATURE_BYTES } ,
29
30
Script , SignedTransaction , TransactionOutput , TransactionWithProof ,
30
31
} ,
31
- zkid,
32
32
} ;
33
33
use once_cell:: sync:: Lazy ;
34
34
use poem_openapi:: { Object , Union } ;
@@ -1198,24 +1198,24 @@ impl VerifyInput for WebAuthnSignature {
1198
1198
}
1199
1199
1200
1200
#[ derive( Clone , Debug , PartialEq , Eq , Serialize , Deserialize , Object ) ]
1201
- pub struct ZkIdSignature {
1201
+ pub struct OidbSignature {
1202
1202
pub public_key : HexEncodedBytes ,
1203
1203
pub signature : HexEncodedBytes ,
1204
1204
}
1205
1205
1206
- impl VerifyInput for ZkIdSignature {
1206
+ impl VerifyInput for OidbSignature {
1207
1207
fn verify ( & self ) -> anyhow:: Result < ( ) > {
1208
1208
let public_key_len = self . public_key . inner ( ) . len ( ) ;
1209
1209
let signature_len = self . signature . inner ( ) . len ( ) ;
1210
- if public_key_len > zkid :: ZkIdPublicKey :: MAX_LEN {
1210
+ if public_key_len > oidb :: OidbPublicKey :: MAX_LEN {
1211
1211
bail ! (
1212
- "zkID public key length is greater than the maximum number of {} bytes: found {} bytes" ,
1213
- zkid :: ZkIdPublicKey :: MAX_LEN , public_key_len
1212
+ "OIDB public key length is greater than the maximum number of {} bytes: found {} bytes" ,
1213
+ oidb :: OidbPublicKey :: MAX_LEN , public_key_len
1214
1214
)
1215
- } else if signature_len > zkid :: ZkIdSignature :: MAX_LEN {
1215
+ } else if signature_len > oidb :: OidbSignature :: MAX_LEN {
1216
1216
bail ! (
1217
- "zkID signature length is greater than the maximum number of {} bytes: found {} bytes" ,
1218
- zkid :: ZkIdSignature :: MAX_LEN , signature_len
1217
+ "OIDB signature length is greater than the maximum number of {} bytes: found {} bytes" ,
1218
+ oidb :: OidbSignature :: MAX_LEN , signature_len
1219
1219
)
1220
1220
} else {
1221
1221
Ok ( ( ) )
@@ -1230,7 +1230,7 @@ pub enum Signature {
1230
1230
Ed25519 ( HexEncodedBytes ) ,
1231
1231
Secp256k1Ecdsa ( HexEncodedBytes ) ,
1232
1232
WebAuthn ( HexEncodedBytes ) ,
1233
- ZkId ( HexEncodedBytes ) ,
1233
+ Oidb ( HexEncodedBytes ) ,
1234
1234
}
1235
1235
1236
1236
impl TryFrom < Signature > for AnySignature {
@@ -1241,7 +1241,7 @@ impl TryFrom<Signature> for AnySignature {
1241
1241
Signature :: Ed25519 ( s) => AnySignature :: ed25519 ( s. inner ( ) . try_into ( ) ?) ,
1242
1242
Signature :: Secp256k1Ecdsa ( s) => AnySignature :: secp256k1_ecdsa ( s. inner ( ) . try_into ( ) ?) ,
1243
1243
Signature :: WebAuthn ( s) => AnySignature :: webauthn ( s. inner ( ) . try_into ( ) ?) ,
1244
- Signature :: ZkId ( s) => AnySignature :: zkid ( s. inner ( ) . try_into ( ) ?) ,
1244
+ Signature :: Oidb ( s) => AnySignature :: oidb ( s. inner ( ) . try_into ( ) ?) ,
1245
1245
} )
1246
1246
}
1247
1247
}
@@ -1258,7 +1258,7 @@ impl From<AnySignature> for Signature {
1258
1258
AnySignature :: WebAuthn { signature } => {
1259
1259
Signature :: WebAuthn ( signature. to_bytes ( ) . to_vec ( ) . into ( ) )
1260
1260
} ,
1261
- AnySignature :: ZkId { signature } => Signature :: ZkId ( signature. to_bytes ( ) . into ( ) ) ,
1261
+ AnySignature :: OIDB { signature } => Signature :: Oidb ( signature. to_bytes ( ) . into ( ) ) ,
1262
1262
}
1263
1263
}
1264
1264
}
@@ -1270,7 +1270,7 @@ pub enum PublicKey {
1270
1270
Ed25519 ( HexEncodedBytes ) ,
1271
1271
Secp256k1Ecdsa ( HexEncodedBytes ) ,
1272
1272
Secp256r1Ecdsa ( HexEncodedBytes ) ,
1273
- ZkId ( HexEncodedBytes ) ,
1273
+ Oidb ( HexEncodedBytes ) ,
1274
1274
}
1275
1275
1276
1276
impl TryFrom < PublicKey > for AnyPublicKey {
@@ -1281,7 +1281,7 @@ impl TryFrom<PublicKey> for AnyPublicKey {
1281
1281
PublicKey :: Ed25519 ( p) => AnyPublicKey :: ed25519 ( p. inner ( ) . try_into ( ) ?) ,
1282
1282
PublicKey :: Secp256k1Ecdsa ( p) => AnyPublicKey :: secp256k1_ecdsa ( p. inner ( ) . try_into ( ) ?) ,
1283
1283
PublicKey :: Secp256r1Ecdsa ( p) => AnyPublicKey :: secp256r1_ecdsa ( p. inner ( ) . try_into ( ) ?) ,
1284
- PublicKey :: ZkId ( p) => AnyPublicKey :: zkid ( p. inner ( ) . try_into ( ) ?) ,
1284
+ PublicKey :: Oidb ( p) => AnyPublicKey :: oidb ( p. inner ( ) . try_into ( ) ?) ,
1285
1285
} )
1286
1286
}
1287
1287
}
@@ -1298,7 +1298,7 @@ impl From<AnyPublicKey> for PublicKey {
1298
1298
AnyPublicKey :: Secp256r1Ecdsa { public_key } => {
1299
1299
PublicKey :: Secp256r1Ecdsa ( public_key. to_bytes ( ) . to_vec ( ) . into ( ) )
1300
1300
} ,
1301
- AnyPublicKey :: ZkId { public_key } => PublicKey :: ZkId ( public_key. to_bytes ( ) . into ( ) ) ,
1301
+ AnyPublicKey :: OIDB { public_key } => PublicKey :: Oidb ( public_key. to_bytes ( ) . into ( ) ) ,
1302
1302
}
1303
1303
}
1304
1304
}
@@ -1330,7 +1330,7 @@ impl VerifyInput for SingleKeySignature {
1330
1330
signature : s. clone ( ) ,
1331
1331
}
1332
1332
. verify ( ) ,
1333
- ( PublicKey :: ZkId ( p) , Signature :: ZkId ( s) ) => ZkIdSignature {
1333
+ ( PublicKey :: Oidb ( p) , Signature :: Oidb ( s) ) => OidbSignature {
1334
1334
public_key : p. clone ( ) ,
1335
1335
signature : s. clone ( ) ,
1336
1336
}
@@ -1374,12 +1374,12 @@ impl TryFrom<SingleKeySignature> for AccountAuthenticator {
1374
1374
) ?;
1375
1375
AnyPublicKey :: secp256r1_ecdsa ( key)
1376
1376
} ,
1377
- PublicKey :: ZkId ( p) => {
1377
+ PublicKey :: Oidb ( p) => {
1378
1378
let key = p
1379
1379
. inner ( )
1380
1380
. try_into ( )
1381
- . context ( "Failed to parse given public_key bytes as ZkIdPublicKey " ) ?;
1382
- AnyPublicKey :: zkid ( key)
1381
+ . context ( "Failed to parse given public_key bytes as OidbPublicKey " ) ?;
1382
+ AnyPublicKey :: oidb ( key)
1383
1383
} ,
1384
1384
} ;
1385
1385
@@ -1405,12 +1405,12 @@ impl TryFrom<SingleKeySignature> for AccountAuthenticator {
1405
1405
. context ( "Failed to parse given signature bytes as PartialAuthenticatorAssertionResponse" ) ?;
1406
1406
AnySignature :: webauthn ( signature)
1407
1407
} ,
1408
- Signature :: ZkId ( s) => {
1408
+ Signature :: Oidb ( s) => {
1409
1409
let signature = s
1410
1410
. inner ( )
1411
1411
. try_into ( )
1412
- . context ( "Failed to parse given signature bytes as ZkIdSignature " ) ?;
1413
- AnySignature :: zkid ( signature)
1412
+ . context ( "Failed to parse given signature bytes as OidbSignature " ) ?;
1413
+ AnySignature :: oidb ( signature)
1414
1414
} ,
1415
1415
} ;
1416
1416
@@ -1475,12 +1475,12 @@ impl TryFrom<MultiKeySignature> for AccountAuthenticator {
1475
1475
) ?;
1476
1476
AnyPublicKey :: secp256r1_ecdsa ( key)
1477
1477
} ,
1478
- PublicKey :: ZkId ( p) => {
1478
+ PublicKey :: Oidb ( p) => {
1479
1479
let key = p
1480
1480
. inner ( )
1481
1481
. try_into ( )
1482
- . context ( "Failed to parse given public_key bytes as ZkIdPublicKey " ) ?;
1483
- AnyPublicKey :: zkid ( key)
1482
+ . context ( "Failed to parse given public_key bytes as OidbPublicKey " ) ?;
1483
+ AnyPublicKey :: oidb ( key)
1484
1484
} ,
1485
1485
} ;
1486
1486
public_keys. push ( key) ;
@@ -1508,12 +1508,12 @@ impl TryFrom<MultiKeySignature> for AccountAuthenticator {
1508
1508
) ?;
1509
1509
AnySignature :: webauthn ( paar)
1510
1510
} ,
1511
- Signature :: ZkId ( s) => {
1511
+ Signature :: Oidb ( s) => {
1512
1512
let signature = s
1513
1513
. inner ( )
1514
1514
. try_into ( )
1515
- . context ( "Failed to parse given signature as ZkIdSignature " ) ?;
1516
- AnySignature :: zkid ( signature)
1515
+ . context ( "Failed to parse given signature as OidbSignature " ) ?;
1516
+ AnySignature :: oidb ( signature)
1517
1517
} ,
1518
1518
} ;
1519
1519
signatures. push ( ( indexed_signature. index , signature) ) ;
0 commit comments