Script escrow for Arcane MP and Kingdoms Connected
Latch team · 2026-12-05 · 5 min read
If you have written resources for FiveM, you know Cfx.re Asset Escrow: you upload a resource, it comes back encrypted, and it only starts on servers whose owners are entitled to it. MafiaHub games such as Arcane MP (Hogwarts Legacy multiplayer), Kingdoms Connected (Kingdom Come: Deliverance II multiplayer) and Mafia 2 Online attract many of the same developers. The Kingdoms Connected site openly invites FiveM server builders to bring their experience over.
What these games don't come with is an escrow system. This post looks at what Cfx escrow does, what a MafiaHub resource looks like without it, and how Latch applies the same idea to these games.
How Cfx.re Asset Escrow works
According to the Cfx documentation, a creator uploads a zipped resource on the Cfx.re Portal, where it is processed for encryption. Supported files are Lua code and the YFT, YDD and YDR model formats. Files that should stay readable go in an escrow_ignore list in fxmanifest.lua.
Distribution runs through Tebex. The creator attaches the escrowed asset to a Tebex package, and a buyer receives a download link by email. The docs state that escrowed assets can only be distributed through a Tebex package. A server that isn't entitled to the asset won't start it, and the console says "You lack the required entitlement". Subscription assets stop starting when the subscription ends.
For FiveM, this works well. Protection and purchase are one step: the buyer pays, the entitlement appears, the resource runs, and the creator never manages an access list by hand. The trade-offs are that it is tied to the Cfx.re platform, that Tebex is the only way to hand assets out, and that some parts, such as NUI, aren't covered.
What a MafiaHub resource looks like today
MafiaHub games load resources: folders in the server's resources/ directory, each with a package.json that lists its server and client scripts in a mafiahub block. The Kingdoms Connected guide Write your first resource shows the shape, and the Arcane MP scripting docs describe the same model, with Node.js APIs on the server.
The hosting and scripting docs for these games don't describe an escrow or asset-licensing service. So when you hand a resource to a server owner, you hand over readable JavaScript. Obfuscation slows a reader down, but a copied folder still runs on any server it's dropped into, and you have no way to take it back.
The same idea with Latch
Latch does the escrow part for MafiaHub resources. You upload the built resource, Latch encrypts the server code, and the package only runs on servers whose owners you granted access by account.
- Upload. Pack the resource folder as a
.zip,.raror.7zand upload it from your workspace. Your browser opens the archive and shows what will happen to each file before anything is published. - Encrypt. Server scripts and the other server
.jsand.jsonfiles are encrypted. The download contains no plain-text server code. - Grant. The server owner sends you their account ID, which looks like
LA-7K2M-9QXD. You add it on the script's Access tab. - Run. The owner extracts the package into
resources/, puts their license key in the server's env file and starts the server. The code is decrypted in memory, only on licensed servers.
The package format is the one MafiaHub already uses. Latch reads the mafiahub block, and an optional latch block does the job of escrow_ignore:
"mafiahub": {
"serverScripts": ["dist/server.js"],
"clientScripts": ["dist/client.js"],
"files": ["dist/client.js"]
},
"latch": {
"ignore": ["config.json"]
}
Here is what happens to each kind of file, from the upload docs:
| File | In the package |
|---|---|
serverScripts and other server .js/.json | Encrypted; only runs with a valid license |
clientScripts, sharedScripts, files | Sent to players by the game, so they can't be encrypted; their JavaScript is obfuscated instead |
Anything in latch.ignore | Stays readable, for example a config the owner should edit |
node_modules/, images, sounds | Stay readable |
.ts, .map | Never go into the package |
Upload the compiled JavaScript, not your src/ folder. Your source stays in your repository.
Side by side
| Question | Cfx.re Asset Escrow | Latch |
|---|---|---|
| Games | FiveM | Arcane MP, Kingdoms Connected, Mafia 2 Online, Fallout MP; also Hytale plugins |
| Protected code | Lua, plus YFT, YDD and YDR models | Server JavaScript and JSON; client JavaScript is obfuscated |
| How access is given | Buying a Tebex package | You grant an account ID, by hand or through the API |
| Store | Tebex | None; you arrange access on your own channels |
| Readable files | escrow_ignore | latch.ignore |
| Taking access back | Subscription assets stop when the subscription ends | Revoke an account; the script stops at its next check |
Where they differ
There is no checkout
Cfx escrow gives access at the moment of purchase. Latch doesn't sell anything and doesn't take part in the deal: you decide who can run your script, however you arrange that, and then grant access. On Pro and above you can script the grant step with the CLI or API instead of clicking:
npx -y @heylatch/cli@latest grant my-resource LA-7K2M-9QXD
npx -y @heylatch/cli@latest revoke my-resource LA-7K2M-9QXD
Access stays in your hands
Access belongs to the owner's account, not to one server. When you revoke it, the script stops on all of that account's servers at the next verification, and the server itself keeps running. See granting and revoking access.
One key per server
Owners run each server with a license key. Every account gets one key free, and a key runs on one server at a time. If the same key starts on a second server, scripts won't open there and the attempt is flagged on your script's page.
Leaks can be traced
Every package an owner downloads carries an invisible mark linked to their account. If a copy leaks, the Latch team can tell you which account's package it came from, and you can revoke that account. The leaks page covers the steps.
Client code is visible in both
Anything the game sends to players runs on their machines. Cfx escrow doesn't cover NUI, and on MafiaHub the client scripts and files can't be encrypted either. Keep the logic you care about on the server side.
What neither can promise
No protection for code that runs on someone else's machine is complete. A determined person with full control of the server may still pull code out of memory. What escrow-style protection does is stop unlicensed use and make reaching the source impractical. The How protection works page says the same.
What it costs
Latch takes no cut, because it isn't part of the sale. Developers choose a monthly plan per workspace: Free covers one script from the dashboard, and paid plans add more scripts, team members, the API and CLI, and Explore listings. Protection is the same on every plan, and you can grant access to unlimited accounts. Server owners get one key free and pay monthly only for extra keys. Details are on the pricing page.
If you already ship resources for Arcane MP or Kingdoms Connected, the quickest way to see how this fits is to upload one on the Free plan and look at the preview. The upload guide walks through packaging, and the protection page explains the model in plain terms.