Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8aa6498
oko_sdk_sol: add oko_sdk_sol interface skeleton
Ryz0nd Dec 15, 2025
196256e
crypto: add teddsa rust implementation (FROST Ed25519)
Ryz0nd Dec 18, 2025
2e2426c
crypto: add teddsa typescript packages
Ryz0nd Dec 18, 2025
90a033e
backend/tss_api: add ed25519 keygen and sign endpoints
Ryz0nd Dec 18, 2025
cc33178
sdk/oko_sdk_core: add solana types and update oauth
Ryz0nd Dec 18, 2025
99fcaea
sdk/oko_sdk_sol: implement wallet signing methods
Ryz0nd Dec 18, 2025
8bded4c
embed/oko_attached: integrate solana signing with teddsa
Ryz0nd Dec 18, 2025
666184b
sandbox: add sandbox_sol for solana testing
Ryz0nd Dec 18, 2025
fe54cf1
chore: update dependencies
Ryz0nd Dec 18, 2025
ad535f7
teddsa: rename packages with _mock suffix
Ryz0nd Dec 19, 2025
866bb2a
o
Ryz0nd Dec 19, 2025
abbcddd
crypto: use local frost_ed25519 implementation in teddsa_keplr_mock
Ryz0nd Dec 19, 2025
9b57710
o
Ryz0nd Dec 19, 2025
b8ddf52
Revert "embed/oko_attached: integrate solana signing with teddsa"
Ryz0nd Dec 19, 2025
e2fc9ec
Revert "sdk/oko_sdk_core: add solana types and update oauth"
Ryz0nd Dec 19, 2025
6ff7e1f
Revert "backend/tss_api: add ed25519 keygen and sign endpoints"
Ryz0nd Dec 19, 2025
8001eb5
o
Ryz0nd Dec 22, 2025
fec8fd9
o
Ryz0nd Dec 22, 2025
633ad8a
oko_sdk_sol: add oko_sdk_sol interface skeleton
Ryz0nd Dec 15, 2025
db5cd4c
crypto: add teddsa rust implementation (FROST Ed25519)
Ryz0nd Dec 18, 2025
8756cb0
crypto: add teddsa typescript packages
Ryz0nd Dec 18, 2025
1531330
backend/tss_api: add ed25519 keygen and sign endpoints
Ryz0nd Dec 18, 2025
efd16dd
sdk/oko_sdk_core: add solana types and update oauth
Ryz0nd Dec 18, 2025
b2d9ef3
embed/oko_attached: integrate solana signing with teddsa
Ryz0nd Dec 18, 2025
d8d4d22
chore: update dependencies
Ryz0nd Dec 18, 2025
fa18a6b
teddsa: rename packages with _mock suffix
Ryz0nd Dec 19, 2025
e7811f2
o
Ryz0nd Dec 19, 2025
8a8fa76
crypto: use local frost_ed25519 implementation in teddsa_keplr_mock
Ryz0nd Dec 19, 2025
a15fbfe
Revert "embed/oko_attached: integrate solana signing with teddsa"
Ryz0nd Dec 19, 2025
feedee0
Revert "sdk/oko_sdk_core: add solana types and update oauth"
Ryz0nd Dec 19, 2025
ebfdbea
Revert "backend/tss_api: add ed25519 keygen and sign endpoints"
Ryz0nd Dec 19, 2025
4a5958e
o
Ryz0nd Dec 22, 2025
528a197
o
Ryz0nd Dec 22, 2025
ca47352
Merge branch 'main' into dan/oko-sdk-svm
eldenpark Dec 22, 2025
ec0c823
o
eldenpark Dec 22, 2025
8899b2d
o
eldenpark Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ members = [
"crypto/teddsa/frost_core",
"crypto/teddsa/frost_ed25519_keplr",
"crypto/teddsa/frost_rerandomized",
"crypto/teddsa/teddsa_keplr_mock",
"crypto/teddsa/teddsa_wasm_mock/wasm",
"crypto/teddsa/teddsa_keplr_addon_mock/addon",
"crypto/teddsa/frost_ed25519_keplr_wasm/wasm",
"key_share_node/key_share_node_2/core",
"key_share_node/key_share_node_2/pg_interface",
"key_share_node/key_share_node_2/server",

]

[workspace.dependencies]
cait_sith_keplr = { version = "=0.0.2-rc.4" }

# for frost_ed25519
frost_core = { path = "crypto/teddsa/frost_core", version = "2.2.0", default-features = false }
frost_ed25519_keplr = { path = "crypto/teddsa/frost_ed25519_keplr", version = "2.2.0", default-features = false }
frost_rerandomized = { path = "crypto/teddsa/frost_rerandomized", version = "2.2.0", default-features = false }

