CityCoin contract functions related to activation and registration.


The launch of a CityCoin happens in a three-step process:

  1. The contract for a CityCoin is deployed mainnet on the Stacks blockchain

  2. The auth contract is initialized (a one-time function to set everything up)

  3. 20 unique wallets send a transaction to the contract signaling activation

Once the threshold is met, a 150 block (~24hr) countdown begins after which anyone is eligible to try and mine the CityCoins within a given Stacks block.

There are no CityCoins issued or distributed prior to the start of mining.


Registration happens by calling the register-user function in the CityCoin contract, which can be done with the Stacks Web Wallet through an interface like

An example of the code used in the CityCoins UI can be found in the RegisterUser component on GitHub.

A nominal transaction fee is required in order to send this transaction, paid in STX, and you can optionally include a memo of up to 50 characters that will be recorded on-chain.

Once the threshold is reached, the register-user function will:

  • calculate the activation block height + the activation delay

  • set the core as active in the core contract map in auth

  • set the token as active and set the coinbase amounts and coinbase thresholds

    (based on the activation block height)

  • set the coinbase amounts and thresholds in core to match that of token



Type: Read-only Function

Success: (ok (var-get activationBlock)) returned as a uint


Returns the Stacks block height at which the city was activated, or an error if not.


Type: Read-only Function

Returns: (var-get activation-delay) as a uint

Returns the activation delay for mining and stacking to become available.


Type: Read-only Function

Returns: (var-get activationReached) as a boolean

Returns the activation status of the contract.


Type: Read-only Function

Returns: (var-get activationTarget) as a uint

Returns the activation target of the contract, which is the block mining and stacking will become available.


Type: Read-only Function

Returns: (var-get activationThreshold) as uint

Returns the number of users required to register for activation of the contract.


Type: Read-only Function

Returns: (var-get usersNonce) as uint

Returns the total number of registered users in the contract, including those registered after activation occurs.


Type: Read-only Function

Input: user as principal

Returns: (some uint) OR (none)

Returns the user ID of a given principal.


Type: Read-only Function

Input: userId as uint

Returns: (some principal) OR (none)

Returns the principal of a given user ID.


Type: Public Function

Inputs: optional memo as string-utf8, length 50

Success: (ok true)




Registration occurs through calling the register-user function in the contract, which optionally accepts up to 50 characters as a memo to record on-chain.

Last updated