Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.{js,jsx,ts,tsx,css,scss,html,json,md}]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ broadcast
node_modules
dist
*.tsbuildinfo
.eslintcache

# Project files
.db
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ repos:
entry: forge fmt
language: system
files: \.sol$
- id: prettier
name: prettier
entry: npx prettier --write
language: system
files: \.(js|jsx|ts|tsx|json|css|scss|md|html|toml)$
pass_filenames: true
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pnpm-lock.yaml

**/*.toml
**/*.sol

crates/*
lib/*
target/*
2 changes: 2 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
semi = false
singleQuote = true
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"solidity.packageDefaultDependenciesContractsDirectory": "contracts",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.exclude": ["lib/**"]
}
}
23 changes: 0 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Universal Timestamps is a super set of [opentimestamps](https://opentimestamps.o

- Rust >= 1.94.0-nightly (e7d44143a 2025-12-24)
- Cargo >= 1.94.0-nightly (3861f60f6 2025-12-19)
- [wasm-pack](https://drager.github.io/wasm-pack/installer/)
- pnpm >= 10.26.2
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"vue": "^3.5.24",
"uts-sdk": "workspace:*"
"@uts/sdk": "workspace:*"
},
"devDependencies": {
"@types/node": "^24.10.1",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ defineProps<{ msg: string }>()

const count = ref(0)

const sdk = new UtsSDK();
await sdk.ensureInit();
const sdk = new UtsSDK()
await sdk.ensureInit()

sdk.mergeTimestamps([[]]);
sdk.mergeTimestamps([[]])
</script>

<template>
Expand Down
5 changes: 4 additions & 1 deletion apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
],
"compilerOptions": {
"composite": true
}
}
4 changes: 2 additions & 2 deletions crates/bmt/benches/tree_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use digest::{Digest, FixedOutputReset, Output};
use sha2::Sha256;
use sha3::Keccak256;
use std::hint::black_box;
use uts_bmt::UnorderdMerkleTree;
use uts_bmt::UnorderedMerkleTree;

const INPUT_SIZES: &[usize] = &[8, 1024, 65536, 1_048_576];

Expand All @@ -34,7 +34,7 @@ where
group.bench_function(BenchmarkId::new(id, size), move |b| {
// Tree construction is the operation under test.
b.iter(|| {
let tree = UnorderdMerkleTree::<D>::new(black_box(leaves.as_slice()));
let tree = UnorderedMerkleTree::<D>::new(black_box(leaves.as_slice()));
black_box(tree);
});
});
Expand Down
12 changes: 6 additions & 6 deletions crates/bmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const INNER_NODE_PREFIX: u8 = 0x01;
///
/// Leaves are **sorted** starting at index `len`.
#[derive(Debug, Clone, Default)]
pub struct UnorderdMerkleTree<D: Digest> {
pub struct UnorderedMerkleTree<D: Digest> {
/// Index 0 is not used, leaves start at index `len`.
nodes: Box<[Output<D>]>,
len: usize,
Expand All @@ -28,7 +28,7 @@ pub struct UnhashedFlatMerkleTree<D: Digest> {
len: usize,
}

impl<D: Digest + FixedOutputReset> UnorderdMerkleTree<D>
impl<D: Digest + FixedOutputReset> UnorderedMerkleTree<D>
where
Output<D>: Pod + Copy,
{
Expand Down Expand Up @@ -128,7 +128,7 @@ where
Output<D>: Pod + Copy,
{
/// Finalizes the Merkle tree by hashing internal nodes
pub fn finalize(self) -> UnorderdMerkleTree<D> {
pub fn finalize(self) -> UnorderedMerkleTree<D> {
let mut nodes = self.buffer;
let len = self.len;
unsafe {
Expand All @@ -152,7 +152,7 @@ where
// SAFETY: initialized all elements.
nodes.set_len(2 * len);
}
UnorderdMerkleTree {
UnorderedMerkleTree {
nodes: nodes.into_boxed_slice(),
len,
}
Expand Down Expand Up @@ -234,7 +234,7 @@ mod tests {
];
leaves.sort_unstable();

let tree = UnorderdMerkleTree::<D>::new(&leaves);
let tree = UnorderedMerkleTree::<D>::new(&leaves);

// Manually compute the expected root
let mut hasher = D::new();
Expand Down Expand Up @@ -265,7 +265,7 @@ mod tests {
];
leaves.sort_unstable();

let tree = UnorderdMerkleTree::<D>::new(&leaves);
let tree = UnorderedMerkleTree::<D>::new(&leaves);

for leaf in &leaves {
let mut iter = tree
Expand Down
4 changes: 2 additions & 2 deletions crates/calendar/src/routes/ots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bytes::BytesMut;
use digest::Digest;
use sha3::Keccak256;
use std::{cell::RefCell, sync::Arc};
use uts_bmt::UnorderdMerkleTree;
use uts_bmt::UnorderedMerkleTree;
use uts_core::{
codec::{
Encode,
Expand Down Expand Up @@ -154,7 +154,7 @@ pub async fn get_timestamp(
.load_entry(root)
.expect("DB error")
.expect("bug: entry not found");
let trie: UnorderdMerkleTree<Keccak256> = entry.trie();
let trie: UnorderedMerkleTree<Keccak256> = entry.trie();

let proof = trie
.get_proof_iter(bytemuck::cast_ref(&*commitment))
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/stamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use futures::TryFutureExt;
use std::{collections::HashMap, future::ready, io, path::PathBuf, sync::LazyLock, time::Duration};
use tokio::{fs, io::AsyncWriteExt};
use url::Url;
use uts_bmt::UnorderdMerkleTree;
use uts_bmt::UnorderedMerkleTree;
use uts_core::{
codec::{
Decode, Encode, VersionedProof,
Expand Down Expand Up @@ -97,7 +97,7 @@ impl Stamp {
})
.collect::<Vec<_>>();

let internal_tire = UnorderdMerkleTree::<D>::new(&nonced_digest);
let internal_tire = UnorderedMerkleTree::<D>::new(&nonced_digest);
let root = internal_tire.root();
eprintln!("Internal Merkle root: {}", Hexed(root));

Expand Down
23 changes: 0 additions & 23 deletions crates/core-wasm/Cargo.toml

This file was deleted.

Loading