Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build/
node_modules/
*.class
*.jar
!gradle-wrapper.jar
*.log
.idea/
*.iml
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GroupId: `com.bloxbean.cardano`
| Build | Gradle | 9.2+ |
| Frontend | Svelte 5 + Vite | Latest |
| Frontend packaging | Build to `src/main/resources/static/`, served by Spring Boot |
| ZK Proofs | zeroj (`org.zeroj`, Maven Central) | 0.1.0-pre12 |
| ZK Proofs | zeroj (`org.zeroj`, Maven Central) | 0.1.0-pre13 |
| On-chain scripts | Julc (`org.julclang`) | 0.1.0-pre18 |
| Cardano client | cardano-client-lib | 0.8.0-pre5 |
| Cardano networks | Yaci DevKit (local) + Preprod (testnet) |
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ zeroj-usecases/
digital-product-passport/ Spring Boot E2E, CircuitSpec reference
selective-disclosure/ Spring Boot E2E
reusable-kyc/ Spring Boot E2E, BBS selective disclosure
pedersen-commitments/ Spring Boot E2E, three Pedersen commitment demos

examples/
minimal-circuits/
Expand All @@ -82,11 +83,12 @@ zeroj-usecases/
| [proof-of-reserves](proof-of-reserves/README.md) | Reserves cover liabilities without exposing balances | 8089 | Symbolic annotations |
| [identity-kyc](identity-kyc/README.md) | Age and country eligibility without revealing personal data | 8087 | Symbolic annotations |
| [nft-ownership](nft-ownership/README.md) | NFT ownership without revealing wallet or token | 8085 | Symbolic annotations |
| [private-voting](private-voting/README.md) | Eligible voter, one private vote, no double-vote | 8086 | Symbolic annotations |
| [private-voting](private-voting/README.md) | Eligible voter, one encrypted vote, no double-vote; only the total is ever decrypted | 8086 | Symbolic annotations |
| [personhood-airdrop](personhood-airdrop/SYBIL_AIRDROP_TUTORIAL.md) | One claim per person per epoch | 8083 | Symbolic annotations |
| [digital-product-passport](digital-product-passport/README.md) | Product compliance without exposing supply-chain data | 8088 | `CircuitSpec` |
| [selective-disclosure](selective-disclosure/SELECTIVE_DISCLOSURE_TUTORIAL.md) | Multiple predicates from one signed credential | 8091 | Symbolic annotations |
| [reusable-kyc](reusable-kyc/README.md) | KYC once, reveal only the attributes each service needs — **BBS proof verified natively on-chain** | 8092 | BBS (no circuit) |
| [pedersen-commitments](pedersen-commitments/README.md) | Confidential points that still add up; one committed credential, prove only a predicate; solvency with hidden liabilities | 8093 | Symbolic annotations |

Some apps have native Spring ports that overlap, such as 8085. The Docker demo
maps them to distinct host ports so multiple profiles can exist without port
Expand All @@ -100,10 +102,10 @@ For the Docker demo path:
- Docker with Compose v2
- Yaci DevKit running on the host

Docker demos use the released ZeroJ version configured by `ZEROJ_VERSION`
(`0.1.0-pre12` by default). A sibling ZeroJ checkout is optional and only needed
when you explicitly opt into publishing a local ZeroJ build during Docker image
builds.
Docker demos build against the ZeroJ version in `version.properties` (`zerojVersion`), the
same one the Gradle builds use; set `ZEROJ_VERSION` to override it. A sibling ZeroJ checkout is
optional and only needed when you explicitly opt into publishing a local ZeroJ build during
Docker image builds.

For direct Java runs:

Expand Down
2 changes: 1 addition & 1 deletion account-ownership/cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repositories {
maven { url = uri("https://repo.spring.io/milestone") }
}

def zerojVersion = ver('zerojVersion', '0.1.0-pre12')
def zerojVersion = ver('zerojVersion', '0.1.0-pre13')
def julcVersion = ver('julcVersion', '0.1.0-pre18')
def cclVersion = ver('cclVersion', '0.8.0-pre5')

