> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kynesys.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Get up and running with the DEMOS SDK in under 5 minutes. This tutorial walks you through installation, wallet setup, and your first blockchain queries.

# Quick Start

This guide will have you connected to the DEMOS Network and querying the blockchain in just a few minutes.

<Steps>
  <Step title="Install the SDK">
    Add the DEMOS SDK to your project using bun (recommended):

    ```bash theme={null}
    bun add @kynesyslabs/demosdk@latest
    ```

    <Info>
      For browser environments, you'll need Buffer polyfills. See [Getting Started](/sdk/getting-started) for Vite configuration.
    </Info>
  </Step>

  <Step title="Create a Wallet">
    Generate a new wallet with a mnemonic seed phrase:

    ```typescript theme={null}
    import { Demos } from "@kynesyslabs/demosdk/websdk"

    const demos = new Demos()

    // Generate a new mnemonic (save this securely!)
    const mnemonic = demos.newMnemonic()
    console.log("Your mnemonic:", mnemonic)

    // Connect using the mnemonic
    const publicKey = await demos.connectWallet(mnemonic, {
        algorithm: "ed25519",
    })
    console.log("Your public key:", publicKey)
    ```

    <Warning>
      **Security**: Never share your mnemonic. Store it securely - it controls access to all your keys.
    </Warning>
  </Step>

  <Step title="Connect to the Network">
    Connect to a DEMOS RPC node:

    ```typescript theme={null}
    await demos.connect("https://node2.demos.sh")

    if (demos.connected) {
        console.log("Connected to DEMOS Network!")
    }
    ```
  </Step>

  <Step title="Query the Blockchain">
    Now you can read data from the blockchain:

    ```typescript theme={null}
    // Get the latest block number
    const blockNumber = await demos.getLastBlockNumber()
    console.log("Latest block:", blockNumber)

    // Get the latest block hash
    const blockHash = await demos.getLastBlockHash()
    console.log("Latest block hash:", blockHash)

    // Get your wallet info
    const address = demos.getAddress()
    const addressInfo = await demos.getAddressInfo(address)
    console.log("Your wallet info:", addressInfo)
    ```
  </Step>

  <Step title="Sign a Message">
    Test your wallet by signing and verifying a message:

    ```typescript theme={null}
    const message = "Hello DEMOS Network!"

    // Sign the message
    const signature = await demos.signMessage(message)
    console.log("Signature:", signature)

    // Verify the signature
    const publicKey = demos.getAddress()
    const isValid = await demos.verifyMessage(
        message,
        signature.data,
        publicKey,
        { algorithm: signature.type }
    )
    console.log("Signature valid:", isValid)
    ```
  </Step>
</Steps>

## Complete Example

Here's the full code to copy and run:

```typescript theme={null}
import { Demos } from "@kynesyslabs/demosdk/websdk"

async function main() {
    // Initialize
    const demos = new Demos()

    // Create wallet
    const mnemonic = demos.newMnemonic()
    console.log("Mnemonic:", mnemonic)

    const publicKey = await demos.connectWallet(mnemonic, {
        algorithm: "ed25519",
    })
    console.log("Public key:", publicKey)

    // Connect to network
    await demos.connect("https://node2.demos.sh")
    console.log("Connected:", demos.connected)

    // Query blockchain
    const blockNumber = await demos.getLastBlockNumber()
    console.log("Latest block:", blockNumber)

    // Sign message
    const signature = await demos.signMessage("Hello DEMOS!")
    console.log("Signed message successfully!")

    // Clean up
    demos.disconnect()
}

main().catch(console.error)
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Create Transactions" icon="paper-plane" href="/sdk/websdk/transactions/overview">
    Learn how to create and broadcast transactions
  </Card>

  <Card title="Cross-Chain Operations" icon="link" href="/sdk/cross-chain/overview">
    Execute transactions on other blockchains via DEMOS
  </Card>

  <Card title="Node Calls Reference" icon="server" href="/sdk/websdk/nodecalls">
    Explore all available blockchain queries
  </Card>

  <Card title="Authentication Deep Dive" icon="key" href="/sdk/websdk/authentication/overview">
    Learn about PQC algorithms and advanced key management
  </Card>
</CardGroup>