cait_sith_keplr = { version = "=0.0.2-rc.4" }
criterion = "0.6"
document-features = "0.2.7"
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
Expand Down
26 changes: 14 additions & 12 deletions crypto/teddsa/frost_ed25519_keplr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ features = ["serde"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
frost_rerandomized = { workspace = true }
frost_core = { workspace = true }

curve25519-dalek = { version = "=4.1.3", features = ["rand_core"] }
document-features.workspace = true
frost_core.workspace = true
frost_rerandomized.workspace = true
rand_core.workspace = true
document-features = { workspace = true }
rand_core = { workspace = true }
sha2 = { version = "0.10.2", default-features = false }

[dev-dependencies]
criterion.workspace = true
frost_core = { workspace = true, features = ["test-impl"] }
frost_rerandomized = { workspace = true, features = ["test-impl"] }

criterion = { workspace = true }
ed25519-dalek = "2.1.0"
insta.workspace = true
hex.workspace = true
lazy_static.workspace = true
proptest.workspace = true
rand.workspace = true
rand_chacha.workspace = true
serde_json.workspace = true
insta = { workspace = true }
hex = { workspace = true }
lazy_static = { workspace = true }
proptest = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
serde_json = { workspace = true }

[features]
default = ["serialization", "cheater-detection", "std"]
Expand Down
5 changes: 4 additions & 1 deletion crypto/teddsa/frost_ed25519_keplr_wasm/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ strip = true
#default = ["wee_alloc"]

[dependencies]
frost_ed25519_keplr = { path = "../../frost_ed25519_keplr", features = ["serde"] }
frost_ed25519_keplr = { path = "../../frost_ed25519_keplr", features = [
"serde",
] }

wasm-bindgen = "0.2.100"
curve25519-dalek = { version = "=4.1.3", features = ["rand_core"] }
serde = { version = "1.0", features = ["derive"] }
Expand Down
15 changes: 15 additions & 0 deletions crypto/teddsa/teddsa_hooks_mock/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@oko-wallet/teddsa-hooks-mock",
"main": "./src/index.ts",
"version": "0.1.0",
"private": true,
"dependencies": {
"@oko-wallet/bytes": "^0.0.3-alpha.62",
"@oko-wallet/stdlib-js": "^0.0.2-rc.42",
"@oko-wallet/teddsa-wasm-mock": "workspace:*"
},
"devDependencies": {
"@types/node": "^24.10.1",
"typescript": "^5.8.3"
}
}
3 changes: 3 additions & 0 deletions crypto/teddsa/teddsa_hooks_mock/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./keygen";
export * from "./sign";
export * from "./types";
93 changes: 93 additions & 0 deletions crypto/teddsa/teddsa_hooks_mock/src/keygen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { wasmModule } from "@oko-wallet/teddsa-wasm-mock";
import { Bytes } from "@oko-wallet/bytes";
import type { Bytes32 } from "@oko-wallet/bytes";
import type { Result } from "@oko-wallet/stdlib-js";

import type {
TeddsaKeygenResult,
TeddsaKeygenOutputBytes,
TeddsaCentralizedKeygenOutput,
} from "./types";

/**
* Import an existing Ed25519 secret key and split it into threshold shares.
*
* @param secretKey - 32-byte Ed25519 secret key
* @returns Result containing keygen shares for both participants
*/
export async function importExternalSecretKeyEd25519(
secretKey: Bytes32,
): Promise<Result<TeddsaKeygenResult, string>> {
try {
const keygenOutput: TeddsaCentralizedKeygenOutput =
wasmModule.cli_keygen_import_ed25519([...secretKey.toUint8Array()]);

return processKeygenOutput(keygenOutput);
} catch (error: any) {
return {
success: false,
err: String(error),
};
}
}

/**
* Generate a new 2-of-2 threshold Ed25519 key using centralized key generation.
*
* @returns Result containing keygen shares for both participants
*/
export async function runTeddsaKeygen(): Promise<
Result<TeddsaKeygenResult, string>
> {
try {
const keygenOutput: TeddsaCentralizedKeygenOutput =
wasmModule.cli_keygen_centralized_ed25519();

return processKeygenOutput(keygenOutput);
} catch (error: any) {
return {
success: false,
err: String(error),
};
}
}

/**
* Process raw WASM keygen output into typed result
*/
function processKeygenOutput(
keygenOutput: TeddsaCentralizedKeygenOutput,
): Result<TeddsaKeygenResult, string> {
const [keygen_1_raw, keygen_2_raw] = keygenOutput.keygen_outputs;

// Convert public key to Bytes32
const publicKeyBytesRes = Bytes.fromUint8Array(
new Uint8Array(keygenOutput.public_key),
32,
);
if (publicKeyBytesRes.success === false) {
return {
success: false,
err: publicKeyBytesRes.err,
};
}

const keygen_1: TeddsaKeygenOutputBytes = {
key_package: new Uint8Array(keygen_1_raw.key_package),
public_key_package: new Uint8Array(keygen_1_raw.public_key_package),
identifier: new Uint8Array(keygen_1_raw.identifier),
public_key: publicKeyBytesRes.data,
};

const keygen_2: TeddsaKeygenOutputBytes = {
key_package: new Uint8Array(keygen_2_raw.key_package),
public_key_package: new Uint8Array(keygen_2_raw.public_key_package),
identifier: new Uint8Array(keygen_2_raw.identifier),
public_key: publicKeyBytesRes.data, // Same public key for both participants
};

return {
success: true,
data: { keygen_1, keygen_2 },
};
}
Loading