Skip to content

Add CIP-179 v5 linked survey linking and voting#4184

Open
Cerkoryn wants to merge 1 commit into
IntersectMBO:developfrom
Cerkoryn:feat/cip-179-surveys
Open

Add CIP-179 v5 linked survey linking and voting#4184
Cerkoryn wants to merge 1 commit into
IntersectMBO:developfrom
Cerkoryn:feat/cip-179-surveys

Conversation

@Cerkoryn

Copy link
Copy Markdown

Summary

Supersedes #4152 with an implementation based on the stabilized CIP-179 v5 specification and the published cip-179 package from @mpizenberg's Tessara.

This PR focuses on linking, rendering, and submitting survey responses. Tally calculation and results display from the previous proposal are left out of scope for simplicity.

List of changes

  • Add an immutable backend endpoint that returns exact metadata-label-17 CBOR by transaction hash and survey index
  • Add a feature-flagged transaction-hash field when creating a governance action
  • Validate linked definitions, survey indices, governance-action expiry, and UI renderability before authoring
  • Add the CIP-179 link to CIP-108 JSON-LD without changing metadata hashes for actions that do not use surveys
  • Render public and sealed surveys within the governance-action voting form
  • Support single-choice, multi-select, ranking, numeric-range, points-allocation, rating, and registered custom methods
  • Verify and optionally apply hash-anchored external presentation content
  • Encode response metadata with the existing Cardano serialization library and attach it to the governance vote transaction
  • Seal eligible responses using the published tlock integration
  • Add limits and defensive handling for malformed, oversized, unavailable, or unsupported surveys
  • Keep the feature disabled by default through VITE_IS_CIP179_ENABLED

Verification

  • Frontend TypeScript and lint pass
  • Production frontend build passes
  • 216 frontend tests pass, including native metadatum CBOR, link authoring, envelope validation, and rendering limits
  • Desktop and mobile Storybook scenarios were visually inspected with no page errors, MUI warnings, or overflow
  • Haskell changes were statically reviewed but not compiled locally because the Haskell toolchain is unavailable

Checklist

  • My changes generate no new warnings
  • My code follows the project style guidelines
  • I have commented code where additional context is useful
  • I have made corresponding changelog changes
  • I have added tests that prove the feature works

I was unfortunately unable to build all of the necessary dependencies to validate all of the changes. But I was able to build the storyboard and visually inspect some example surveys that were attached to governance actions. If this PR passes validation and we can get it merged into https://govtool-preview.cardanoapi.io/ at least, then I would be happy to do some conformance testing of my own with real surveys that are live on Preview and compare them against other tools' CIP-179 implementations.

This PR was constructed with heavy assistance from GPT-5.6 Sol High and I did my best to validate what I could locally. My apologies for not being able to test the entire end-to-end flow however 🙏

@Cerkoryn

Copy link
Copy Markdown
Author

Tagging @spannercode @mesudip and @bosko-m for review if possible 🙏

@Cerkoryn Cerkoryn mentioned this pull request Jul 12, 2026
5 tasks
@mesudip mesudip self-requested a review July 13, 2026 15:01
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