Docs

Contracts

You write ordinary Solidity. The source uses address, uint256, msg.sender, and block.chainid. There is no Kalyx keyword, no Kalyx type, and no extra pragma. What you set by hand is the instruction set, the way an address is shown, and the wallet that signs the deploy.

A familiar compiler is not proof the chain accepted the bytecode. The proof is a small contract deployed from the Kalyx wallet, then called again from that same page.

The language

A contract is one file. The wallet’s Write tab and the Contracts page both compile that file in the browser. An import line has nowhere to go. Paste the whole contract into the file.

Use a pragma the loaded compiler accepts. The wallet’s Write tab loads Solidity 0.8.26, so its sample says pragma solidity 0.8.26. The Contracts page loads Solidity 0.8.38. pragma solidity ^0.8.20 compiles on both. The compiler is a separate program and stays under its own license.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Box {
    uint256 public value;

    function store(uint256 next) external {
        value = next;
    }
}

value() is the getter Solidity writes for a public variable. store changes that variable. Deploy this, call store, then read value. That is the first proof.

An NFT is the same kind of contract

A token that has one owner, including an NFT, is ordinary Solidity. Mint, transfer, and the owner read use msg.sender, storage, and logs. They do not need a special Kalyx type. Compile it for London, the same setting as the box above, so the bytecode does not use PUSH0.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Badge {
    mapping(uint256 => address) public ownerOf;
    uint256 public nextId;

    function mint() external returns (uint256 id) {
        id = nextId;
        nextId = id + 1;
        ownerOf[id] = msg.sender;
    }

    function transfer(address to, uint256 id) external {
        require(ownerOf[id] == msg.sender, "not owner");
        require(to != address(0), "no recipient");
        ownerOf[id] = to;
    }
}

The new contract’s address is shown as KAL. Inside the source, address is still the 20 bytes. This wallet signs the transaction. It does not sign a separate message, so a permit function that asks for a second signature will not get one from this wallet. Mint and transfer do not need that second signature.

To take a badge out of circulation, transfer it to KAL000000000000000000000000000000000000dEaD. That address has no key. The same call works for any token that lets the owner move it to an ordinary address.

The instruction set

Set the compiler’s EVM version to London. The wallet’s Write tab does this for you. Solidity 0.8.20 and later will emit the PUSH0 opcode when the version is left on the compiler’s newer default. These pages do not emit PUSH0.

The Contracts page targets Paris. Paris adds no opcode after London, so that bytecode also has no PUSH0. Shanghai and anything newer are outside what these pages produce.

A constructor with arguments can be filled in on the Contracts page. The wallet’s Write tab cannot publish a constructor that takes arguments. Give that contract an empty constructor, or deploy it from Contracts.

The Write tab refuses bytecode over 24,000 bytes. The wallet refuses contract data over 60,000 bytes. Stay inside the smaller limit when you use Write.

Addresses

An account inside the contract is 20 bytes. Solidity’s address is that width. The explorer and the wallet show the same 20 bytes as KAL and 40 hex characters. You do not put the letters KAL in the source. A function argument of type address is those 20 bytes. The Contracts page accepts a KAL address in the form and passes the 20 bytes to the call.

msg.sender is the spending account that sent the transaction. block.chainid on this testnet is 21520. One KALYX is 1018 of the integer in msg.value. The account page is the rule for the KAL label. The transaction page is the rule for the integer.

The transaction

A deploy is a type 0x2 transaction on chain 21520. It has bytecode and no recipient. A call that changes state is the same type, with the contract’s KAL address as the recipient and the function data in the data field. The fee page is how the base fee burns and the tip is paid.

The spending account signs with ML-DSA-87 from the 51-byte seed. A deploy does not spend a leaf. A call that changes state does not spend a leaf. Each one uses the next nonce. A read does not sign and does not move the nonce. Two copies of the same wallet that both sign the same nonce will have one transaction accepted. The account page is that rule. The build page is the RPC.

The Kalyx Wallet extension is the signer, and so is the page wallet. Both answer on chain 21520. Neither signs an arbitrary message, so a contract that expects a separate message signature will not receive one. Permit will not work. The transaction signature is the account’s signature. msg.sender is how the contract sees who sent it. The Android app, package si.kalyx.wallet, is the same kind of spending key on a phone. The wallet page covers all three.

Deploy it

  1. Open the wallet and create a spending account, or open one you already saved. Get a little public KALYX from the faucet so the fee can be paid.
  2. Open Contracts on the testnet. Connect the wallet. Compile Box. The page asks the wallet to sign a deploy with ML-DSA-87 before you confirm.
  3. Confirm in the wallet. Wait for the receipt. The new address is shown as KAL. Open it on the explorer. The explorer stores the code bytes.
  4. Call store with a number. That is a second transaction and the next nonce. Then press Read on value. The number you stored should come back. A read does not sign.

The same deploy can start on the wallet. Choose Write, compile, then Contract, and publish. Choose Call afterward. Read asks a question. Send call spends one signature. Paste call data as hex. The Contracts page builds that data from the function’s arguments, including a KAL address.

What one successful deploy proves

A stored number proves this chain accepted that bytecode and ran those two calls. It does not prove every opcode. It does not prove ecrecover or any other elliptic-curve helper. This account does not sign with an elliptic curve, so those helpers are not how a spending account authorizes a transaction. Leave them out until a contract that calls one has been deployed and the call has succeeded.

The public node does not offer execution traces. There is no step-through debugger to attach. The receipt and the logs are the record. The explorer does not check your source against the bytecode. The code bytes on the address page are the code that ran.