diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
@@ -70,7 +70,7 @@
   virtual void commitTransaction() const = 0;
   virtual void rollbackTransaction() const = 0;
   virtual std::vector<OlmPersistSession> getOlmPersistSessionsData() const = 0;
-  virtual folly::Optional<std::string> getOlmPersistAccountData() const = 0;
+  virtual std::optional<std::string> getOlmPersistAccountData() const = 0;
   virtual void storeOlmPersistData(crypto::Persist persist) const = 0;
   virtual void setNotifyToken(std::string token) const = 0;
   virtual void clearNotifyToken() const = 0;
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
@@ -67,7 +67,7 @@
   void commitTransaction() const override;
   void rollbackTransaction() const override;
   std::vector<OlmPersistSession> getOlmPersistSessionsData() const override;
-  folly::Optional<std::string> getOlmPersistAccountData() const override;
+  std::optional<std::string> getOlmPersistAccountData() const override;
   void storeOlmPersistData(crypto::Persist persist) const override;
   void setNotifyToken(std::string token) const override;
   void clearNotifyToken() const override;
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -1176,7 +1176,7 @@
   return SQLiteQueryExecutor::getStorage().get_all<OlmPersistSession>();
 }
 
-folly::Optional<std::string>
+std::optional<std::string>
 SQLiteQueryExecutor::getOlmPersistAccountData() const {
   std::vector<OlmPersistAccount> result =
       SQLiteQueryExecutor::getStorage().get_all<OlmPersistAccount>();
@@ -1187,8 +1187,8 @@
         "Multiple records found for the olm_persist_account table");
   }
   return (result.size() == 0)
-      ? folly::none
-      : folly::Optional<std::string>(result[0].account_data);
+      ? std::nullopt
+      : std::optional<std::string>(result[0].account_data);
 }
 
 void SQLiteQueryExecutor::storeOlmPersistData(crypto::Persist persist) const {
diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -938,9 +938,9 @@
           crypto::Persist persist;
           std::string error;
           try {
-            folly::Optional<std::string> accountData =
+            std::optional<std::string> accountData =
                 DatabaseManager::getQueryExecutor().getOlmPersistAccountData();
-            if (accountData.hasValue()) {
+            if (accountData.has_value()) {
               persist.account =
                   crypto::OlmBuffer(accountData->begin(), accountData->end());
               // handle sessions data