Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
c3ff5aa
type_tag: include source string in parse error
bmwill Aug 21, 2024
1368bca
sui-graphql-client: introduce initial implementation a sui GraphQL cl…
stefan-mysten Sep 16, 2024
56f9983
graphql: update to latest graphql schema (#7)
stefan-mysten Sep 19, 2024
91f2aa7
graphql: add a few tests (#8)
stefan-mysten Sep 23, 2024
e7c624a
coin: use Cow for coin_type
bmwill Sep 25, 2024
24937c8
signature: add bytes and base64 to/from methods for UserSignature
bmwill Sep 20, 2024
19defd5
types: introduce Intent types
bmwill Sep 20, 2024
e7277fe
types: introduce PersonalMessage
bmwill Sep 20, 2024
cf6a0d2
hash: add methods for getting the signing digest
bmwill Sep 20, 2024
2314407
crypto: remove unused private key types
bmwill Sep 20, 2024
8919b3c
sui-sdk-crypto: introduce crate to handle signing and verifying
bmwill Sep 20, 2024
143e425
crypto: introduce secp256r1 support
bmwill Sep 20, 2024
593229c
crypto: tweak dependencies and default features
bmwill Sep 20, 2024
bc23a3c
crypto: introduce secp256k1 support
bmwill Sep 20, 2024
5fe9286
crypto: use wasm compatible k256 library for secp256k1 support
bmwill Sep 20, 2024
70f6b86
crypto: introduce zklogin verifier support
bmwill Sep 22, 2024
e91e374
chore: rename sui-sdk to sui-sdk-types
bmwill Sep 25, 2024
c6679d1
chore: rename sui-sdk-crypto to sui-crypto
bmwill Sep 25, 2024
59cd22d
sui-graphql-client: ignore test_object_query test
bmwill Sep 25, 2024
c77df1d
fix doc link in readme
bmwill Sep 25, 2024
08e4901
prepare sui-sdk-types-0.0.1 and sui-crypto-0.0.1
bmwill Sep 26, 2024
5b616d6
chore: update crates to latest versions (#19)
stefan-mysten Sep 29, 2024
99abfff
sui-graphql-rpc: add balance function (#13)
stefan-mysten Sep 29, 2024
536efc0
sui-graphql-client: add coins function (#12)
stefan-mysten Sep 30, 2024
94d94fc
sui-graphql-client: introduce a faucet client (#11)
stefan-mysten Sep 30, 2024
f13e286
sui-graphql-client: use 0x0 as sender for event if none (#20)
stefan-mysten Oct 1, 2024
3918631
sui-graphql-client: add method for querying total supply of a coin (#17)
stefan-mysten Oct 1, 2024
0466c33
sui-graphql-client: add execute transaction query (#22)
stefan-mysten Oct 1, 2024
622eb29
sui-graphql-client: ignore events test due to graphql server failures…
stefan-mysten Oct 1, 2024
8c21ee2
sui-graphql-client: add active validators query function (#21)
stefan-mysten Oct 1, 2024
29d771b
chore: format with imports_granularity=Item (#27)
bmwill Oct 1, 2024
d1ddd4a
sui-graphql-client: use Address as scalar for SuiAddress (#28)
stefan-mysten Oct 1, 2024
acab9c3
sui-crypto: introduce multisig verifier and aggregator (#25)
bmwill Oct 2, 2024
c2fc061
sui-graphql-client: impl_scalar for u64 and Uint53 (#29)
stefan-mysten Oct 4, 2024
3cfa333
sui-graphql-client: add dry run query (#23)
stefan-mysten Oct 9, 2024
d3e28df
sui-graphql-client: avoid an extra RPC call by checking if first and …
stefan-mysten Oct 15, 2024
58f537d
sui-graphql-client: fix transaction(s) query (#32)
stefan-mysten Oct 15, 2024
6fbaa8a
type_tag: add StructTag parsing test case
bmwill Oct 16, 2024
884e66f
types: improve format of UnresolvedTransaction
bmwill Oct 15, 2024
011f48c
sui-graphql-client: update GraphQL schema and fix events to use the n…
stefan-mysten Oct 16, 2024
02f0088
sui-graphql-client: add checkpoints query (#34)
stefan-mysten Oct 17, 2024
ddd70f9
sui-graphql-client: rework the Page type to support empty pages (#36)
stefan-mysten Oct 18, 2024
9660c00
sui-graphql-client: add a pagination filter (#37)
stefan-mysten Oct 18, 2024
3add028
passkey: update passkey challenge format
bmwill Oct 21, 2024
3d70541
sui-graphql-client: simplify pagination filter usage (#39)
stefan-mysten Oct 22, 2024
0ca4534
ci: separate tests that require network and run localnet in ci (#38)
stefan-mysten Oct 22, 2024
c642db8
sui-graphql-client: fix coin stream test (#42)
stefan-mysten Oct 23, 2024
fbaa407
sui-graphql-client: add dynamic fields query (#18)
stefan-mysten Oct 23, 2024
ec1101d
sui-graphql-client: fix return of bcs and typetag in DynamicFieldOutp…
stefan-mysten Oct 25, 2024
ab5583d
sui-graphql-client: return Result<Page> instead of Result<Option<Page…
stefan-mysten Oct 25, 2024
7b7ff53
crypto: add blanket implementation for SuiSigner and SuiVerifier
bmwill Oct 26, 2024
5dadea8
crypto: support der and pem format for pub/priv keys
bmwill Oct 27, 2024
16cf4c3
crypto: introduce SimpleKeypair type
bmwill Oct 27, 2024
4ebdf60
crypto: rexpect UserSignatureVerifier from top-level
bmwill Oct 27, 2024
37b7ca3
crypto: collapse 'der' feature into 'pem'
bmwill Oct 27, 2024
bc763fc
sui-graphql-client: add some more doc comments (#50)
stefan-mysten Oct 28, 2024
30b19e2
sui-graphql-client: add total transaction blocks query (#47)
stefan-mysten Oct 28, 2024
08b7196
sui-graphql-client: change PaginationFilter to use a String vs &str (…
stefan-mysten Oct 28, 2024
5d4129c
sui-graphql-client: add normalized move function and module queries (…
stefan-mysten Oct 28, 2024
910cf62
sui-graphql-client: add suins queries (#48)
stefan-mysten Oct 30, 2024
96a6762
sui-graphql-client: add generic stream impl (#51)
stefan-mysten Oct 31, 2024
bd57a3b
sui-graphql-client: add package queries (#33)
stefan-mysten Oct 31, 2024
08d0569
sui-graphql-client: properly await pagination_filter query (#52)
stefan-mysten Oct 31, 2024
aa191e9
sui-graphql-client: make dynamic field queries using owner (#54)
stefan-mysten Nov 1, 2024
c1cadd8
sui-graphql-client: cleanup of Option<Page> and add tests back (#56)
stefan-mysten Nov 11, 2024
b2014de
ci: set toolchain to 1.81.0 for wasm builds
bmwill Nov 11, 2024
aa68191
sui-graphql-client: add a build crate to allow registering schema in …
stefan-mysten Nov 11, 2024
f54460d
sui-graphql-client: initialize service config and max page size lazil…
stefan-mysten Nov 11, 2024
43693e5
sui-graphql-client: add transaction effects query (#55)
stefan-mysten Nov 13, 2024
7c95d7e
sui-graphql-client: rework errors (#58)
stefan-mysten Nov 14, 2024
bc937e0
sui-sdk-types: rename types and add constructors for unresolved::Valu…
stefan-mysten Nov 19, 2024
f3eafe1
types: improve construction and accessing of inner fields
bmwill Nov 20, 2024
0e8c4ad
types: fix schema names for unresolved types
bmwill Nov 20, 2024
cfec53d
Fix issue with serde renaming (#63)
stefan-mysten Nov 22, 2024
9f88b5a
types: enable proptest::Arbitrary impls via the 'proptest' feature
bmwill Dec 4, 2024
4a1aed0
types: fix Arbitrary impl for Identifier
bmwill Dec 4, 2024
1a6b0ae
sui-sdk-types: address rust 1.82 clippy lints (#65)
stefan-mysten Dec 5, 2024
c6cbb51
sui-transaction-builder: introduce a crate for building transaction (…
stefan-mysten Dec 5, 2024
4d1c2e3
types: add accessors and constructor for PasskeyAuthenticator
bmwill Dec 6, 2024
61b4dd5
sui-graphql-client: make pagination consistent across queries (#66)
stefan-mysten Dec 11, 2024
e1e7ad8
roaring: pin to 0.10.6 to work around no-std breakage
bmwill Dec 11, 2024
dd6d262
sui-graphql-client: return a tuple of Event, TxDigest when querying e…
stefan-mysten Dec 11, 2024
87492b3
Update GraphQL schema to v1.39.0
stefan-mysten Dec 12, 2024
96823e9
Use Sui CLI from version 1.39.1 that matches the GraphQL schema
stefan-mysten Dec 12, 2024
f40dc53
sui-graphql-client: use `bcs` from `Checkpoint` instead of manual con…
stefan-mysten Dec 12, 2024
7bb8d1f
sui-graphql-client: use typed digests for queries (#59)
stefan-mysten Dec 12, 2024
a12f7b1
ci: update to sui v1.39.3 and use --ignore-chain in sui move build (#75)
stefan-mysten Dec 18, 2024
9279183
sui-graphql-client: update docs for using custom queries (#76)
stefan-mysten Dec 19, 2024
52d18aa
feat(sui-sdk-types): add From<StructTag> for TypeTag (#77)
unmaykr-aftermath Dec 19, 2024
c83ab6f
roaring: update to v0.10.9 (#79)
bmwill Dec 19, 2024
6381c5e
sui-graphql-client: use rustls instead of openssl for reqwest (#80)
stefan-mysten Dec 19, 2024
f2a4f42
sui-graphql-client: add retry to getting coins from faucet to fix fla…
stefan-mysten Dec 19, 2024
f5a37b1
sui-crypto: add support for verifying passkey authenticators (#81)
bmwill Dec 19, 2024
bdc31ca
types: move unresolved types to sui-transaction-builder
bmwill Dec 19, 2024
da97d3c
types: fold EffectsObjectChange into ChangedObject struct
bmwill Dec 19, 2024
638a85a
sui-sdk-types: flatten the types module
bmwill Dec 19, 2024
ca68846
chore: update proptest to 1.6.0 (#85)
bmwill Dec 23, 2024
6cff065
sui-transaction-builder: enable base64ct feature 'std'
bmwill Dec 23, 2024
ed0f4ef
chore: add help target to Makefile to display the usage of all target…
caseylove Dec 31, 2024
640a408
release sui-sdk-types-0.0.2 and sui-crypto-0.0.2
bmwill Jan 6, 2025
95918e9
chore: Apply renames and clean upstream changes
DaughterOfMars Feb 24, 2025
f3f0adc
chore: Fix build issues
DaughterOfMars May 26, 2025
8507c95
chore: Rename branches and URLs
DaughterOfMars May 26, 2025
8231368
chore: Update CI rust version
DaughterOfMars May 26, 2025
9a64813
chore: Fix errors and add fixtures
DaughterOfMars Jun 3, 2025
b73bfbc
chore: Fix typos
DaughterOfMars Jun 3, 2025
94f7402
chore: Add missing license header
DaughterOfMars Jun 3, 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
63 changes: 59 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
schedule: [cron: "40 1 * * *"]

Expand Down Expand Up @@ -43,18 +44,18 @@ jobs:
- name: Install latest nightly
run: rustup toolchain install nightly --component rustfmt --allow-downgrade

- name: feature compatibility
run: make check-features

- name: rustfmt
run: cargo +nightly fmt -- --check
run: make check-fmt

- name: clippy
run: make clippy

- name: rustdoc
run: make doc

- name: feature compatibility
run: make check-features

wasm:
runs-on: ubuntu-latest

Expand All @@ -64,6 +65,7 @@ jobs:

- name: rust version
run: |
rustup default 1.82.0
rustc --version
cargo --version

Expand All @@ -74,3 +76,56 @@ jobs:

- name: Run tests in wasm
run: make wasm

run_tests_with_network:
runs-on: ubuntu-latest
env:
EPOCH_DURATION_MS: 10000
services:
postgres: # we need this postgres instance for running a local network with indexer and graphql
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
POSTGRES_DB: iota_indexer_v2
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: rust version
run: |
rustc --version
cargo --version

- uses: taiki-e/install-action@cargo-nextest

- name: Get the IOTA testnet binary and start a local network
shell: bash
env:
IOTA_BINARY_VERSION: "v0.12.0-rc" # used for downloading a specific IOTA binary version that matches the GraphQL schema for local network tests
run: |
ASSET_NAME="iota-$IOTA_BINARY_VERSION-linux-x86_64.tgz"
download_url="https://github.com/iotaledger/iota/releases/download/$IOTA_BINARY_VERSION/$ASSET_NAME"

echo "Downloading testnet binary from $download_url"
wget -q $download_url -O iota.tgz
tar -zxvf iota.tgz ./iota
chmod +x ./iota
echo "Starting local network with a faucet, an indexer (port 5432) and GraphQL. Epoch duration is set to $EPOCH_DURATION_MS ms"
echo "$(pwd)" >> $GITHUB_PATH # we need it on the path for calling iota move build for some tests
./iota start --force-regenesis --with-faucet --with-indexer --with-graphql --pg-port 5432 --pg-db-name iota_indexer_v2 --epoch-duration-ms $EPOCH_DURATION_MS &

- name: Run tests that require local network (GraphQL Client and Tx Builder)
env:
NETWORK: "local" # other expected options are mainnet, testnet, or devnet, or an actual URL to a GraphQL server: http://localhost:port
run: |
sleep $((EPOCH_DURATION_MS / 1000)) # wait for the network to get to epoch #2
make test-with-localnet
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: rustdoc

on:
push:
branches: [main]
branches: [develop]
workflow_dispatch:

env:
Expand Down
52 changes: 35 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,64 @@
# Set the default target of this Makefile
.PHONY: all
all:: ci
all:: ci ## Default target, runs the CI process

.PHONY: check-features
check-features:
$(MAKE) -C crates/iota-rust-sdk check-features
check-features: ## Check feature flags for crates
$(MAKE) -C crates/iota-sdk-types check-features
$(MAKE) -C crates/iota-crypto check-features

.PHONY: check-fmt
check-fmt:
cargo fmt -- --check
check-fmt: ## Check code formatting
cargo +nightly fmt -- --check

.PHONY: fmt
fmt: ## Format code
cargo +nightly fmt

.PHONY: clippy
clippy:
clippy: ## Run Clippy linter
cargo clippy --all-features --all-targets

.PHONY: test
test:
cargo nextest run --all-features
test: ## Run unit tests
cargo nextest run --all-features -p iota-sdk-types -p iota-crypto
cargo test --doc

package_%.json: crates/iota-transaction-builder/tests/%/Move.toml crates/iota-transaction-builder/tests/%/sources/*.move ## Generate JSON files for tests
cd crates/iota-transaction-builder/tests/$(*F) && iota move build --ignore-chain --dump-bytecode-as-base64 > ../../$@

.PHONY: test-with-localnet
test-with-localnet: package_test_example_v1.json package_test_example_v2.json ## Run tests with localnet
cargo nextest run -p iota-graphql-client -p iota-transaction-builder

.PHONY: wasm
wasm:
$(MAKE) -C crates/iota-rust-sdk wasm
wasm: ## Build WASM modules
$(MAKE) -C crates/iota-sdk-types wasm
$(MAKE) -C crates/iota-crypto wasm

.PHONY: doc
doc:
doc: ## Generate documentation
RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps

.PHONY: doc-open
doc-open:
doc-open: ## Generate and open documentation
RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps --open

.PHONY: ci
ci: check-features check-fmt test wasm
ci: check-features check-fmt test wasm ## Run the full CI process

.PHONY: ci-full
ci-full: ci doc
ci-full: ci doc ## Run the full CI process and generate documentation

.PHONY: clean
clean:
clean: ## Clean build artifacts
cargo clean

.PHONY: clean-all
clean-all: clean
git clean -dX
clean-all: clean ## Clean all generated files, including those ignored by Git. Force removal.
git clean -dXf

.PHONY: help
help: ## Show this help
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# IOTA Sdk

[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_sdk/)
A Rust SDK for integrating with the [IOTA blockchain](https://docs.iota.org/).

A WIP from-scratch rust sdk for the IOTA blockchain
> [!NOTE]
> This is project is under development and many features may still be under
> development or missing.

## Overview

This repository contains a collection of libraries for integrating with the IOTA blockchain.

A few of the project's high-level goals are as follows:

- **Be modular** - user's should only need to pay the cost (in terms of dependencies/compilation time) for the features that they use.
- **Be light** - strive to have a minimal dependency footprint.
- **Support developers** - provide all needed types, abstractions and APIs to enable developers to build robust applications on IOTA.
- **Support wasm** - where possible, libraries should be usable in wasm environments.

## Crates

In an effort to be modular, functionality is split between a number of crates.

- [`iota-sdk-types`](crates/iota-sdk-types)
[![iota-sdk-types on crates.io](https://img.shields.io/crates/v/iota-sdk-types)](https://crates.io/crates/iota-sdk-types)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-types)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_sdk_types/)
- [`iota-crypto`](crates/iota-crypto)
[![iota-crypto on crates.io](https://img.shields.io/crates/v/iota-crypto)](https://crates.io/crates/iota-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-crypto)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_crypto/)
- [`iota-graphql-client`](crates/iota-crypto)
[![iota-graphql-client on crates.io](https://img.shields.io/crates/v/iota-graphql-client)](https://crates.io/crates/iota-graphql-client)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-graphql-client)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota-graphql-client/)

## License

This project is available under the terms of the [Apache 2.0 license](LICENSE).
106 changes: 106 additions & 0 deletions crates/iota-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[package]
name = "iota-crypto"
version = "0.0.0"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
description = "Defines the interface for signing and verifying messages in the IOTA ecosystem"

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps --open
all-features = true
rustdoc-args = [
# Enable doc_cfg showing the required features.
"--cfg=doc_cfg",

# Generate links to definition in rustdoc source code pages
# https://github.com/rust-lang/rust/pull/84176
"-Zunstable-options",
"--generate-link-to-definition",
]

[features]
default = []
ed25519 = ["dep:ed25519-dalek", "dep:rand_core"]
secp256r1 = ["dep:p256", "dep:rand_core"]
passkey = ["secp256r1", "dep:sha2"]
secp256k1 = ["dep:k256", "dep:rand_core", "signature/std"]
zklogin = [
"dep:ark-bn254",
"dep:ark-ff",
"dep:ark-groth16",
"dep:ark-snark",
"dep:ark-std",
"dep:base64ct",
"dep:bnum",
"dep:itertools",
"dep:serde",
"dep:serde_derive",
"dep:serde_json",
"signature/std",
]
pem = [
"dep:pkcs8",
"dep:pem-rfc7468",
"ed25519-dalek?/pkcs8",
"p256?/pkcs8",
"k256?/pkcs8",
"ed25519-dalek?/pem",
"p256?/pem",
"k256?/pem",
]

[dependencies]
iota-sdk-types = { version = "0.0.0", path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
signature = "2.2"

# RNG support
rand_core = { version = "0.6.4", optional = true }

# ed25519 support
ed25519-dalek = { version = "2.1.1", optional = true }

# secp256r1 support
p256 = { version = "0.13.2", default-features = false, features = ["ecdsa", "std"], optional = true }

# passkey verification support
sha2 = { version = "0.10.8", optional = true }

# secp256k1 support
k256 = { version = "0.13.4", default-features = false, features = ["ecdsa"], optional = true }

# zklogin verification support
ark-bn254 = { version = "0.4.0", optional = true }
ark-ff = { version = "0.4.2", features = ["asm"], optional = true }
ark-groth16 = { version = "0.4.0", default-features = false, optional = true }
ark-snark = { version = "0.4.0", optional = true }
ark-std = { version = "0.4.0", optional = true }
base64ct = { version = "1.6.0", features = ["alloc"], optional = true }
bnum = { version = "0.12.0", optional = true }
itertools = { version = "0.13.0", optional = true }
serde = { version = "1.0.210", optional = true }
serde_derive = { version = "1.0.210", optional = true }
serde_json = { version = "1.0.128", optional = true }

# pkcs8 der and pem support
pem-rfc7468 = { version = "0.7", optional = true, features = ["std"] }
pkcs8 = { version = "0.10", optional = true, features = ["std"] }

[dev-dependencies]
bcs = { version = "0.1.6" }
hex = "0.4.3"
serde_json = { version = "1.0.128" }

# proptest support in tests
proptest = { version = "1.6.0", default-features = false, features = ["std"] }
test-strategy = "0.4.0"

[target.wasm32-unknown-unknown.dev-dependencies]
wasm-bindgen-test = "0.3"
getrandom = { version = "0.2", features = ["js"] }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }
23 changes: 23 additions & 0 deletions crates/iota-crypto/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set the default target of this Makefile
.PHONY: all
all:: check-features clippy test wasm

.PHONY: check-features
check-features:
cargo hack check --feature-powerset --no-dev-deps

.PHONY: clippy
clippy:
cargo clippy --all-features --all-targets

.PHONY: test
test:
cargo nextest run --all-features
cargo test --doc

.PHONY: wasm
wasm:
CC=clang wasm-pack test -r --node --all-features

%:
$(MAKE) -C ../.. $@
8 changes: 8 additions & 0 deletions crates/iota-crypto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# iota-crypto

[![iota-crypto on crates.io](https://img.shields.io/crates/v/iota-crypto)](https://crates.io/crates/iota-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-crypto)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_crypto/)

The `iota-crypto` crate provides the interface for signing and verifying
transactions and messages in the IOTA ecosystem.
11 changes: 11 additions & 0 deletions crates/iota-crypto/src/bls12381.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Mysten Labs, Inc.
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct Bls12381PrivateKey([u8; Self::LENGTH]);

impl Bls12381PrivateKey {
/// The length of an bls12381 private key in bytes.
pub const LENGTH: usize = 32;
}
Loading
Loading