Skip to content

Instantly share code, notes, and snippets.

View 0xk2's full-sized avatar
🎯
Focusing

Bui Trung Hieu 0xk2

🎯
Focusing
View GitHub Profile
@0xk2
0xk2 / SKILL.md
Created February 15, 2026 15:30
solana-ecosystem-watch skill + source-map
name solana-ecosystem-watch
description Track and summarize Solana ecosystem updates from curated X accounts, official sites, event announcements, and DeFi/investor/KOL sources. Use when the user asks for Solana news briefs, latest tweets (non-reply with optional reposts/quotes), sentiment snapshots, event involvement, or ecosystem intelligence updates.

Solana Ecosystem Watch

Use this workflow to produce consistent Solana intelligence updates.

Output modes

@0xk2
0xk2 / redis-fanout.md
Last active February 16, 2026 02:25
Redis fanout for bot→bot analyst (Telegram ↔ Redis Streams ↔ OpenClaw)

Redis fanout for bot → bot analyst (Telegram ↔ Redis Streams ↔ OpenClaw)

  • Use Redis Streams as the bus:
    • tg:in stream: every inbound update (message, edited, callback, etc.)
    • tg:out stream: outbound sends (what your bot is about to send)
    • optional tg:events for normalized events if you want a cleaner contract
  • Dual-write / send-proxy (critical):
    • Wrap every sendMessage / editMessage call with a proxy that first appends to tg:out (or appends + then sends).
    • Reason: you cannot reliably “observe” bot outputs from Telegram itself (no bot→bot delivery guarantee; also you’ll miss edits/deletes unless you track them).
  • Routing: derive an OpenClaw sessionKey from (chat_id, thread_id) (and maybe user_id if you want per-user sessions). Put it on every event.
@0xk2
0xk2 / redis-fanout.md
Created February 14, 2026 15:38
Redis fanout for bot→bot analyst (Telegram ↔ Redis Streams ↔ OpenClaw)

Redis fanout for bot → bot analyst (Telegram ↔ Redis Streams ↔ OpenClaw)

  • Don’t do MTProto “user” listeners for Telegram (ban/ToS risk). Treat Telegram as: inbound via bot webhook, outbound via bot send API.
  • Use Redis Streams as the bus:
    • tg:in stream: every inbound update (message, edited, callback, etc.)
    • tg:out stream: outbound sends (what your bot is about to send)
    • optional tg:events for normalized events if you want a cleaner contract
  • Dual-write / send-proxy (critical):
    • Wrap every sendMessage / editMessage call with a proxy that first appends to tg:out (or appends + then sends).
  • Reason: you cannot reliably “observe” bot outputs from Telegram itself (no bot→bot delivery guarantee; also you’ll miss edits/deletes unless you track them).

Core concept Solana <> Ethereum

  • Transaction <> Instruction
Ethereum: Transaction = {SmartContract address, input, caller, gassfee}

Solana: Transaction = {payer, gassfee, instructions: [
 {SmartContract address, input, caller}
]}

Create new project

cd new_project

yarn init

yarn add --dev hardhat

npx hardhat
@0xk2
0xk2 / tokenomics_businessmodel.md
Last active June 22, 2022 05:48
web3 tokenomics <> web2 business model

What are the things that both web2 and web3 are looking for?

web2

In web2, we design business model of which growth ensure sustainability. It means that the more people/parties involve in your product, the better it will be and attract more people. There are few notable examples:

  • Social network: people use it then they want their friends (Facebook, Instagram, Snapchat) and family (Messenger, Zalo, Wechat, Whatsapp, Telegram) use it so they can socialize. Incentives to all parties are the same non-value type. The money-hunter will come later not as value contributors but value extractors (advertiser, retailers).
  • Marketplace effect: the more people use it then service creator will come (to reduce acquisition cost, to get more attraction) which attract more people use it. Incentives to all parties do not fall to the same category. Service providers come for money and users come for non-money value (convinient, diversity-of-choice, etc.)
    • Writting: long writing such as Blog, Medium; short writing such
@0xk2
0xk2 / gtm.md
Created June 9, 2022 04:50
Crypto Go To Market Plan

Web3 GTM sequence: Price -> Interest -> Idea -> Product

We should communicate to the community that our Product at launch date as an influence to the community to make changes rather than a fixed thing. However, the vision is clear and the vision is everything we started.

At the first, people will come for profit and our job is to convert as much Degen (D) into Investor/User (U) as possible

# T+1W T+2W T+3W T+4W T+5W
Week 1 0.9D+0.1U 0.7D+0.2U 0.5D+0.3U 0.4D+0.3U 0.4D+0.3U
@0xk2
0xk2 / bitcoin.md
Last active January 23, 2022 22:24
Notes on blockchain

Should I write smartcontract on bitcoin?

With taproot upgrade, it would be cheaper (how cheap?) to run script on bitcoin. However, it seems obvious to me there is no need to write code on bitcoin.

If you want to write code then you will want to deploy it to a computer to execute yours. Ethereum and hundreds other similar networks are designed as Internet computer - a single-permissionless-universal-accessible-state computer.

Bitcoin is not designed to be a computer even it can run code. It is designed to store value. It make senses to make bitcoin faster and cheaper to transfer value since it enhance storing capability, then you can use one of those hundreds computer to initiate the transfer activity on bitcoin network.

If you want somewhere to store your value then bitcoin is the one, it is designed that way and there would be no other bitcoin, it is the only one.

@0xk2
0xk2 / multiplegit.md
Created January 20, 2022 02:17
How to run multiple git account from a computer?

You are working for a new company/project and you want to seperate your personal git account from the org git account? This steps can help you:

  1. Create new ssh key, save private key in ~/.ssh/{NewKey} and public key in ~/.ssh/{NewKey}.pub
  2. Login to your account
  3. Copy content from ~/.ssh/{NewKey}.pub to create new key in git account
  4. Edit ~/.ssh/config, add follwing lines
  Host {any name}
	HostName github.com
 User git
@0xk2
0xk2 / nginx.md
Last active January 20, 2022 02:06
Nginx essential

What is Nginx

Lightweight, fast & reliable http layer to access server's assets.

Usages:

  • Serve static files
  • Https layer, remove the need to implement ssl in webserver code
  • Serve multiple domains within a server

How to config? (ubuntu)