{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Create A Permissioned Domain","siteUrl":"https://opensource.ripple.com/","meta":[{"name":"google-site-verification","content":"bLwyBi1imklcIuQxZ7JeI_kRF5Mg7yfr6arpEQV2nsE"}],"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"description":"Set up a permissioned domain that restricts participation to credential holders, then scope DEX offers to it."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"create-a-permissioned-domain","__idx":0},"children":["Create A Permissioned Domain"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A permissioned domain restricts who can participate based on the credentials they hold. Create the domain with the credentials it accepts, then scope DEX offers to it with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domainID"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"/**\n * Set up a permissioned domain and trade inside it.\n *\n * A permissioned domain restricts who can participate based on the credentials\n * they hold. Create the domain with the credentials it accepts, then scope DEX\n * offers to it with `domainID`.\n */\nimport { LocalSigner, SimpleXRPL } from 'simplexrpl'\n\nconst client = await SimpleXRPL.init({\n  xrpldUrl: 'wss://s.altnet.rippletest.net:51233',\n  signers: [LocalSigner.fromEnv()],\n})\n\n// 1. Create the domain, listing the credentials it accepts (issuer + type).\nconst domain = await client.domain.create({\n  credList: [\n    { issuer: 'rKycIssuer0000000000000000000000000', credType: 'KYC' },\n    { issuer: 'rAccreditation000000000000000000000', credType: 'ACCREDITED' },\n  ],\n})\nconst domainID = domain.intent.domainID\nconsole.log('permissioned domain:', domainID)\n\n// 2. Update the accepted credentials later if the policy changes.\nawait client.domain.setCredentials({\n  domain: domainID,\n  credList: [\n    { issuer: 'rKycIssuer0000000000000000000000000', credType: 'KYC' },\n  ],\n})\n\n// 3. Place a domain-scoped DEX offer. With `domainID` set, the offer defaults\n//    to hybrid (also crosses the open DEX) unless `hybrid: false` is passed.\nawait client.iou.sellOffer({\n  ticker: 'USD',\n  amount: '100',\n  orderType: 'limit',\n  price: { currency: 'XRP', amount: '50' },\n  domainID,\n  hybrid: false, // permissioned-only: do not touch the open DEX\n})\n\n// 4. Read it back (no signer required). `retrieve` resolves a domain by id and\n//    returns its owner and accepted-credential list (decoded from hex); `list`\n//    returns every domain owned by an account (defaults to the primary).\nconst read = await client.domain.retrieve({ domainID })\nconsole.log('accepts:', read.data?.credList)\n\nconst owned = await client.domain.list()\nconsole.log('owned domains:', owned.domains)\n\nawait client.disconnect()\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"see-also","__idx":1},"children":["See Also"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals/domain/create"},"children":["domain.create()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals/domain/setcredentials"},"children":["domain.setCredentials()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals/domain/retrieve"},"children":["domain.retrieve()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals/domain/list"},"children":["domain.list()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals/iou/selloffer"},"children":["iou.sellOffer()"]}]}]}]},"headings":[{"value":"Create A Permissioned Domain","id":"create-a-permissioned-domain","depth":1},{"value":"See Also","id":"see-also","depth":2}],"frontmatter":{"seo":{"description":"Set up a permissioned domain that restricts participation to credential holders, then scope DEX offers to it.","title":"Create A Permissioned Domain"},"labels":["simpleXRPL","SDK"]},"editPage":{"to":"https://github.com/ripple/opensource.ripple.com/tree/main/docs/simpleXRPL/tutorials/create-permissioned-domain.md"},"lastModified":"2026-08-21T20:52:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/simplexrpl/tutorials/create-permissioned-domain","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}