Skip to content

Confidential assets v1.1: New decryption algorithms & contract changes#822

Draft
alinush wants to merge 21 commits intomainfrom
alin/confidential-assets-v1.1
Draft

Confidential assets v1.1: New decryption algorithms & contract changes#822
alinush wants to merge 21 commits intomainfrom
alin/confidential-assets-v1.1

Conversation

@alinush
Copy link
Contributor

@alinush alinush commented Feb 3, 2026

Description

  • Implemented BSGS in TypeScript; too slow (> 1s to decrypt a single 32-bit value)
  • Replaced [BL12] discrete log algorithm with a new TBSGS-k32 algorithm; see this PR

Test Plan

  • Re-use unit tests
  • Re-run e2e tests manually

Related Links

See alinush.org/confidential-assets for resources.

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

@alinush alinush force-pushed the alin/confidential-assets-v1.1 branch from 40e31af to a92b819 Compare February 10, 2026 00:40
@alinush alinush force-pushed the alin/confidential-assets-v1.1 branch 4 times, most recently from c1e6bb0 to 90ef6bb Compare March 2, 2026 18:01
alinush added 12 commits March 2, 2026 12:02
…work

Key rotation — migrate to generic sigma protocol framework:
The old ConfidentialKeyRotation had a bespoke Fiat-Shamir construction that did not
match the Move verifier in sigma_protocol_key_rotation.move, and proved the wrong
statement (re-encrypting the full balance under the new key, requiring a range proof).
The new implementation uses sigmaProtocol.ts (sigmaProtocolProve/Verify) whose
Fiat-Shamir matches the Move verifier byte-for-byte via BCS.
create() and authorizeKeyRotation() are now synchronous.

Rename ConfidentialKeyRotationResult -> KeyRotationProof: the flat sigmaProtoComm /
sigmaProtoResp fields are now a nested proof: SigmaProtocolProof sub-field.

Eliminate duplicate view-function implementations in ConfidentialAsset:
getAssetAuditorEncryptionKey and hasUserRegistered were re-implementing logic already
in ConfidentialAssetTransactionBuilder and viewFunctions.ts, with stale Move function
names (get_auditor, has_confidential_asset_store). Both now delegate to the canonical
implementations.

rotateEncryptionKey: fix missing freeze when pending balance is already zero. The
on-chain entry function requires incoming transfers to be paused; the condition is now
pendingBalance() > 0 || !isFrozen.

Misc: remove SIGMA_PROOF_KEY_ROTATION_SIZE, unused numberToBytesLE and MODULE_NAME imports.
@alinush alinush force-pushed the alin/confidential-assets-v1.1 branch from 90ef6bb to cca4eaa Compare March 2, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant