| g1bridge | ||
| .gitignore | ||
| init.lua | ||
| LICENSE | ||
| mod.conf | ||
| README.md | ||
Ğ1 <-> Luanti bridge
Luanti mod to exchange in-game currency with libre currency (Ğ1 blockchain).
Luanti server has a dedicated account. Players transfer money on it and the server gives them a corresponding amount of in-game banknotes. They can then do whatever they want with the banknotes (trade, decorate walls, burn...). Players can ask the server to transfer their banknotes to an account of their choice using a chat command.
It works with Ğ1v2 which is still in development/testing phase.
Install
Put this repo in the mods directory.
Add g1_bridge to secure.http_mods.
Have a local Duniter node.
  cargo build --release
  ./target/release/g1bridge -l -d /path/to/database -s ../sk
- skcontains the server's secret key- Without -l, use Substrate formats.
- With -l, use legacy Ğ1 format on 2 lines (one password per line).
 
- Without 
- databaseis the directory where the bridge will save its database. It is used to store debts in case of failure of a transfer.
ToDo
- Blockchain-to-game transfers
- Ensure all transfers are failproof (any communication, storage medium, server or whatever should be able to fail or rollback to a previous state, without causing double spend or money loss)
- Force reception account to exist
- Nice ATM-like interface
- Accept mixed values (other banknotes values than 1)
Workflow
game -> blockchain
- Player issues command /g1_send <amount> <address>
- Mod takes currency from inventory and saves the debt in storage.
- Mod sends /send/<address>/<amount>to bridge.
- If bridge responds immediately, clean the debt.
- Else, retry later.
blockchain -> game
- bridge listens to events
- on reception event, bridge stores debt
- Player issues command /g1_claim
- Mod sends /claim/<player>to bridge
- Bridge answers an amount and clears debt
- Mod stores debt
- Mod tries to give player MG
- What does not fit is kept in debt. What does fit is removed from debt.
License
GNU AGPL v3, CopyLeft 2025 Pascal Engélibert (why copyleft?)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.