This is super useful !
A few more tools that I use regularly, if you are looking to expand:
- Base58 encoding to Hex conversion
- Hex to decimal and vice versa
- Strlen
- Compute SHA-256 of text or hex string
- Compute Keccak-256 of text or hex string
No that’s not how it works.
When a transaction is submitted on the blockchain to withdraw funds from an address it needs to be signed by the private key and it exposes the full public key. A bot that would monitor such transactions would therefore see the public key. With just the public key you can’t create a valid signature, you still need the private key, however for this particular case, knowing the public key reduces the entropy of the puzzle by a factor of 2 (from 66 bits to 33 bits), so this puzzle was easier to solve for the bot knowing the public key published by the person who found the private key. This is very specific to this specific puzzle which had 66 bits of entropy. In general, bitcoin transactions have 256 bits of entropy.
Near-zero dependency example of how to use AWS Nitro enclaves from Deno. Can serve as a code sample or a blueprint to understand the whole process, because I found the AWS documentation and process quite unclear and over-engineered. Parts of the code (the code to access the Nitro Secure Module and the HTTP Proxy that connects on a VSOCK) are written in Rust and accessed in Deno through FFI.
We run a medium sized trading system (20 microservices) in Deno for about a year now. There have been a few runtime quirks but they have currently all been ironed out. I love the approach that Deno takes with respect to permissions which allows you to strictly specify which urls your program can access, which files/directories can be read/written, etc.
You are most likely aware but just to point out, Node now also has a version of the permissions features [0] (not sure on parity but it was obviously deno inspired) behind an experimental flag!
Being able to allow custom behaviour via JS/TS in Rust is definitely something that I wanted to explore too.
If you haven’t already you should check out these two articles from the Deno blog website which go a bit further:
> Being able to allow custom behaviour via JS/TS in Rust
I understanding wanting to call out to Rust from JS/TS, but I don't think I understand wanting the reverse. Isn't a major goal of Rust not to have "custom behavior" that is invisible to the compiler?
It of course doesn't need to be a game. VBA macros in Office and AutoLISP in AutoCAD are two examples of scripting environments on large compiled applications that allows users to customize and automate behavior, outside of gaming. Hell, you can point at Emacs and vim as examples too.
Building a data ingestion pipeline that scales horizontally but leaves the ingestion rules up to your customer in the form of a ts module that implements an interface? There’s plenty of opportunities to allow your runtime to be controlled via scripting.
Or a function host that executes jobs at scale? You only need to program the security, sandboxing, scheduling, and distribution of functions that can be invoked.
Some applications use Lua for configuration: neovim, conky, awesome, etc.
I haven't looked into the details of this so I'm not sure if its a suitable replacement for embedding lua (binary size would be my first concern..does this embed v8?) But I would much prefer TypeScript as a configuration language than Lua.
Business apps can sometimes be so complicated that the decision is between having a giant settings page, where you try to anticipate everything users will want to do, or you let them write little snippets of code that you interpret on the fly. I like the latter approach a lot, because even if I have to help write the snippets, it’s easier than shoving special-case code into the project, yet again, and deploying.
SSR is the process of generating the HTML and CSS necessary to render a web page on the server side before it's sent down the wire. You can't just pipe wasm to the client to get the same effect. Besides being less efficient than JS at manipulating the DOM, the idea is that everything is already available and streamed to the client for optimal render speed.
> You can't just pipe wasm to the client to get the same effect.
I know what SSR is and you can do it[1] in Rust, where you write type-safe, compiled Rust code and send HTML/CSS/WASM to the browser. SSR was originally developed in things like Perl and PHP -- there's nothing language-specific about it.
> Besides being less efficient than JS at manipulating the DOM
Some applications manipulate DOM a lot (and WASM isn't slow enough for a well-written app to be noticeably slower to a user) and some applications do a lot of processing before changing the client. WASM will be dramatically faster at the latter.
> I know what SSR is and you can do it[1] in Rust, where you write type-safe, compiled Rust code and send HTML/CSS/WASM to the browser.
Yeah, but that way your frontend team is forced to develop in Rust, instead of develop in JS/TS. What I want to do is enable FE devs/team to do their job (writing JS/JSX) happily ignoring the server, and at the same time do SSR on the server happily ignoring how FE devs/team implemented the view.
You might notice, "ok but they need a contract to know which is the data shape that the server is going to provide to the JS/TS render() call"; yep, that's one of the challenges of what I'm trying to do :D
May I suggest the below insights to your point of view, which will allow you to have a better understanding of what is happening underneath the hood ?
USDC is issued by circle.com and the underlying assets are held on US bank accounts.
BUSD, which is Binance's USD stablecoin, is actually issued by paxos.com (see https://paxos.com/busd/) and the underlying assets are held on US bank accounts .
Binance definitely has accounts at both Circle and Paxos, that allow them to mint and redeem USDC and BUSD, by depositing or (respectively) withdrawing USD to Circle's or Paxos' bank account.
From a practical point of view, what Binance did was redeeming the USDC (by sending them back to Circle and withdrawing USD to it's bank account) and then subsequently minting BUSD (by wiring the USD to Paxos' bank account and receiving the corresponding amount of BUSD).
Binance also allows to "seamlessly" withdraw BUSD as USDC from it's exchange to your wallet.
Now you are starting to understand what happened today.
Following negative rumours, people started to massively withdraw BUSD as USDC from Binance. Binance fullfilled to first part of those withdrawal requests from it's hot wallets containing USDC, but past a certain amount it had no USDC left and temporarily halted withdrawals of USDC. A caveat to that is that Binance only halted withdrawals of USDC on the Ethereum and Tron chains. Withdrawal of USDC to Polygon and Avalanche for example have been running smooth all day, probably because less people choose those options, so there were still funds available on Binance's hot wallets on these chains.
Once the hot wallets were depleted of USDC on Ethereum and Tron, Binance could only continue to honor the withdrawal requests by converting the BUSD it held to USDC. That conversion requires to redeem the BUSD at Paxos, receiving USD on it's bank account, sending the USD to Circle, and receiving the corresponding amount of USDC. These steps involve regular wires between banks, hence why they could not be executed before the US banks opened.
That being said, the situation is now resolved and Binance has now re-enabled withdrawals of USDC.
> Almost all fiat deposits into Bitfinex create USDT.
As a matter of fact that is NOT true. (speaking as a crypto hedge fund manager, active since 2013, and trading > $1B/month on all major exchanges). It used to be like that in the past (when USD and USDT where one just represented as "USD" on Bitfinex), but this changed a year or two ago. Now, USD wires are being credited as USD and USDT deposits are being credited as USDT. And there is a USDT/USD market on Bitfinex to exchange between the two.
Why does USDC and USDT need to exist for this? What’s the benefit of not just having USD in your Coinbase/bitfinex acc if they’re meant to be pegged anyway?
Tax arbitrage, iirc. In some jurisdictions like the US, exiting your position into USD is a taxable event for capital gains taxes. I seem to recall stable coins were invented to avoid that. I can't imagine tax authorities allow that loophole though.
> Tax arbitrage, iirc. In some jurisdictions like the US, exiting your position into USD is a taxable event for capital gains taxes. I seem to recall stable coins were invented to avoid that. I can't imagine tax authorities allow that loophole though.
If they did, it looks like it's closed now. At least in the US, converting between two cryptocurrencies is a taxable event:
> There are plenty of questions about whether or not investors can claim a direct crypto conversion (e.g. bitcoin to ethereum) as "like-kind", avoiding taxes on those transactions. The tax laws changed beginning in 2018, and like-kind exchanges are only applicable to real estate transactions.
You send USDC/USDT to another exchange, use it to pay for stuff, store it in a hardware wallet, etc. USD can only be transferred back to your bank account.
Because many exchanges are in no way capable of holding a banking relationship with a legitimate bank that transacts in USD.
edit: Perhaps that was overly snarky - the issue is that the US requires legitmate banks to take certain efforts to identify their customers (KYC), and prevent money laundering (AML). Meatspace banks aren't perfect in this regard either, but many crypto exchanges are either unable or unwilling to do this, or are already proven to be engaged in fraud or other financial crimes.
No way interested and running an equivalent business with much less overhead and faster growing customer interest with higher returns, has nothing to do with crime or incompetence or imperfection
I don't fully agree with that.
- Cheaper: Well most decent banks I have been working with don't charge on USD wires, or they charge something like $20 flat, which happens to be on par or cheaper than the ethereum blockchain fees nowadays
- Faster: In my experience (in sending hundreds of wires every month), the actual "sending time" of USD wires via Fed wire or SWIFT is literally minutes, so that's on par with blockchains. Most of the time the funds are just stuck somewhere in the compliance department. The same would hold if you withdraw/deposit USDT/USDC to an exchange. Funds can still get stuck waiting for compliance approval.
- Easier: That's debatable. I guess some banking UIs are better than others. And blockchain is not particularly known to be UI/UX friendly either.
One definite advantage I could think of is that when you hold USDT/USDC in your wallet, then you have full control over them, but I bet 99% of the USDT/USDC is held on exchange, and exchanges are more and more starting to act like banks (with all the slowness that that entails).
Its like cellular service in an underground subway station: people tell you it arrived and use it and nobody thinks about it afterwards. There wont be a source about that whether you believed it or not.
> There's no way to transfer USDT into USD. The few exchanges that say they offer withdraws actually don't if you go and try.
It's perfectly possible to exchange USDT for USD and withdraw USD to your bank account; it does not involve complicated steps nor outrageous fees. Kraken, for example, has a very liquid USDT/USD market, is a well respected exchange, and processes USD withdrawals that arrive within minutes to US bank accounts. I'am speaking as an industry insider and hedge fund manager that trades ~$1B/month on the crypto markets.
It may help that we bank at all of the same banks as Kraken, so most transfers are internal transfers. But even to outside banks, normally US wires should be pretty fast (usually within the day). It may also be the case that we literally wire millions every day on a regular basis, so our wires probably don't get held up at any compliance checks.
As a start, you can check out Signature Bank and Silvergate Bank. They are known for being crypto-friendly banks, and they bank literally every exchange that trades crypto versus USD.