Expand Down
1 change: 1 addition & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ projects=(
nft-ownership
personhood-airdrop
private-voting
pedersen-commitments
proof-of-reserves
selective-disclosure
examples/minimal-circuits/batch-threshold-matrix
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def usecaseProjects = [
'nft-ownership',
'personhood-airdrop',
'private-voting',
'pedersen-commitments',
'proof-of-reserves',
'selective-disclosure',
'examples/minimal-circuits/batch-threshold-matrix',
Expand Down
36 changes: 27 additions & 9 deletions compose.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ x-spring-build: &spring-build
zeroj-src: ${ZEROJ_SOURCE_CONTEXT:-docker/empty-zeroj-context}
dockerfile: docker/spring-usecase.Dockerfile
args:
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}

services:
Expand All @@ -37,7 +37,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: proof-of-reserves
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -54,7 +54,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: identity-kyc
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -71,7 +71,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: nft-ownership
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -88,7 +88,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: private-voting
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -105,7 +105,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: personhood-airdrop
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -122,7 +122,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: digital-product-passport
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -140,7 +140,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: selective-disclosure
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -157,7 +157,7 @@ services:
<<: *spring-build
args:
USECASE_DIR: reusable-kyc
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
Expand All @@ -167,6 +167,23 @@ services:
volumes:
- reusable-kyc-data:/app/data

pedersen-commitments:
profiles: ["pedersen-commitments", "spring"]
<<: *host-provider
build:
<<: *spring-build
args:
USECASE_DIR: pedersen-commitments
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *spring-env
SERVER_PORT: 8080
ports:
- "${PEDERSEN_COMMITMENTS_PORT:-8093}:8080"
volumes:
- pedersen-commitments-data:/app/data

volumes:
proof-of-reserves-data:
identity-kyc-data:
Expand All @@ -176,3 +193,4 @@ volumes:
dpp-data:
selective-disclosure-data:
reusable-kyc-data:
pedersen-commitments-data:
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
args:
USECASE_DIR: examples/minimal-circuits/plonk/proof-of-reserves
APP_NAME: proof-of-reserves-plonk
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *yaci-env
Expand All @@ -44,7 +44,7 @@ services:
args:
USECASE_DIR: examples/minimal-circuits/plonk/compliance-credential
APP_NAME: compliance-credential-plonk
ZEROJ_VERSION: ${ZEROJ_VERSION:-0.1.0-pre12}
ZEROJ_VERSION: ${ZEROJ_VERSION:-}
PUBLISH_LOCAL_ZEROJ: ${PUBLISH_LOCAL_ZEROJ:-false}
environment:
<<: *yaci-env
Expand Down
7 changes: 7 additions & 0 deletions demo-cache/pedersen-commitments/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"usecase": "pedersen-commitments",
"devOnly": true,
"trustedSetup": "single-party development setup",
"artifacts": [],
"note": "No setup files are committed for this demo. The four circuits (points-transfer, points-redeem, credit-profile-check, hidden-liability-solvency-n4) are set up on first start and cached in /app/data, keyed by an R1CS digest."
}
21 changes: 21 additions & 0 deletions demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Usecases (canonical name, optional aliases, and default UI port):
digital-product-passport (dpp) 8088
selective-disclosure (selective) 8091
reusable-kyc (kyc) 8092
pedersen-commitments (pedersen) 8093

Options:
--run Run the happy-path curl flow after the UI is healthy.
Expand Down Expand Up @@ -130,6 +131,13 @@ case "${USECASE}" in
PORT="${REUSABLE_KYC_PORT:-8092}"
HEALTH="/api/kyc/status"
;;
pedersen|pedersen-commitments)
PROFILE="pedersen-commitments"
SERVICE="pedersen-commitments"
VOLUME="pedersen-commitments-data"
PORT="${PEDERSEN_COMMITMENTS_PORT:-8093}"
HEALTH="/api/status"
;;
*)
echo "Unknown usecase: ${USECASE}" >&2
usage
Expand Down Expand Up @@ -298,6 +306,19 @@ run_flow() {
# no nonce here: the on-chain header is derived from the voucher UTxO + recipient
post_json "/api/kyc/claim" "{\"recipientAddress\":\"${recipient}\"}"
;;
pedersen-commitments)
# /api/status answers while the demos warm up; wait until all three are ready.
for _ in $(seq 1 120); do
curl -fsS "${BASE_URL}/api/status" | grep -q '"ready":true' && break
sleep 3
done
post_json "/api/points/issue" '{"to":"alice","amount":1000}'
post_json "/api/points/transfer" '{"from":"alice","to":"bob","amount":700}'
post_json "/api/points/redeem" '{"from":"bob","price":120}'
post_json "/api/credit/issue" '{"income":85000,"creditScore":720,"birthYear":1990,"country":356}'
post_json "/api/credit/claim" '{"who":"alice","minIncome":50000,"minScore":650}'
post_json "/api/solvency/attest" '{"reservesAda":2000}'
;;
esac
}

