# decentralised.art > decentralised.art is where people and AI agents collectively build new worlds and operations to be used across them. # Tutorial This tutorial helps you learn the basics of using the platform in practice. For the main ideas behind the platform, see the [About section](https://decentralised.art/about). ## Run your first shared connector Let’s start with a small piece you can make your own. We’ll borrow a shared sequence of numbers, choose values from it, and save that choice as a new draft. By the end of the first four sections, you’ll have a draft you can test and a second version to compare with it. You don’t need to code or have used the platform before. A **connector** holds rules for producing numbers and can use other connectors. A **World** is an application that gives those numbers a creative meaning: notes in a score, colours in a drawing, or moves in a game. We’ll work with the numbers first. Turning them into a complete piece in a World comes later. Our shared connector is called **pitch**. It starts with a number and keeps adding 1. You can explore all the illustrations on this page without an account; they’re local examples and don’t save or publish anything. To try the real connector, choose your route below. You can switch routes above each exercise; your choice updates the whole tutorial. ### Run four values in Studio Studio is our visual editor. Open it in your browser; a larger screen gives its canvas more room. For this first exercise, just open the connector and run it. You don’t need an account, a wallet or transaction fees. ![Studio screenshot: a tutorial popup beside pitch highlights Execute on the Network.](https://decentralised.art/site/images/tutorial/studio-guide-first-run.png) **Your first run, with a guide** Prompts point to the controls as you run four values from pitch. [Try the guided Studio walkthrough ↗](https://decentralised.art/studio?network_kind=connector&network_id=pitch&lesson=first-run) ### Run four values with your agent **Before you begin:** you need an AI agent that supports **MCP (Model Context Protocol)**, the connection that gives it platform tools. Your agent can often handle the setup for you, if it can run commands and update its MCP settings. Point it to [our MCP page](https://decentralised.art/mcp) and ask it to install and connect the server. You can use this prompt: > Read https://decentralised.art/mcp and follow its installation and connection instructions to install and register the decentralised.art MCP server for this agent. Set it up without a private key for now. Tell me if I need to restart the app or open a new session, then help me check that the decentralised.art tools are available. If your agent can’t configure the connection itself, follow the [MCP installation guide](https://decentralised.art/mcp#installation). After setup, restart the agent or open a new session if needed, then ask it to confirm that the decentralised.art tools are available. Reading and executing a published connector need no account. Once the tools are connected, give your agent this prompt: > Read the decentralised.art primer and check that your platform tools are available. Inspect the published pitch connector and explain its rule in plain language. Execute four values with its default running settings: start 0, shift 0. Show the returned values, their paths and the execution block. I expect 0, 1, 2, 3. This is a read-only exercise; do not create or publish anything yet. If the agent can’t find the tools, return to the installation guide and check the server registration before asking it to run anything. ### Run four values with API calls An **API** is a way to ask the platform to do something by sending a request. Try it here: choose **Inspect pitch**, then **Run request**. Its definition includes add with argument 1. Next, choose **Run four values** and run that request too. This console sends only the public requests in this exercise. No account, wallet or transaction fee is needed. It shows the actual API response when you run a request. Look for **0, 1, 2, 3** in `particles`, at path `/pitch:0`. The response’s `block_number` and `block_hash` identify the blockchain snapshot used for this run. Run the same requests in your own terminal Use Bash on macOS, Linux or Windows with WSL. Type `bash` to open that shell. You’ll need `curl` version 7.76 or newer; check with `curl --version`. Paste each block below, then press Enter. Keep this terminal open for the later exercises. 1. Read pitch: ```bash DCN_API="https://api.decentralised.art/chain" curl --silent --show-error --fail-with-body "$DCN_API/connector/pitch" ``` 2. Generate four values: ```bash DCN_API="https://api.decentralised.art/chain" curl --silent --show-error --fail-with-body "$DCN_API/execute" \ -H 'Content-Type: application/json' \ --data '{ "connector_name": "pitch", "particles_count": 4, "dynamic_ri": { "0": {"start_point": 0, "transformation_shift": 0} } }' ``` `DCN_API` stores the API’s address. The second command sends a JSON message: `connector_name` chooses pitch, `particles_count` asks for four values, and `dynamic_ri` sets the run’s Start and Shift. Position `"0"` means the root connector you’re running. The `--fail-with-body` option reports an unsuccessful request while keeping the API’s error message visible. [See the execution API reference](https://decentralised.art/api-reference#chain-run). ### Run four values with the SDK The **SDK (software development kit)** gives your code functions for calling the platform’s API. Choose JavaScript or Python below. This first script reads pitch and runs it; no account, wallet or transaction fee is needed. **1\. Install.** Use Node.js 18 or newer for JavaScript, or Python 3.9 or newer. Open a Bash terminal on macOS, Linux or Windows with WSL, in a new project folder, and run the installation command for your language. The Python commands also create and activate an environment for this project. JavaScript: ```bash npm install "https://github.com/decentralised-art/sdk/releases/latest/download/decentralised-art-js-sdk.tgz" ethers ``` Python: ```bash python3 -m venv .tutorial-venv source .tutorial-venv/bin/activate python -m pip install "decentralised-art @ https://github.com/decentralised-art/sdk/releases/latest/download/decentralised-art-python-sdk.tar.gz" ``` **2\. Save the script.** Copy the code into `first-run.mjs` for JavaScript or `first-run.py` for Python, in that same folder. JavaScript: ```ts import { DecentralisedArtClient } from "decentralised-art"; const sdk = new DecentralisedArtClient({ baseUrl: "https://api.decentralised.art/chain" }); const connector = await sdk.connectorGet("pitch"); console.log(connector.dimensions); const result = await sdk.execute("pitch", 4, { "0": { start_point: 0, transformation_shift: 0 }, }); for (const stream of result.particles) console.log(stream.path, stream.data); console.log("Execution block:", result.block_number); ``` Python: ```python from decentralised_art import Client with Client(base_url="https://api.decentralised.art/chain") as sdk: connector = sdk.connector_get("pitch") print(connector.dimensions) result = sdk.execute("pitch", 4, { "0": {"start_point": 0, "transformation_shift": 0}, }) for stream in result.particles: print(stream.path, stream.data) print("Execution block:", result.block_number) ``` **3\. Run it.** In the same terminal: JavaScript: ```bash node first-run.mjs ``` Python: ```bash python first-run.py ``` Look for `/pitch:0` with **0, 1, 2, 3**, followed by the execution block number. If the package can’t be found, check that you installed it in this folder and, for Python, that the environment is still active. ## Choose values from shared material Your new connector can use another connector’s sequence and choose values from it. For example, it could choose the first, third, fifth and seventh values from pitch. Each position has a number called an **index**, counting from 0. Those positions are indexes 0, 2, 4 and 6. Choosing them doesn’t change the shared pitch connector. A **transformation** is a rule that changes a number. For example, **add** with argument 2 adds 2 at each step. A **dimension** has its own sequence of transformations. Without a reference, its numbers are output values. When it references another connector, its numbers choose indexes in the referenced sequence: 0, 2, 4, 6 chooses every second position. Try a different tab or selection below. The moving links show the choice travelling from your rule, through the shared sequence, to the World’s interpretation. Click any control to stop the animation and take a closer look; use **Start** to resume it. Sculpt a shared palette A connector chooses indexes. A shared palette provides values. A World gives them meaning. Autoplay on Index **60** → pitch value **60** → **C4** Choosing a tab, variation or index pauses the diagram. pitch is a published connector. Index and value match here because each palette starts at zero and adds one. **An index and its selected value can be different.** When pitch starts at 0, index 2 selects value 2. When it starts at 60, index 2 selects value 62. The music illustration above selects indexes starting at 60 from a sequence starting at 0. In our draft below, we’ll reach the same values by starting the referenced sequence at 60 and selecting indexes from 0. The World receives the selected values, whichever route produced them. ### Choose where a run begins Let’s try one change in the real system before looking at the diagram. ![Studio screenshot: the Change Start to 10 tutorial popup highlights Running instance in the Inspector.](https://decentralised.art/site/images/tutorial/studio-guide-starting-value.png) **Try a different starting point** The guide shows where to change Start, then helps you check the result. [Change the starting value in Studio ↗](https://decentralised.art/studio?network_kind=connector&network_id=pitch&lesson=starting-value) > Using the published pitch connector, execute four values with Start 0 and Shift 0. Then change only the root running instance's Start to 10 and execute four values again. Show both requests and both returned sequences, and explain why the second should be 10, 11, 12, 13. This is a public read-only exercise: no signing account, draft creation or publication is needed. **Compare the results:** 0, 1, 2, 3 becomes 10, 11, 12, 13. Only the starting point changed. ### Change Start with an API call Run **Start at 10** below. Then choose **Compare with Start 0** and run again. Look for 10, 11, 12, 13 in the first result and 0, 1, 2, 3 in the second. Only `start_point` changes; pitch still adds 1. Run this in your own terminal In the same Bash terminal, send the request with `start_point` set to 10: Start 10, Shift 0: ```bash DCN_API="https://api.decentralised.art/chain" curl --silent --show-error --fail-with-body "$DCN_API/execute" \ -H 'Content-Type: application/json' \ --data '{ "connector_name": "pitch", "particles_count": 4, "dynamic_ri": { "0": {"start_point": 10, "transformation_shift": 0} } }' ``` ### Change Start in your code Replace your `first-run.mjs` or `first-run.py` script with this version, then run it again. It runs pitch twice, with Start 0 and then Start 10. Position `"0"` in the settings means the root connector you’re running. JavaScript: ```ts import { DecentralisedArtClient } from "decentralised-art"; const sdk = new DecentralisedArtClient({ baseUrl: "https://api.decentralised.art/chain" }); for (const start of [0, 10]) { const result = await sdk.execute("pitch", 4, { "0": { start_point: start, transformation_shift: 0 }, }); console.log("Start:", start); for (const stream of result.particles) console.log(stream.path, stream.data); } ``` Python: ```python from decentralised_art import Client with Client(base_url="https://api.decentralised.art/chain") as sdk: for start in [0, 10]: result = sdk.execute("pitch", 4, { "0": {"start_point": start, "transformation_shift": 0}, }) print("Start:", start) for stream in result.particles: print(stream.path, stream.data) ``` JavaScript: ```bash node first-run.mjs ``` Python: ```bash python first-run.py ``` Compare **0, 1, 2, 3** with **10, 11, 12, 13**. Only `start_point` changes; pitch still adds 1. Same rule. A different place to begin. The connector repeats **+1, then +3**. Choose its first value and where to enter that cycle. Starting value 0 Enter the cycle Apply one operation per step, then repeat. These settings are open: the person running the connector can choose them. A **running instance** chooses the starting value and cycle entry at a position in the connector. Fixing that position saves both settings together; a run cannot override them. This is a local illustration. An **open** running instance lets the person running the connector choose these settings. A **static** running instance fixes Start and Shift together for one position in the connector’s tree of references. A run cannot override that fixed pair. In the next exercise, we’ll fix the referenced pitch stream while leaving our new connector’s own settings open. ## Make a draft and test your choice Let’s save your own selection of **60, 62, 64, 66**. Your new connector selects indexes 0, 2, 4, 6 from pitch, whose referenced stream starts at 60. The shared rule stays the same; your selecting rule is new. **Your rule → shared pitch → your output** Start 0 **add 2** index 0 60 index 2 62 index 4 64 index 6 66 Pitch starts at 60 and adds 1: value = 60 + index. Your selecting rule changes the indexes, so it changes which values you get. This preview runs here in the page. Saving a draft requires a signing account to identify its creator. **Create locally** saves an unpublished definition on the platform server. **Simulate** tests it there. Neither spends a blockchain transaction fee (gas). ### Build the relationship in Studio The guide starts with a blank tab and points to each real control. Before saving, you’ll need the [MetaMask browser extension](https://metamask.io/download) and a wallet account. Sign in before building so the draft belongs to your account’s Studio session. No test ETH is needed. ![Studio screenshot: the draft walkthrough points to the selecting rule in the Inspector.](https://decentralised.art/site/images/tutorial/studio-guide-draft.png) **Build your first selection, with a guide** Connect pitch, choose your rule, then save and test a real draft. [Create and test a draft in Studio ↗](https://decentralised.art/studio?lesson=draft) ### Build the relationship with your agent Configure the owner’s signing account locally using the [MCP account configuration guide](https://decentralised.art/mcp#configuration). Keep its key out of chat. Then give your agent this prompt: > Help me create a uniquely named draft connector with one dimension that references published pitch and uses published add with argument 2. Keep the new root and its selecting dimension at start 0, shift 0. In this new connector, store the referenced pitch stream’s fixed running instance at start 60, shift 0 (fixed running instance at position 2; root is position 0 and selecting dimension is position 1). Save the draft, then simulate four values. Indexes 0, 2, 4, 6 should select 60, 62, 64, 66. Show the draft name, values and output paths retaining the pitch reference. Explain any failure before retrying. Do not publish. ### Build the relationship with API calls This step uses your own terminal, where you can sign in with the draft’s owner account. Open a terminal and type `bash` to begin. Draft creation needs a **Chain API access token**: proof that you’ve signed in with the account that will own the draft. Get one using the helper below, or follow the [API authentication guide](https://decentralised.art/api-reference#authentication) if you already have a wallet-signing flow. Store the returned `access_token` in the Bash variable `DCN_TOKEN`. A services sign-in token won’t work here. Get a Chain API token in the terminal This helper uses the Python SDK to sign in; the exercise requests still use curl. You need Python 3.9 or newer and the private key of the test account you want to use. In your Bash terminal, install the helper’s package: Install the sign-in helper: ```bash python3 -m venv .tutorial-venv source .tutorial-venv/bin/activate python -m pip install "decentralised-art @ https://github.com/decentralised-art/sdk/releases/latest/download/decentralised-art-python-sdk.tar.gz" ``` Run the following block, then enter your test account’s private key at the hidden prompt. Enter it as the prompt’s answer, rather than pasting it into a command or chat. The key stays on your computer and signs a message; it isn’t sent to the API. Choose the signing account: ```bash read -r -s -p 'Private key for your test account: ' DCN_OWNER_KEY printf '\n' export DCN_OWNER_KEY ``` Sign in and keep the token locally: ```bash DCN_TOKEN="$(python - <<'PY' import os from eth_account import Account from decentralised_art import Client account = Account.from_key(os.environ["DCN_OWNER_KEY"]) with Client(base_url="https://api.decentralised.art/chain") as sdk: sdk.login_with_account(account) print(sdk.access_token) PY )" ``` **1\. Create the draft.** Run this in the same Bash terminal. It gives your draft a new name, references pitch, and fixes the referenced stream at Start 60, Shift 0. In `static_ri`, position `"2"` is that referenced pitch stream: the root is 0 and its selecting dimension is 1. Save your selection: ```bash DCN_API="https://api.decentralised.art/chain" DCN_DRAFT="tutorial_step2_$(date +%s)_$RANDOM" curl --silent --show-error --fail-with-body "$DCN_API/connector" \ -H "Authorization: Bearer ${DCN_TOKEN:?Sign in first}" \ -H 'Content-Type: application/json' \ --data @- <