Skip to main content

Quickstart

Prerequisites​

  • Node.js 18+ (web SDK)
  • Go 1.25+ (runtime / ABCI node)
  • No Docker required for local single-node dev — see below.

1. Start a local node​

shyvoting-abci --addr tcp://0.0.0.0:26658 --db-path /tmp/shyware-dev --identity-mode wallet &
cometbft init --home ~/.shyware-dev
cometbft start --home ~/.shyware-dev --proxy_app tcp://127.0.0.1:26658
shyvoting-api --cometbft-rpc http://127.0.0.1:26657 --port 8080

--identity-mode wallet needs no external IDV service — the identity commitment is an EVM address, so there's nothing to stand up for local dev. The other three modes (didit, zk, identus) each require a real verifier public key at startup (--didit-pubkey, --zk-vk-path, --identus-issuer-pubkey) and will refuse to start without one.

This is a native single-node CometBFT setup — no Docker daemon or container images needed. For a non-voting deployment (no Didit/IDV fields), the domain-agnostic embodiment ships the same shape as two binaries instead:

shygeneric-abci --addr tcp://0.0.0.0:26658 --db-path /tmp/shygeneric-dev &
cometbft init --home ~/.shygeneric-dev
cometbft start --home ~/.shygeneric-dev --proxy_app tcp://127.0.0.1:26658
shygeneric-api --cometbft-rpc http://127.0.0.1:26657 --port 8080

shygeneric-api exposes POST /submissions, GET /submissions/{id}/count, and the other two-list operations directly — see Interfaces for the CometBFTLedgerInterface client that talks to it.

For a local multi-validator BFT testnet (four independent processes forming real consensus), use ShywareLLC/core/deploy/scripts/testnet-init-native.sh + testnet-start-native.sh — no Docker required there either. A Docker Compose variant of the same testnet exists as a secondary option when you specifically want container-level isolation between validators; see ShywareLLC/core/deploy/scripts/README.md.


2. Initialize a client​

import { initializeFromShyConfig } from '@shyware/sdk/clients/voting'

const shyconfig = await fetch('/shyconfig.json').then(r => r.json())
const client = initializeFromShyConfig(shyconfig)

const summary = client.initialize()
// → { contractVersion: "shyvoting-v1", appId: "my-deployment", posture: "recoverable", ... }

3. Read submissions​

const polls = await client.getAllSubmissions()
const poll = await client.getSubmission('polls', scopingId)
const tally = await client.getSubmissionTally('polls', scopingId)
const records = await client.getSubmissionRecords('polls', scopingId)

4. Cast a submission​

const { submissionId, submissionNonce, beaconBlockHash } = await client.voteSubmission({
scopingId: 'proposal-42',
payload: 'yes',
device, // this device's enrolled credential (Didit mode); omit for `wallet` mode
keypair // the per-poll device keypair (see Architecture — identity tiers)
})
// submissionId — direction-free; publicly visible on-chain
// submissionNonce + beaconBlockHash — retain together only in recoverable posture

The client (or, in the attested identity modes, the IDV attestation response) supplies identity_hash, generates submissionNonce, builds TxTypeBallotCast, POSTs to {api.base_url}/ballots. In recoverable posture, save the returned nonce, original beacon, and choice to your configured private store. In write-only posture, clear submission material without logging or mirroring it.


5. Verify the tally​

const tally = await client.getSubmissionTally('polls', 'proposal-42')
// → { counts, totalVotes, confirmedCount, merkleRoot1, merkleRoot2, publicKey, signature }

Independently verify the tally — works whether or not a KMS/HSM signing key is configured for this deployment (the count-match check runs either way; the signature check only runs if signature/public_key are present):

cd ShywareLLC/core && go run ./embodiments/shyvoting/cmd/shyvoting-verify --api http://localhost:8080 --poll proposal-42
# → Count-match passes independently; signature VALID only when a signer is configured

6. Verify your own receipt​

const records = await client.getSubmissionRecords('polls', 'proposal-42')
const verified = await client.verifyReceipt(submissionNonce, 'yes', records, { beaconBlockHash })
// → boolean — hashes decoded beacon bytes || nonce bytes locally, no server contact

Other embodiments​

// Weighted governance (shyshares)
import { initializeFromShyConfig } from '@shyware/sdk/clients/shares'
const client = initializeFromShyConfig(shyconfig)
await client.submitWeightedBallot({ proposal_id: proposalId, account_commitment: accountCommitment, direction: 'yes' })

// Value transfer (shywire)
import { initializeFromShyConfig } from '@shyware/sdk/clients/wire'
const client = initializeFromShyConfig(shyconfig)
await client.wireSubmission({ scopingId: assetId, amount: 100, senderCommitment, recipientCommitment })

// Secret storage (shystore)
import { initializeFromShyConfig } from '@shyware/sdk/clients/store'
const client = initializeFromShyConfig(shyconfig, { getAuthHeaders, deriveSealerKey, signMessage })
await client.storeSubmission({ scopingId: bucketId, plaintext, category })

// Commodity custody (shycustody)
import { initializeFromShyConfig } from '@shyware/sdk/clients/custody'
const client = initializeFromShyConfig(shyconfig)
await client.buildRequestRedemption({ assetId, accountCommitment, warehouseId, skuClassId, siloAmount, requestedQuantity })

// Revenue financing (shycontracts)
import { initializeFromShyConfig } from '@shyware/sdk/clients/contracts'
const client = initializeFromShyConfig(shyconfig)
await client.buildContractExecution({ contractId, assetId, partyCommitment, counterpartyCommitment, executionType: "remittance", sourceRef: "inv-001", amount: 12500 })

Next steps​