Skip to content

Custom Distribution

Use custom distribution links to offload bandwidth from Greenfield and control your delivery setup. Links are stored on-chain and resolved by the Open Store App before installation.

Supported variables for templating each distribution link:

VariableTypeDescriptionExample
$hex stringOn-chain object id reference0x0000000000ffaa11
$stringArtifact version namev0.0.1
$integerNumeric artifact version code321
$hex stringBLAKE3 file checksuma3b4…9f

Example template:

https://cdn.example.com/apps/${VERSION_CODE}/app-${VERSION_NAME}-${REF_ID}.apk?blake3=${CHECKSUM}

Example expansion

JavaScript/TypeScript

javascript
const url = template
  .replace("${VERSION_CODE}", String(artifact.versionCode))
  .replace("${VERSION_NAME}", artifact.versionName || "")
  .replace("${REF_ID}", artifact.refId)
  .replace("${CHECKSUM}", artifact.checksum)

Kotlin

kotlin
val url = template
  .replace("${VERSION_CODE}", artifact.versionCode.toString())
  .replace("${VERSION_NAME}", artifact.versionName.orEmpty())
  .replace("${REF_ID}", artifact.refId)
  .replace("${CHECKSUM}", artifact.checksum)
  • Before installation, the app retrieves distribution links for the latest artifact directly from the blockchain.
  • It attempts the links in order until one works. Some links may be blocked in specific countries.
  • If none work, it falls back to downloading from Greenfield.

Auth and rate limiting

  • Distribution currently does not support any auth mechanism.
  • Use public links. Rate limiting and protection features are planned for later.

Requirements

  • No protocol or vendor requirements. You can use any distribution system (CDN, HTTP(S) servers, Web3 storage, etc.).

Notes for publishers

  • Provide multiple redundant links for regional reliability.
  • Ensure the file content matches the on-chain checksum; the app validates it locally before install.

Released under the MIT License.