[package]
name = "dusk-core"
version = "1.6.0"

description = "Types used for interacting with Dusk's transfer and stake contracts."
repository = "https://github.com/dusk-network/rusk"

license.workspace = true
rust-version.workspace = true
edition.workspace = true

[dependencies]
dusk-bls12_381 = { workspace = true, features = ["rkyv-impl"] }
dusk-jubjub = { workspace = true, features = ["rkyv-impl"] }
dusk-poseidon = { workspace = true }
bls12_381-bls = { workspace = true, features = ["rkyv-impl", "insecure-v1-signing"] }
jubjub-schnorr = { workspace = true, features = ["rkyv-impl"] }
phoenix-core = { workspace = true, features = ["rkyv-impl", "alloc"] }
phoenix-circuits = { workspace = true }
poseidon-merkle = { workspace = true, features = ["rkyv-impl"] }
piecrust-uplink = { workspace = true }
dusk-bytes = { workspace = true }
rkyv = { workspace = true, features = ["size_32"] }
bytecheck = { workspace = true }
rand = { workspace = true }
ff = { workspace = true }
sha2 = { workspace = true }
c-kzg = { workspace = true, optional = true }

blake2b_simd = { workspace = true, default-features = false } # 1.0.4 requires rustc edition 2024

# plonk dependencies
dusk-plonk = { workspace = true, features = [
    "rkyv-impl",
    "alloc",
], optional = true }

# groth dependencies
ark-groth16 = { workspace = true, optional = true }
ark-bn254 = { workspace = true, features = ["curve"], optional = true }
ark-relations = { workspace = true, optional = true }
ark-serialize = { workspace = true, optional = true }

# serde support dependencies
serde = { workspace = true, features = ["derive"], optional = true }
serde_with = { workspace = true, features = ["hex"], optional = true }

[dev-dependencies]
rand = { workspace = true, features = ["std", "std_rng"] }
serde_json = { workspace = true }

[features]
parallel = [
    # It enables parallel thread aggregation of BlsPublicKey
    "bls12_381-bls/parallel",
]

# These are the features available for when one wishes to build contracts and
# interact with the ABI
abi = ["piecrust-uplink/abi"]
abi-debug = ["abi", "piecrust-uplink/debug"]
abi-dlmalloc = ["abi", "piecrust-uplink/dlmalloc"]

# Enables all zero-knowledge proof system libraries supported
zk = ["plonk", "groth16"]

# Enables kzg support
kzg = ["c-kzg"]

plonk = ["dusk-plonk", "phoenix-circuits/plonk"]

groth16 = ["ark-groth16", "ark-bn254", "ark-relations", "ark-serialize"]

# Enables std feature for dusk-plonk
std = ["dusk-plonk/std"]

serde = [
    "dep:serde",
    "dep:serde_with",
    "piecrust-uplink/serde",
    "bls12_381-bls/serde",
    "phoenix-core/serde",
    "jubjub-schnorr/serde",
]
