Upgrade to Pro — share decks privately, control downloads, hide ads and more …

メルコイン決済基盤の実践話 / Implementing the Mercoin Payment Platform

mercari
October 14, 2023

メルコイン決済基盤の実践話 / Implementing the Mercoin Payment Platform

メルコインの暗号資産ビジネスを支えるために、既存のメルペイの決済基盤の開発経験を活用し、決済基盤を再設計・開発しました。
本セッションでは、メルコイン決済基盤の構成や各ドメインコンポーネントの紹介、技術的な進化ポイントについて、詳しくご説明します。

In order to support Mercoin’s cryptoasset business, our members leveraged their development experience of working on the existing Merpay payment platform to redesign and develop the Mercoin payment platform.
In this session, we’ll share the configuration of the Mercoin payment platform and each domain component and explain the relevant technical development points in detail.

------
Merpay & Mercoin Tech Fest 2023は3日間のオンライン技術カンファレンスです。
IT企業で働くソフトウェアエンジニアおよびメルペイ・メルコインの技術スタックに興味がある方々を対象に2023年8月22日(火)、23日(水)、24日(木)の3日間、開催します。 Merpay & Mercoin Tech Fest は事業との関わりから技術への興味を深め、プロダクトやサービスを支えるエンジニアリングを知ることができるお祭りです。

今年のテーマは「Unleash Fintech」。 メルペイ・メルコインのこれまでの技術的な取り組みはもちろん、メルカリグループのFintech事業における新たな挑戦をお伝えします。 セッションでは事業を支える組織・技術・課題などへの試行錯誤やアプローチなど多面的にご紹介予定です。

メルペイ・メルコインが今後どのようにUnleash(解放)していくのか、ぜひ見に来てください。

■イベント関連情報
- 公式ウェブサイト:https://events.merpay.com/techfest-2023/
- 申し込みページ:https://mercari.connpass.com/event/286670/
- Twitterハッシュタグ: #MerpayMercoinTechFest
■リンク集
- メルカリ・メルペイイベント一覧:https://mercari.connpass.com/
- メルカリキャリアサイト:https://careers.mercari.com/
- メルカリエンジニアリングブログ:https://engineering.mercari.com/blog/
- メルカリエンジニア向けTwitterアカウント:https://twitter.com/mercaridevjp
- 株式会社メルペイ:https://jp.merpay.com/

mercari

October 14, 2023
Tweet

More Decks by mercari

Other Decks in Technology

