Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy to GitHub Pages

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run build
env:
NEXT_PUBLIC_SITE_URL: ${{ vars.SITE_URL }}
- run: touch out/.nojekyll
- run: python3 scripts/lint-mdx.py
- uses: actions/upload-pages-artifact@v3
with:
path: out

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
232 changes: 116 additions & 116 deletions NOTES.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Superhero Dev

The developer documentation for [Superhero](https://superhero.com) — the on-chain attention
The developer documentation for [Superhero](https://superhero.com), the on-chain attention
market where you can discover, trade, and govern the trends you believe in.

Built with [Nextra](https://nextra.site) (docs theme, `pages/` router).
Expand All @@ -27,7 +27,7 @@ The canonical origin used for `og:url` and the social-card image resolves automa
`NEXT_PUBLIC_SITE_URL` if set, otherwise Vercel's `VERCEL_PROJECT_PRODUCTION_URL`. Attaching a
custom domain in Vercel is enough; no code change is needed.

Brand assets live in `public/` and come from the Superhero app's own `public/` directory —
Brand assets live in `public/` and come from the Superhero app's own `public/` directory:
the mark, the wordmark, the favicon set and the social card.

### Two constraints worth knowing before you edit
Expand Down Expand Up @@ -63,21 +63,21 @@ pages/
├── agents/ AI agents: skill install, autonomous mode, strategies, CLI reference
├── api-reference/ api.superhero.com REST reference
├── contracts/ Sophia contract reference and deployed addresses
├── aeternity/ The underlying chain — scoped to what Superhero actually uses
├── aeternity/ The underlying chain, scoped to what Superhero actually uses
└── resources/ Whitepaper, brand, support, official links
```

## Editing

Every page follows the same shape: double-quoted `title` and `description` frontmatter, an H1,
one to three sentences of opening prose, task-oriented sections, and a `## Read more` section of
internal links. Plain MDX only — no imports, no components.
internal links. Plain MDX only, with no imports and no components.

Five things break the build, and `scripts/lint-mdx.py` catches all of them: unquoted
frontmatter, a bare `{` or `<` in prose, a `|` inside inline code inside a table row, a broken
internal link, and a page missing from its directory's `_meta.json`. Run it before every push.

`NOTES.md` holds maintainer-only material — product defects found while writing, and facts that
`NOTES.md` holds maintainer-only material: product defects found while writing, and facts that
have not been verified against a live system. It is not part of the site.

## Where the content comes from
Expand Down
27 changes: 9 additions & 18 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ const withNextra = require('nextra')({
* Resolution order:
* 1. NEXT_PUBLIC_SITE_URL, if the deployment sets one explicitly. Use this
* once a custom domain is attached and should be the canonical one.
* 2. VERCEL_PROJECT_PRODUCTION_URL, which Vercel injects at build time and
* which always names the project's real production domain — including a
* custom domain once one exists. This keeps the tags correct with no
* manual step.
* 2. VERCEL_PROJECT_PRODUCTION_URL, for Vercel previews only. Production is
* GitHub Pages, where the workflow sets NEXT_PUBLIC_SITE_URL from the
* SITE_URL repository variable.
* 3. localhost, so a local build produces coherent (if local) tags rather
* than pointing at a domain that may not exist.
*/
Expand All @@ -32,18 +31,10 @@ module.exports = withNextra({
env: {
NEXT_PUBLIC_SITE_URL: siteUrl(),
},
async redirects() {
return [
{
source: '/identity/profile-registry',
destination: '/identity/address-link',
permanent: true,
},
{
source: '/contracts/profile-registry',
destination: '/contracts/address-link',
permanent: true,
},
]
},
// Static export for GitHub Pages. Next's redirects() does not run on a
// static host, so the two renamed pages redirect from small client pages
// in pages/identity and pages/contracts instead.
output: 'export',
images: { unoptimized: true },
trailingSlash: true,
})
26 changes: 13 additions & 13 deletions pages/aeternity/accounts-and-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Identifiers are a raw byte array, base-encoded, with a prefix describing what th
Base58 with a checksum is used for short identifiers meant to be read and pasted; base64 for
longer binary payloads.

### Base58 — the ones you paste
### Base58: the ones you paste

| Prefix | What it identifies | Where it shows up in Superhero |
| --- | --- | --- |
Expand All @@ -28,10 +28,10 @@ longer binary payloads.
| `cm_` | Commitment | The salted preclaim hash in AENS registration |
| `ok_` | Oracle public key | Not used by Superhero |
| `oq_` | Oracle query id | Not used by Superhero |
| `ch_` | Channel id | State channels — not used by Superhero |
| `ch_` | Channel id | State channels; not used by Superhero |
| `pp_` | Peer public key | Node-to-node networking; never user-facing |

### Base64 — the ones that appear in payloads
### Base64: the ones that appear in payloads

| Prefix | What it identifies |
| --- | --- |
Expand All @@ -54,15 +54,15 @@ and passes without a prefix check. Other prefixes are not accepted as input.
## Keys

æternity accounts are **Ed25519** keypairs. The public key, base58-encoded with a checksum and the
`ak_` prefix, *is* the address — there is no account-creation transaction, and an address is
`ak_` prefix, *is* the address. There is no account-creation transaction, and an address is
valid the moment you generate the key. The same keypair signs delegated-posting messages, which
contracts verify with `Crypto.verify_sig`.

### Secret-key encoding

Superhero's tooling uses `@aeternity/aepp-sdk` v14. From v14, `MemoryAccount` takes the secret
key as an `sk_`-prefixed encoded 32-byte secret, not raw hex. The web app's built-in wallet
normalises older persisted values — raw hex, or a longer keypair payload — by taking the first
normalises older persisted values (raw hex, or a longer keypair payload) by taking the first
32 bytes and encoding them as `sk_`. The agent skill does not: it passes `AE_PRIVATE_KEY` straight
to `new MemoryAccount(privateKey)`, so give it the `sk_` form.

Expand Down Expand Up @@ -92,7 +92,7 @@ const account = new AccountMnemonicFactory(mnemonic).initializeSync(index);
console.log(account.address); // ak_...
```

Use the SDK's factory rather than reimplementing BIP32 or SLIP-0010 by hand — BIP32 was written
Use the SDK's factory rather than reimplementing BIP32 or SLIP-0010 by hand. BIP32 was written
for secp256k1 and does not apply unchanged to Ed25519. See
[Backup & recovery](/wallets/backup-and-recovery) and [Built-in wallet](/wallets/built-in-wallet).

Expand All @@ -103,13 +103,13 @@ for secp256k1 and does not apply unchanged to Ed25519. See
- **`ct_` addresses are case-sensitive base58.** Uppercasing a sale address corrupts it; token
symbols, by contrast, are uppercased for lookup.
- **A `.chain` name is not an address.** Resolve it to an `ak_` through AENS before using it in a
transaction — see [AENS](/aeternity/aens).
transaction. See [AENS](/aeternity/aens).

## Related

- [AENS](/aeternity/aens) — how `nm_` and `cm_` come into existence, and how names resolve to `ak_`.
- [Wallet & keys for agents](/agents/wallet-and-keys) — generating and storing `AE_PRIVATE_KEY` for the agent skill.
- [Wallet security](/wallets/security) — how to hold a key you care about.
- [Explorers](/aeternity/explorers) — where each prefix takes you on æScan.
- [æternity API encoding spec](https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md) — the authoritative list of every prefix and its base encoding.
- [æternity JavaScript SDK quick start](https://sdk.aeternity.io/latest/quick-start/) — creating an account and signing with the v14 SDK.
- [AENS](/aeternity/aens): how `nm_` and `cm_` come into existence, and how names resolve to `ak_`.
- [Wallet & keys for agents](/agents/wallet-and-keys): generating and storing `AE_PRIVATE_KEY` for the agent skill.
- [Wallet security](/wallets/security): how to hold a key you care about.
- [Explorers](/aeternity/explorers): where each prefix takes you on æScan.
- [æternity API encoding spec](https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md): the authoritative list of every prefix and its base encoding.
- [æternity JavaScript SDK quick start](https://sdk.aeternity.io/latest/quick-start/): creating an account and signing with the v14 SDK.
16 changes: 8 additions & 8 deletions pages/aeternity/ae-and-gas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An **aetto** (plural *aettos*) is the smallest unit of AE:
```

**Every amount crossing a chain boundary is in aettos.** Node balances, contract call `amount`
options, bonding-curve prices, event arguments — all aettos, all integers. AE is a presentation
options, bonding-curve prices, event arguments: all aettos, all integers. AE is a presentation
format.

### Convert safely
Expand Down Expand Up @@ -71,7 +71,7 @@ An æternity transaction has two separate charges:
Gas is charged on top of `fee`, up to the limit in the transaction. At a routine 5M gas limit
that ceiling is around thirty times the fee, so the Superhero wallet shows a separate
"Gas, at most" row, computed as `gasLimit × gasPrice`. When you approve a contract call, that
row — not "Network fee" — is your worst case.
row, not "Network fee", is your worst case.

### Gas price

Expand All @@ -97,7 +97,7 @@ Superhero does not override the SDK's gas defaults: no contract call in the web

Gas is debited up front: the protocol subtracts `gas × gas_price` from the caller before
execution, then refunds the unused portion and pays the used portion to the miner. A call that
exhausts its `gasLimit` refunds nothing — the transaction is still mined, the state change is
exhausts its `gasLimit` refunds nothing: the transaction is still mined, the state change is
rolled back, and you pay the full limit. A generous `gasLimit` costs nothing when the call
succeeds and everything when it does not.

Expand Down Expand Up @@ -136,8 +136,8 @@ AE.

## Related

- [Fees & slippage](/tokens/fees-and-slippage) — the protocol fees layered on top of gas when you trade.
- [Curve parameters & units](/tokens/curve-parameters) — where aettos meets bonding-curve math.
- [Accounts & Keys](/aeternity/accounts-and-keys) — the account these balances belong to.
- [Fund your wallet](/getting-started/fund-wallet) — the practical route to a funded account.
- [SDK transaction options](https://github.com/aeternity/aepp-sdk-js/blob/develop/docs/transaction-options.md) — `gasLimit`, `gasPrice`, `fee` and their defaults.
- [Fees & slippage](/tokens/fees-and-slippage): the protocol fees layered on top of gas when you trade.
- [Curve parameters & units](/tokens/curve-parameters): where aettos meets bonding-curve math.
- [Accounts & Keys](/aeternity/accounts-and-keys): the account these balances belong to.
- [Fund your wallet](/getting-started/fund-wallet): the practical route to a funded account.
- [SDK transaction options](https://github.com/aeternity/aepp-sdk-js/blob/develop/docs/transaction-options.md): `gasLimit`, `gasPrice`, `fee` and their defaults.
24 changes: 12 additions & 12 deletions pages/aeternity/aens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "AENS — the æternity Naming System"
description: "How .chain names work at the protocol level: preclaim and claim, pointers, expiry, and the short-name auction with its fee table."
---

# AENS — the æternity Naming System
# AENS: the æternity Naming System

AENS is part of the æternity protocol, not an application-level registry contract. A `.chain`
name is an on-chain object (`nm_…`) owned by an account, carrying a set of pointers and an
Expand Down Expand Up @@ -31,7 +31,7 @@ Registration is two transactions in two different blocks.
as a commitment (`cm_…`). The name itself is not in this transaction, so nobody watching the
mempool learns what you are claiming.
2. **Claim.** In a *later* block, publish the name and the salt. The protocol recomputes the
hash, matches it against your commitment, and awards the name — or opens an auction.
hash, matches it against your commitment, and awards the name or opens an auction.

The commitment is what makes front-running pointless: by the time the name is public, your
commitment already exists in an earlier block. Three protocol rules constrain the pair:
Expand All @@ -44,7 +44,7 @@ commitment already exists in an earlier block. Three protocol rules constrain th
it puts the name in the mempool.

The agent CLI waits for the block height to advance after the preclaim is mined, then claims,
then adds a third transaction — a `NameUpdateTx` pointing the name at your wallet:
then adds a third transaction, a `NameUpdateTx` pointing the name at your wallet:

```bash
node scripts/superhero-name.mjs available myagentname # check first
Expand Down Expand Up @@ -130,7 +130,7 @@ one rather than over the floor.

## Pointers

A name holds a list of pointers — key/value pairs mapping a label to a chain object. The one that
A name holds a list of pointers: key/value pairs mapping a label to a chain object. The one that
matters for Superhero is `account_pubkey`, which is what "this name is this wallet" means:

```js
Expand All @@ -139,7 +139,7 @@ await nameObj.update({ account_pubkey: 'ak_...' }, { extendPointers: true });

**A `NameUpdateTx` replaces the pointer set; it does not merge.** Sending one pointer wipes the
others. `extendPointers: true` makes the SDK read the current set and send it back with yours
added — always pass it on a name that already points at something.
added. Always pass it on a name that already points at something.

Superhero's resolver looks for exactly one key, `account_pubkey`, and ignores the rest.

Expand All @@ -152,7 +152,7 @@ duplicate keys and keys of at most **256 bytes**.

A name is a lease, not a purchase.

- The name's TTL is a **delta in key blocks**, not an absolute height — the name enters the
- The name's TTL is a **delta in key blocks**, not an absolute height. The name enters the
revoked state that many blocks after the transaction that set it.
- Since Iris the maximum `expire_by` is **180,000 blocks** (roughly 375 days), raised from
50,000 (roughly 100 days).
Expand Down Expand Up @@ -181,9 +181,9 @@ hosts.

## Related

- [Chain names](/identity/chain-names) — the same system from the Superhero user's side.
- [Claim a name](/getting-started/claim-name) — the in-app flow, step by step.
- [Accounts & Keys](/aeternity/accounts-and-keys) — `nm_` and `cm_` next to every other prefix.
- [Profiles](/identity/profiles) — how a resolved name becomes a display name.
- [æternity Naming System documentation](https://docs.aeternity.com/aeternity-developer-tools/protocol/utility-features/aeternity-naming-system-aens) — the official AENS overview.
- [AENS in the protocol spec](https://github.com/aeternity/protocol/blob/master/AENS.md) — the normative source for auction timeouts, commitments and pointer limits.
- [Chain names](/identity/chain-names): the same system from the Superhero user's side.
- [Claim a name](/getting-started/claim-name): the in-app flow, step by step.
- [Accounts & Keys](/aeternity/accounts-and-keys): `nm_` and `cm_` next to every other prefix.
- [Profiles](/identity/profiles): how a resolved name becomes a display name.
- [æternity Naming System documentation](https://docs.aeternity.com/aeternity-developer-tools/protocol/utility-features/aeternity-naming-system-aens): the official AENS overview.
- [AENS in the protocol spec](https://github.com/aeternity/protocol/blob/master/AENS.md): the normative source for auction timeouts, commitments and pointer limits.
24 changes: 12 additions & 12 deletions pages/aeternity/aex-standards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ description: "The æternity token standards Superhero relies on, with the AEX-9
# AEX Standards

AEX ("æternity expansion") proposals are æternity's application-layer standards, the equivalent
of Ethereum's ERCs. Superhero depends heavily on one of them — **AEX-9**, the fungible token
standard — and touches a few others through its wallet stack.
of Ethereum's ERCs. Superhero depends heavily on one of them, **AEX-9**, the fungible token
standard, and touches a few others through its wallet stack.

## AEX-9 — fungible tokens
## AEX-9: fungible tokens

Every Superhero community token and the ProtocolDAO token is an AEX-9 contract. That is why a
token you mint on Superhero shows up in any æternity wallet and on [æScan](https://aescan.io/)
without Superhero having to integrate with them.

AEX-9 is inspired by ERC-20 but deliberately smaller: the base interface is the read functions
plus `transfer`, and everything else — allowances, minting, burning, swapping — is an optional
plus `transfer`, and everything else (allowances, minting, burning, swapping) is an optional
extension. A contract advertises which extensions it implements through `aex9_extensions()`.

### The interface
Expand All @@ -31,7 +31,7 @@ Non-stateful entrypoints can be dry-run for free; stateful ones need a signed tr
| `meta_info()` | record | `name`, `symbol`, `decimals` |
| `total_supply()` | `int` | In token-decimals, not whole tokens |
| `owner()` | `address` | The minting authority |
| `balance(account)` | `option(int)` | An option, not an int — see below |
| `balance(account)` | `option(int)` | An option, not an int; see below |
| `balances()` | map | Every holder at once |
| `allowance(accounts)` | `option(int)` | Keyed on a from/for pair |
| `allowance_for_caller(from)` | `option(int)` | Convenience for the common case |
Expand Down Expand Up @@ -113,7 +113,7 @@ See [Networks & Endpoints](/aeternity/networks).
| AEX-3 | Encrypted secret storage (keystore JSON) | Active | Relevant if you import a keystore file |
| AEX-8 | Message signing | Draft | Relevant to any off-chain signature, including the tipping contract's signed messages |
| AEX-9 | Fungible tokens | Review | Used everywhere |
| AEX-10 | BIP32 derivation path for deterministic wallets | Final | Applies to any mnemonic-based æternity wallet — see [Accounts & Keys](/aeternity/accounts-and-keys) |
| AEX-10 | BIP32 derivation path for deterministic wallets | Final | Applies to any mnemonic-based æternity wallet; see [Accounts & Keys](/aeternity/accounts-and-keys) |
| AEX-130 | æpp meta-information format | Draft | Not used |
| AEX-141 | Non-fungible tokens | Review | Not used; Superhero has no NFT feature |

Expand All @@ -122,9 +122,9 @@ middleware's AEX-9 indexing are built against it as written.

## Related

- [AEX-9 contract reference](/contracts/aex9) — the Superhero-side view of the same contract.
- [AEX-9 tokens in your wallet](/wallets/aex9-tokens) — what these balances look like to a user.
- [Sophia & FATE](/aeternity/sophia-and-fate) — how to read an ACI.
- [Token sale contract](/contracts/token-sale) — what mints and burns these tokens.
- [AEX-9 specification](https://github.com/aeternity/AEXs/blob/master/AEXS/aex-9.md) — the normative standard.
- [Token standards overview](https://docs.aeternity.com/aeternity-developer-tools/token-standards) — æternity's own summary.
- [AEX-9 contract reference](/contracts/aex9): the Superhero-side view of the same contract.
- [AEX-9 tokens in your wallet](/wallets/aex9-tokens): what these balances look like to a user.
- [Sophia & FATE](/aeternity/sophia-and-fate): how to read an ACI.
- [Token sale contract](/contracts/token-sale): what mints and burns these tokens.
- [AEX-9 specification](https://github.com/aeternity/AEXs/blob/master/AEXS/aex-9.md): the normative standard.
- [Token standards overview](https://docs.aeternity.com/aeternity-developer-tools/token-standards): æternity's own summary.
Loading
Loading