When creating our application (SarmatiaMundi), I set myself (and AI Cloud Code) the goal of doing everything that is possible directly on the blockchain, so that no system function — as far as it is feasible — is taken off the blockchain onto our own server or an external database.
Why?
First — security. Having all content on the blockchain ensures data integrity regardless of whether my server survives or not. It also provides security against unwanted or dishonest interference with the content.
Second — universality and decentralization. If everything is based on content posting to the blockchain, the user will be able to freely choose which application they want to view that content on. Referring to the topic of this post, there is currently no universally functioning, sensible system for chat and private messaging. When using chat on , I cannot check the replies on @ecency...etc. only integration is between discord and openhive chat... So we did something that can change that.
For reference, here is a list of the work done so far on SarmatiaMundi:
What’s next? Check the roadmap
Chat
Following the above principle, we have built our chat on the same principle as snaps, etc. We therefore have anchor posts, and chat messages are comments to that post. To give the impression of a live chat, the chat window refreshes every 8 seconds (this can even be reduced, because the amazing Hive technology gives us a new block every 3 seconds!). From what I have tested, the experience is good and smooth. Thanks to the Hive infrastructure, we can also have replies to messages. On our skin it looks like this:
The Admin Panel allows us to build the entire infrastructure of various rooms, including defining whether a given room should be displayed only in a selected language or in all languages. This is what it looks like from the admin side:
So we have, I believe, a fully configurable chat, also with a moderation option (limited, obviously, to the frontend). The construction allows free adaptation in other frontends so that selected chats are available everywhere and communication can take place this way regardless of the user’s favorite frontend. I believe this solution has no drawbacks, as long as we are aware that this is a public chat. I invite you to discuss :) and to adopt!
Private (Direct) Messages
Communication systems essentially consist of three parts: public chats (discussed above), private group chats (multiple people, but only selected ones, encrypted — not yet developed by us) and direct private messages. The latter are actually already implemented in the blockchain system. They are transfers with a memo marked with #. The only two problems are: the lack of any separation from other transfers, and the cost — for each message you have to send someone 0.001 Hive. This means that at the current price, for 6 cents we can send “only” a thousand messages. In reality, therefore, it is not a cost at all. Nevertheless, the necessity for new users to have even 1 Hive in their account may be problematic.
How did we solve this?
We created a transparent message inbox that only receives transfers of 0.001 Hive tagged with #, so almost certainly only the proper messages will end up there.
As for payment for messages, we created a mechanism that, under certain conditions, funds the sending of messages through sarmatia.app. We set the conditions in the admin panel by defining a token (instead of liquid Hive) that the user must hold to be able to use sponsored messages (e.g. we decide that the user must have 100 LEO staked to be able to send 5 sponsored messages per day). Technically, it works like this: when sending a message, the system checks whether the user has Hive; if they do, it approves the transaction immediately. If not, the system checks whether they meet the conditions; if they do, a transfer is ordered from the application’s account to the user, and as soon as the system detects that the funds have arrived, it sends an action for confirmation via Keychain. Unfortunately, this makes the whole process take a dozen or so seconds, but it is a solution that is excellent in every other respect. I invite you to discuss ;)
Oh, and how does this help new users?
First of all, the assumption is that our users will want to immediately enter the game as well, so they will acquire the required token basically at the start.
Secondly, I plan to allow new users to apply for a one-time allowance. As part of it, they would receive, for example, 1 Hive and a bit of delegated HP. I believe, therefore, that no one will have a major problem using the DM system. I also think that, looking at how much we spend in DHF on various things, it wouldn’t be a big issue for every new user to receive, for example, 1 Hive at the beginning and a little delegation... it can be automated!
Otwarty Czat i Prywatne wiadomości w 100% na blokchainie
Tworząc naszą aplikację (sarmatiamundi) postawiłem sobie (i AI Cloude Code) za zadanie, aby wszystko co tylko się da robić bezpośrednio na blokchainie, aby żadnej funkcji systemu o ile będzie to możliwe nie wynosić poza blokchain na swój serwer czy do zewnętrznej bazy danych.
Dlaczego?
Po pierwsze - bezpieczeństwo, ponieważ całość treści na blokchainie daje pewność integralności danych niezależnie od tego czy mój serwer przetrwa czy nie. Daje też bezpieczbezpieczeństwo przed niepożądaną albo nieuczciwa ingerencja w treści.
Po drugie - uniwersalność i decentralizacja. Jeśli wszystko będzie oparte o zamieszczanie treści na blokchainie, to użytkownik będzie mógł swobodnie wybierać na której aplikacji przeglądać dane treści. Odnosząc się do tematu postu, nie ma dziś funkcjonujacego uniwersalnie, sensownego systemu czatu i prywatnych wiadomości. Używając czatu na , nie sprawdzę odpowiedzi na
...
Dla przypomnienia spis dotychczasowych prac nad sarmatiamundi:
Onboarding
Filtrowanie treści
Co dalej? sprawdź mapę
Czat
Przyjmując powyższą zasadę, zbudowaliśmy nasz czat na tej samej zasadzie, na której są zbudowane snapsy itd. Mamy więc post kotwice, i wypowiedzi na czacie są komentarzami do tego posta. Żebyśmy mieli wrażenie że to czat na żywo, okienko czatu odświeża się co 8s (można to nawet zmniejszyć bo niesamowta technologia Hive daje nam nowy blok co 3 sekundy!). Na ile przetestowałem wrażenie jest dobre, płynne. Dzięki infrastrukturze hive możemy też mieć odpowiedzi do wypowiedzi. Na naszej skórce wygląda to tak:
Panel Admina pozwala nam zbudować całą infrastrukturę różnych pokoi, w tym zdefiniować czy danych pokój ma się wyświetlać tylko w wybranym języku czy we wszystkich, wygląda to tak od strony admina:
Mamy więc w pełni jak sądzę konfigurowalny czat, również z opcją moderacji (ograniczonej do co jasne frontendu). Konstrukcja pozwala na swobodną adaptacje w innych frontendach tak aby wybrane czaty były dostępne wszędzie i można było się tym sposobem komunikować niezależnie od ulubionego frontendu. Uważam, że to rozwiązanie nie ma wad, o ile będziemy mieli świadomość, że jest to czat publiczny. Zapraszam do dyskusji :)
Wiadomości prywatne (bezpośrednie)
Systemy komunikacji składają się zasadniczo z trzech działów: publiczne czaty (omówione wyżej), czaty prywatne (wiele osób, ale tylko wybranych, szydrowane - jeszcze u nas nie opracowane) i beposrednie wiadomości prywatne. Te ostatnie tak naprawdę są wdrożone w systemie blokchaina. To transfery z memo okraszonym #. Jedyne 2 problemy to nie oddzielenie tego w żaden sposób od innych przelewów, oraz koszt, przy każdej wiadomości trzeba wysłać komuś 0,001 hive. Oznacza to przy obecnej cenie, że za 6 centów możemy wysłać "tylko" tysiąc wiadomości. Realnie więc nie jest to żaden koszt. Niemniej konieczność posiadania przez nowych graczy nawet 1 hive na koncie może być kłopotliwe.
Jak to rozwiązaliśmy?
Stworzyliśmy przejrzystą skrzynkę wiadomości do której trafiają tylko przelewy na 0,001 hive opatrzone #, więc prawie napewno znajdą się tam tylko właściwe wiadomości.
Jeśli zaś chodzi o płatność za wiadomości to stworzyliśmy mechanizm, który pod ustalonymi warunkami finansuje przez sarmatia.app wysłanie wiadomości. Warunki ustawiamy w panelu admina ustalając token zamiast płynnego hive który musi posiadać uzytkownik by móc korzystać ze sponsorowanych wiadomości (np ustalamy, że musi zastackowane 100 LEO, żeby móc wysłać dziennie 5 sponsorowanych wiadomości. Technicznie wygląda to tak, że wysyłając wiadomość system sprawdza czy użytkownik ma hive, jeśli ma to zatwierdza transakcję i już. Jeśli nie ma to system sprawdza czy spełnienia warunki, jeśli spełnia, to jest zlecany przelew z konta aplikacji do użytkownika i jak tylko system zauważy, że środki się pojawiły wysyła akcję do potwierdzenia przez keychain. Niestety przez to caly proces trwa kilkanaście sekund, ale to rozwiązanie, które pod każdym innym względem jest ekstra. Zapraszam do dyskusji ;)
Aha, jak to pomoże nowym użytkownikom?
Po pierwsze założeniem jest, że nasi użytkownicy będą chcieli od razu wejść również do gry, więc zdobędą wymagany token w zasadzie na starcie.
Po drugie, planuje aby nowi użytkownicy mogli aplikować o jednorazową zapomogę. W ramach której dostali by np 1 Hive i trochę delegowanego HP. Sądzę więc że nikt nie będzie miał większego problemu z korzystaniem z systemu DM. Sądzę też, że nie byłoby dużym problemem, patrząc ile wydajemy w DHF na różne rzeczy, aby każdy nowy użytkownik dostawał np 1 hive na początek i odrobinę delegacji... to można zautomatyzować!