Transcript

  1. Junwei Liang / @foghost 2016年11月メルカリ入社、メルペイ立ち上げ時期か ら、 決済基盤の開発に携わってきた。 現在、Engineering HeadとしてValue Circulation

    Platformチームでメルカリグループの各事業を支える ためのビジネス基盤サービスの開発・運用を担当して いる。 株式会社メルペイ Engineering Head of Value Circulation Platform
  2. Vision of Value Circulation Platform Provide a foundation as a

    product that is the best choice for product teams プロダクトチームにとってベストチョイスの基盤 をプロダクトとして提供する
  3. Payment Platform Overview 決済処理 メルペイ 各種決済 台帳管理 帳簿管理 Product Services

    Foundation / Value Circulation Platform メルカリフリマ External Services 暗号資産取引 サービス Mercoin Payment Platform メルカリShops Merpay Payment Platform 決済処理 精算 台帳管理 外部接続 銀行 パートナーさま クレカなどの GW業者さま
  4. お客さまの口座 ¥ Trading Funds Account (JPY) 取引口座 B Crypto Account

    (BTC) 暗号資産口座 Mercoin Accounts Merpay Accounts Points Account メルカリポイント口座 P ¥ Funds Account メルペイ資金移動口座
  5. 台帳への記帳方法 - 単式 決済サービス 台帳サービス - 1000円 メルカリポイント Point Account

    メルカリポイント口座 P +2000円分 = ? + ? 暗号資産(BTC)残高 - 1000円 取引口座残高 ¥ Trading Funds Account (JPY) 取引口座 B Crypto Account (BTC) 暗号資産口座 メルペイ 決済サービス
  6. +1000円分 暗号資産(BTC)残高 台帳への記帳方法 - 複式 決済サービス 台帳サービス - 1000円 メルカリポイント

    - 1000円 取引口座残高 -1000円分 メルカリポイント預かり金 +1000円分 暗号資産(BTC)残高 ¥ B Trading Funds Account (JPY) 取引口座 Crypto Account (BTC) 暗号資産口座 Point Account メルカリポイント口座 P メルペイ 決済サービス
  7. Exchange Account (Source) 取引口座 Account (Target) 暗号資産口座 AccountLog AccountSnapshot AccountItem

    AccountItemLog - 1000円 取引口座残高 +1000円分 暗号資産(BTC)残高 AccountLog AccountSnapshot AccountItem AccountItemLog メルコイン台帳サービス(複式記帳) Transaction Layer Account Layer
  8. 記帳用で実体がない口座 ¥ Deposit Account 預かり金口座 (メルカリポイント) Internal Accounts ¥ Deposit

    Account 預かり金口座 (メルペイ残高) ¥ 〇〇 Account 〇〇 費用負担口座
  9. Configurable Value Account ¥ Trading Funds Account 取引口座 B Crypto

    Account 暗号資産口座 ¥ Deposit Account 預かり金口座 レート追跡あり Log Only 有効期限なし 自動作成しない 自動作成 属性 挙動 ? New Account 新しい口座種別 Log Only Configurable attributes with less code to support new account 有効期限なし
  10. 価値交換(Exchange) API お客さま お客さま ¥ B 仮処理 CreateExchange 各種口座 (N)

    仮売上 状態 確定処理 CaptureExchange P ¥ B ある口座 (1) ¥ 即時確定 CreateExchange (capture=true)
  11. BTC購入 お客さま お客さま ¥ 仮処理 CreateExchange 取引口座 仮売上 状態 確定処理

    CaptureExchange P B 暗号資産(BTC)口座 メルカリポイント口座
  12. Orchestration-based Saga with Workflow SDK Activity: 決済データ保存 wf.Activity(PrepareExchange, req).Execute(ctx) Activity:

    取引残高消費 wf.Activity(PayFunds, 1000).Execute(ctx) Activity: メルカリポイント決済 wf.Activity(PayPoint, 500).Execute(ctx) Activity: 決済結果保存 wf.Activity(Update, id).Execute(ctx) Activity: 決済通知 wf.Activity(Notify, id).Execute(ctx) Activity 取引残高消費取消 Activity メルカリポイント決済取消 補償処理 wf.Workflow(CreateAndAuthExchange, request).Execute(ctx) Compensate Compensate
  13. マイクロサービスを跨いだ整合性担保 決済処理 サービス 台帳管理 サービス メルペイ決済基盤 暗号資産取引 サービス call merpay

    API BFF Service ProcessingTracer Distributed Processing Tracing Single Source of Truth for confirming the final results across multiple services Processing Participant Services Consistency Reports 取引リクエスト call API with ProcessingID call API with ProcessingID 1. RegisterProcessing 2. Participant Notification 4. ConsistencyReport ConsistencyReport 3. Reconcile Reconcile Reconcile 帳簿管理 サービス Reconcile call API with ProcessingID
  14. 帳簿 と 台帳の定義の違い (独自) • 台帳 ◦ プロダクトサイド向けにお客さまが持ってる口座の価値の増減、移 動の管理をやってるのが台帳と定義する •

    帳簿 ◦ それ以外の目的で、お金の変動、流れを記録するものを帳簿と定 義する ◦ 会計帳簿: 会計処理するための帳簿データ ◦ 法定帳簿: 法定要件に定められている帳簿データ どちらも取引におけるお金の変動、流れを記録するため
  15. 会計帳簿連携 - メルペイ 決済サービス 台帳サービス 会計サービス 外部接続 サービス QR決済 決済リクエスト

    会計イベント 会計イベント 会計イベント 単式記帳 口座操作・記帳 リクエスト 外部決済 リクエスト
  16. 会計帳簿連携 - メルコイン 決済サービス 台帳サービス 帳簿サービス (会計帳簿) メルペイ サービス 暗号資産取引

    サービス 取引リクエスト 複式記帳 口座操作・記帳 リクエスト メルペイ決済 リクエスト 会計イベント
  17. 法定帳簿 メルコイン 決済サービス 台帳サービス 帳簿サービス (法定帳簿) メルペイ サービス 暗号資産取引 サービス

    決済リクエスト 複式記帳 口座操作・記帳 リクエスト メルペイ決済 リクエスト 注文データ 台帳データ