> For the complete documentation index, see [llms.txt](https://shakestock.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shakestock.gitbook.io/whitepaper/technology/telegram-mini-app.md).

# Telegram Mini App

How the Telegram Mini App handles the user interface, movement interaction, identity context, and entry point into the SHAKESTOCK system.

SHAKESTOCK runs as a Mini App inside Telegram. It is the application layer for user interaction, movement input, Shake Coin earning, stock selection, and claim initiation. The source does not require a separate native application download.

```
Open Mini App → interact with movement mechanic → earn Shake Coins
→ select stock → initiate claim
```

### Movement input pipeline

The Mini App uses the phone's movement sensors for the shake mechanic. A movement must reach the configured threshold before it is treated as a shake event.

| Parameter       | Phase 1 value | Technical role                                               |
| --------------- | ------------- | ------------------------------------------------------------ |
| Shake threshold | 15 m/s²       | Sets the minimum movement intensity for a shake event.       |
| Debounce        | 800 ms        | Prevents repeated shake events from registering too quickly. |
| Daily shake cap | 500 shakes    | Limits the number of daily shake events counted for a user.  |

The whitepaper specifies these control parameters. It does not specify a sensor API, operating-system API, or device hardware implementation.

### Phase 1 anti-cheat controls

The current anti-cheat layer combines movement checks with account and network constraints.

| Control                        | Boundary    | Purpose                                           |
| ------------------------------ | ----------- | ------------------------------------------------- |
| 15 m/s² threshold              | Application | Filters out low-intensity movement.               |
| 800 ms debounce                | Application | Limits rapid repeated triggers.                   |
| 500-shake daily cap            | Application | Limits daily counted activity.                    |
| Device fingerprint             | Application | Establishes a device-level uniqueness constraint. |
| One phone = one account        | Application | Restricts account use per phone.                  |
| IP rate limit                  | Application | Adds a network-level abuse-control layer.         |
| Telegram identity verification | Application | Links activity to Telegram account identity.      |

These controls create validation boundaries before Shake Coin accounting. They do not claim perfect Sybil resistance.

### Identity context

Telegram identity verification is part of the application-layer anti-cheat model. It ties participation to the user's Telegram account context.

The whitepaper does not define a specific identity protocol or authentication standard. This documentation therefore does not assume one.

### Current and future controls

Phase 1 contains the threshold, debounce, daily cap, device fingerprint, IP rate limit, and Telegram identity controls described above.

{% hint style="info" %}
Later phases are future work. Phase 2 adds ML-based real-versus-fake movement classification. Phase 3 proposes a custom model trained on real shake and cheat data.
{% endhint %}

The future ML models are not presented as deployed functionality.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://shakestock.gitbook.io/whitepaper/technology/telegram-mini-app.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