Expand Down
Binary file not shown.
6 changes: 4 additions & 2 deletions docker/cli-usecase.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM eclipse-temurin:25-jdk AS build

ARG USECASE_DIR
ARG APP_NAME
ARG ZEROJ_VERSION=0.1.0-pre12
# Empty = use zerojVersion from version.properties (copied below); set to override.
ARG ZEROJ_VERSION=
ARG PUBLISH_LOCAL_ZEROJ=false
ARG ZEROJ_PUBLISH_TASKS=":zeroj-api:publishToMavenLocal :zeroj-backend-spi:publishToMavenLocal :zeroj-codec:publishToMavenLocal :zeroj-bls12381:publishToMavenLocal :zeroj-blst:publishToMavenLocal :zeroj-crypto:publishToMavenLocal :zeroj-circuit-dsl:publishToMavenLocal :zeroj-circuit-annotation-api:publishToMavenLocal :zeroj-circuit-lib:publishToMavenLocal :zeroj-circuit-annotation-processor:publishToMavenLocal :zeroj-verifier-groth16:publishToMavenLocal :zeroj-verifier-plonk:publishToMavenLocal :zeroj-onchain-julc:publishToMavenLocal"

Expand All @@ -15,11 +16,12 @@ RUN if [ "${PUBLISH_LOCAL_ZEROJ}" = "true" ]; then \
fi

WORKDIR /workspace/usecase
COPY version.properties /workspace/version.properties
COPY gradle/usecase-versions.gradle /workspace/gradle/usecase-versions.gradle
COPY ${USECASE_DIR}/ ./

RUN chmod +x ./gradlew \
&& ./gradlew --no-daemon installDist -x test -PzerojVersion=${ZEROJ_VERSION}
&& ./gradlew --no-daemon installDist -x test ${ZEROJ_VERSION:+-PzerojVersion=${ZEROJ_VERSION}}

FROM eclipse-temurin:25-jre

Expand Down
6 changes: 4 additions & 2 deletions docker/spring-usecase.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM eclipse-temurin:25-jdk AS build

ARG USECASE_DIR
ARG ZEROJ_VERSION=0.1.0-pre12
# Empty = use zerojVersion from version.properties (copied below); set to override.
ARG ZEROJ_VERSION=
ARG PUBLISH_LOCAL_ZEROJ=false
ARG ZEROJ_PUBLISH_TASKS=":zeroj-api:publishToMavenLocal :zeroj-backend-spi:publishToMavenLocal :zeroj-codec:publishToMavenLocal :zeroj-bls12381:publishToMavenLocal :zeroj-blst:publishToMavenLocal :zeroj-crypto:publishToMavenLocal :zeroj-circuit-dsl:publishToMavenLocal :zeroj-circuit-annotation-api:publishToMavenLocal :zeroj-circuit-annotation-processor:publishToMavenLocal :zeroj-circuit-lib:publishToMavenLocal :zeroj-verifier-groth16:publishToMavenLocal :zeroj-onchain-julc:publishToMavenLocal"

Expand All @@ -14,11 +15,12 @@ RUN if [ "${PUBLISH_LOCAL_ZEROJ}" = "true" ]; then \
fi

WORKDIR /workspace/usecase
COPY version.properties /workspace/version.properties
COPY gradle/usecase-versions.gradle /workspace/gradle/usecase-versions.gradle
COPY ${USECASE_DIR}/ ./

RUN chmod +x ./gradlew \
&& ./gradlew --no-daemon bootJar -x test -PzerojVersion=${ZEROJ_VERSION} \
&& ./gradlew --no-daemon bootJar -x test ${ZEROJ_VERSION:+-PzerojVersion=${ZEROJ_VERSION}} \
&& jar_file="$(find build/libs -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)" \
&& test -n "${jar_file}" \
&& cp "${jar_file}" /workspace/app.jar
Expand Down
Loading