1"use strict";(globalThis.webpackChunkconvex_docs=globalThis.webpackChunkconvex_docs||[]).push([[964],{3565:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>c,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"cad/curated_registry/index","title":"CAD034: Curated Registry","description":"Overview","source":"@site/docs/cad/034_curated_registry/index.md","sourceDirName":"cad/034_curated_registry","slug":"/cad/curated_registry/","permalink":"/docs/cad/curated_registry/","draft":false,"unlisted":false,"editUrl":"https://github.com/Convex-Dev/design/tree/develop/docs/cad/034_curated_registry/index.md","tags":[],"version":"current","frontMatter":{},"sidebar":"cadsSidebar","previous":{"title":"CAD033: Convex CVM Types","permalink":"/docs/cad/cvmtypes/"},"next":{"title":"CAD035: Lattice Cursors","permalink":"/docs/cad/cursors/"}}');var s=t(6070),n=t(7028);const a={},c="CAD034: Curated Registry",l={},o=[{value:"Overview",id:"overview",level:2},{value:"Key functions",id:"key-functions",level:2},{value:"Create Registry",id:"create-registry",level:3},{value:"Delete Registry",id:"delete-registry",level:3},{value:"Register",id:"register",level:3}];function d(e){const r={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,n.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.header,{children:(0,s.jsx)(r.h1,{id:"cad034-curated-registry",children:"CAD034: Curated Registry"})}),"\n",(0,s.jsx)(r.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsx)(r.p,{children:"In many contexts, it is necessary to have a curated registry of authorised entities. Example use cases:"}),"\n",(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsx)(r.li,{children:"A list of members in a DAO or membership organisation"}),"\n",(0,s.jsx)(r.li,{children:"A list of verified Tokens for use in end user wallets"}),"\n"]}),"\n",(0,s.jsx)(r.p,{children:"CAD34 defines a generic, extensible interface for such registries, in order to support flexible tools and administration of registries that follow the standard."}),"\n",(0,s.jsx)(r.p,{children:"Design goals:"}),"\n",(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsx)(r.li,{children:"Support for any kind of unique ID / entity"}),"\n",(0,s.jsx)(r.li,{children:"Integration with teh CAD22 trust monitor model"}),"\n",(0,s.jsx)(r.li,{children:"Support for flexible administrative control at a per-registry level"}),"\n",(0,s.jsx)(r.li,{children:"Support for a single Actor hosting many registries"}),"\n"]}),"\n",(0,s.jsx)(r.h2,{id:"key-functions",children:"Key functions"}),"\n",(0,s.jsx)(r.h3,{id:"create-registry",children:"Create Registry"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-clojure",children:"(call registry-actor (create-registry controller {:optional :metadata}))\n"})}),"\n",(0,s.jsx)(r.p,{children:"Where:"}),"\n",(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.code,{children:"controller"})," is a trust monitor for registry actions"]}),"\n",(0,s.jsx)(r.li,{children:"An arbitrary metadata map may be provided, which will be attached to the registry"}),"\n"]}),"\n",(0,s.jsxs)(r.p,{children:["The registry actor MUST enforce that only a caller allowed to use the ",(0,s.jsx)(r.code,{children:":create-registry"})," action is able to execute this, otherwise MUST fail with a ",(0,s.jsx)(r.code,{children:":TRUST"})," error."]}),"\n",(0,s.jsx)(r.p,{children:"If permitted, the registry actor MUST creates a registry with the given metadata, and returns a new registry ID."}),"\n",(0,s.jsx)(r.h3,{id:"delete-registry",children:"Delete Registry"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-clojure",children:"(call registry-actor (delete-registry registry-id))\n"})}),"\n",(0,s.jsxs)(r.p,{children:["The registry actor MUST enforce that only a caller allowed to use the ",(0,s.jsx)(r.code,{children:":delete-registry"})," action is able to execute this, otherwise MUST fail with a ",(0,s.jsx)(r.code,{children:":TRUST"})," error."]}),"\n",(0,s.jsx)(r.p,{children:"If permitted, the registry actor MUST delete the entire registry."}),"\n",(0,s.jsx)(r.p,{children:"The registry actor MUST NOT re-issue the same registry ID for any newly created registry."}),"\n",(0,s.jsx)(r.p,{children:"An administrator of the registry actor MAY re-instate the registry, but will have to restore this from off-chain information."}),"\n",(0,s.jsx)(r.h3,{id:"register",children:"Register"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-clojure",children:"(call registry-actor (register subject metadata))\n"})}),"\n",(0,s.jsxs)(r.p,{children:["If successful, the call MUST add ",(0,s.jsx)(r.code,{children:"subject"})," to the given registry with the given metadata."]}),"\n",(0,s.jsxs)(r.p,{children:["If the ",(0,s.jsx)(r.code,{children:"subject"})," already exists, the call MUST replace the metadata for the given subject."]})]})}function h(e={}){const{wrapper:r}={...(0,n.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},7028:(e,r,t)=>{t.d(r,{R:()=>a,x:()=>c});var i=t(758);const s={},n=i.createContext(s);function a(e){const r=i.useContext(n);return i.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function c(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(n.Provider,{value:r},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.