read.cash Log in

@BitcoinOutLoud

Joined 30 November 2019 · 5 posts

Bitcoin (a peer to peer electronic) Cash (system)

120 KT

0 KT · $29.89 received · 0 KT · $186.64 given

Posts

@BitcoinOutLoud

Announcing the Bitcoin Out Loud “Bring your BCH home” campaign + contest! With its low fees and lightning fast transactions, it’s easy to hold your own Bitcoin Cash. So why not celebrate your self-custodial superpowers this holiday season? The basic idea is pretty simple: Withdraw any BCH you have on custodial platforms by December 30th. Between now and then the plan is to make memes and give away some Bitcoin Cash! Spread the word, win BCH Memes and other creative posts to Twitter about bringing your BCH home will be considered for Bitcoin Cash prizes, awarded via @ chaintip throughout the campaign. The more we like your post, the bigger the tip! Make sure to tag your tweets with #BringYourBchHome, and mention @ BitcoinOutLoud to be considered. Good luck, and please do help spread the word! (In case you’re wondering, I am not the original creator of this idea, or the two images in this post. But I am running this campaign!)

@BitcoinOutLoud

什么是难度调整算法?我们为什么需要一种新的算法? https://youtu.be/8wFuCqkmbrw 在此视频中,我将介绍Jonathan Toomim的提议,即为2020年11月进行的BCH升级中采用新的难度调整算法。在此之前,最好先回答一个问题: 什么是难度调整算法?为什么我们需要一个新的算法呢? 首先,请记住,比特币将交易分组。仅当矿工解决“猜谜游戏”时,才会将这些区块添加到“区块链”中。请在Bitcoin.com频道上观看有关比特币的工作原理视频。 为了保持区块之间的平均时间相同,并以可预测的速率产出新币,我们需要一种系统的方法(也称为“算法”),以调整“猜谜游戏”的难度。 最初,“ DAA”非常简单。每两周或2016个区块,检查一次这2016个区块的平均时间。如果平均每个块少于十分钟,则增加难度。如果平均值更高,请降低难度。尽管此算法在大多数情况下都可以正常工作,至少在比特币拆分为BTC和BCH之前,它确实也产生你一开始不会想到的后果。 由于比特币网络上的哈希率增加的幅度远大于减少的幅度,并且难度仅每两周调整一次,因此,比特币的平均出块时间实际上一直低于10分钟。 当比特币区块链分为BTC和BCH时,事情变得更加复杂。之前,矿工只是简单地挖比特币。在分叉后,矿工就可以选择挖BTC或BCH。 因此,BCH在诞生之初几乎肯定需要一种新算法。等待2016个区块来调整难度可能会导致链死亡。如果哈希率显着下降,通常要花2周才能挖出的2016个区块可能要花两个月或更长时间。而且,如果在矿工眼中,该链变得无利可图,那么就可能因为没有人继续挖而暂停。对于多比特币生态系统而言,2016个块存在的潜在延迟太慢了。 因此,BCH采用了一种新算法,但它远非完美。这种“紧急难度算法”(或“ EDA”)的工作原理与原始算法类似,但可以检测到最近区块中哈希率较低的极端情况,这些情况会显着降低了下一个区块的难度。该算法导致难度和哈希率急剧波动。当EDA“加入”时,矿工将利用低难度的优势,在短时间内挖出许多区块,然后当难度回升而利润率回落时,他们只需离开BCH去挖BTC直到EDA再次启动。这需要很长时间,因为至少有一些矿工在这段难度高的时期以亏损的方式挖BCH。 高哈希率和低哈希率之间的这些“振荡”导致平均确认时间更长。这是因为交易更可能在区块间隔时间长时间的块中发送,而非其间发生的短时持续出块中。它们还导致平均每十分钟要挖出更多的区块,这就是BCH目前在区块和币总数方面比BTC提前一个月的原因。 不过,值得注意的是,这个问题并不是矿工的错。他们甚至不必“提前计划”或“滥用”这一问题。他们只是自然而然地根据当前哪条链更有利可图来切换他们当前的挖矿方式。我们需要构建一种逐利行为会能造福整个生态,而不会破坏它的系统。 EDA很快被另一种新算法取代,该算法是从头开始构建的,而不是修改旧的DAA,它的性能要好得多,但是仍然容易出现“振荡”。 BCH已经使用这种新的难度调整算法两年半了,它根据上个144个块的平均时间重新计算每个区块的难度。Toomim深入解释了这些振荡产生的原因,以下是精简版: 由于当前算法使用最新144个区块的简单移动平均线(SMA)来估计哈希。在一个高哈希的块离开SMA窗口后,挖矿难度降低的幅度与新区块进入该窗口增加的幅度相同。因此,离开窗口的区块会剧烈地改变挖矿难度,激励矿工重复这一离开区块的哈希。我称这种效果为“哈希回声”。值得注意的是,这些回声并不是恶意的矿工行为,而仅仅是矿工在遵循DAA给他们的直接短期激励。 这些振荡除了使确认时间过长而降低用户体验外,还使矿工在高难度时根本不挖BCH更加有利可图。如果有足够多的矿工使用这一策略,可能会由于区块完全停止而导致BCH链死亡。我们很幸运有长期对BCH进行足够投资的矿工,以亏损挖矿来保持其功能。但是我们当然不应该依赖矿工的忠诚来维持BCH的运转。 当涉及替代方案时,有几种选择。例如,实时定位算法(或称为“ RTT”)会根据上个区块以确定当前的难度。尽管这是个好主意,但对比特币的工作方式而言是一个相对较大的变化,要求矿工保持同步,这为各种潜在的问题和留下了漏洞。 当前算法的问题是数据点突然离开集合。之所以突然,是因为该算法是“简单移动平均”(SMA),其中,窗口中的每个块都具有相同的权重。 为了从根本上解决问题,我们可以减少任何给定块随着时间的增长而对当前难度产生的影响。如果我们“线性地”进行此操作,并且影响力不断减小,则会得到诸如lwma之类的算法,它代表线性加权的移动平均值,以及wt(或“加权时间”)算法家族。 另一种选择是随着区块的老化而以指数方式减小其影响,这就是EMA或“指数移动平均”算法。此类中的算法包括Jacob Eliosoff的ema-1d和simpexpt-1d,Tom Harding的wtema和Mark Lunderberg的asert。在计算当前难度时,EMA具有一些独特的优势。 我们应该怎么做才能找出最佳选择?实际上有很多。Toomim从kyuupichan的难度调整模拟中分叉出了开源软件,该软件使将不同算法的行为与其图形用户界面以及充满用户图形的界面进行比较变得更加容易。 尽管我不是这方面的专家,但模拟程序是在考虑许多重要事项的情况下制作的,例如可以选择设置“稳定”矿工的百分比,“可变矿工”的百分比(将根据获利能力来回切换部分哈希率),以及“贪婪”矿工的百分比,并根据哪条链更有利可图(假设一条链超过另一条链的3%)来切换其算力的100%。 虽然模型不完美,但仍可以帮助我们做出尽可能明智的决定。实际上,早在2017年就可以使用这些工具预测当前算法存在的潜在振荡问题。 随着时间的推移,当前的DAA振荡变得越来越严重,越来越多的矿工根据相对的获利能力切链。这些模拟的结果以及当前DAA问题的紧急性质,使我清楚地知道,在即将到来的升级中,我们绝对应该更改DAA。有几种非常优越的选择,我们只需要决定实施其中的一种。 该表显示了三种不同块窗口大小下5种算法的模拟结果。虽然所有算法的平均出块时间都非常接近600秒,但实际上其中一些具有更长的平均确认时间。这些都是SMA(或“简单移动平均”)算法。 尽管asert始终具有优势,但所有其他算法都表现良好。 该图表还显示了采用一种挖矿策略要比其他策略获利更多。再一次,其他三种算法比SMA算法好很多,他们之间三种类型挖矿的获利能力非常接近。 由于非SMA算法性能类似,因此根据其作为DAA的模拟性能以外的考虑因素在它们之间进行选择可能更为重要,诸如它们将要执行的工作量以及如何实现这些事情。它们的运行成本很高(就处理资源而言)。 Toomim将lwma和wt排除在外是因为他们“需要对窗口中的每个块标题(例如288个块)进行采样,以便计算下一个块的难度...”,剩下的wtema和asert分别需要对两个区块头进行采样。 如果你想了解这两种算法的工作原理的详细信息,请一定要阅读Toomim在read.cash上的原始文章。他认为在两者之间进行选择时最重要的有两点:首先,使用asert会导致整数近似很难。你不能使用浮点运算,因为不同的处理器在处理方式上会略有不同。其次,wtema存在奇异性问题,给定某些输入,该算法会完全失败,并且时间戳记为负,这是指某个块的时间戳早于上个块。 两种算法都需要更加复杂的方案才能解决各自的问题,但是Toomim认为,Asert问题较少,因为它不需要弄乱其他共识规则,而wtema则需要很大的负求解时间。 然后,Toomim介绍了选择整数近似方法,确定指数函数的半衰期,在“过去的中间时间”激活,测试网详细信息,潜在攻击以及如何减轻这些攻击的过程中选择基于块高度的激活。他自己的链接以获取更多信息,你应该检查所有这些链接是否感兴趣,但是为了简洁起见,在这里我将不做任何介绍。 在他的结论中,Toomim先生列出了DAA的12个理想属性,我将逐字阅读它们。 1,它应该是稳定的,并且不易产生振荡; 2,它应保持较低的确认时间; 3,降低矿工来回切算力的动机; 4,降低矿工操纵时间戳的动机。 5,降低矿工自私挖矿的动机。 6,由于#3,#4和#5,具有忠诚的矿工应该获得最大的收入; 7,在算力和/或汇率突然变化后,链应能迅速恢复; 8,平均出块间隔应接近目标(如600秒); 9,该算法在数学上应该简单而优雅; 10,该算法应易于理解和分析; 11,该算法应易于部署; 12,该算法应几乎没有边缘情况。 由开发社区的其他成员来决定是否接受这些优先级,以及是否同意asert最符合以上特征。 在结束之前,我强烈支持Jonathan Toomim能提出升级提案并将其付诸实践。正如他提到的那样,他也会对许多其他选择感到满意。与其尝试寻找“最佳”算法,不如尝试寻找一种社区大部分人认同的一种算法。 我希望关于比特币现金DAA的讨论能保持合理,列出证据,一旦需要做出决定,我希望决策过程也可以保持合理,每个人都至少愿意做出让步。

@BitcoinOutLoud

What the heck is a difficulty adjustment algorithm? And why do we need a new one? I've recently uploaded a new video to my Bitcoin Out Loud YouTube channel. (It should show up on my LBRY channel in a day or two!) https://www.youtube.com/watch?v=8wFuCqkmbrw https://lbry.tv/@BitcoinOutLoud:d Here is the script for anyone interested: In this video, I’ll be covering the proposal from Jonathan Toomim to adopt a new Difficulty Adjustment Algorithm this coming Bitcoin Cash upgrade in November 2020. But before we get to that, it may be a good idea to answer the question, what the heck is a difficulty adjustment algorithm? And why do we need a new one in the first place? To start, let’s remember that Bitcoin groups transactions into blocks. These blocks are added to the “blockchain” only when a miner finds a solution to what is effectively a guessing game puzzle for that block. Check out the video about How Bitcoin Works on the Bitcoin.com channel for more details about why that’s the case. In order to keep the average time between blocks the same and issue new coins into the supply at a predictable rate, we need a systematic way [aka an “**algorithm**”] to **adjust** the **difficulty** of that guessing game puzzle when there are more or less guesses being made on the network at once. Originally, the “DAA” was pretty simple. Every two weeks, or 2016 blocks, check the average time between those 2016 blocks. If it averages less than ten minutes per block, increase the difficulty. If it averages more, decrease the difficulty. And while this algorithm worked fine for the most part, at least before Bitcoin split into BTC and BCH, it did have its own subtle consequences that you might not think of at first. For example, since hashrate on the Bitcoin network has done much more increasing than decreasing, and the difficulty is only adjusted every two weeks, the average block time for Bitcoin has actually consistently been below 10 minutes on average. And things got infinitely more complicated when the Bitcoin blockchain split into BTC and BCH. While before, miners simply mined Bitcoin if it was profitable, after the split, miners had the additional option of mining on one chain or the other. Because of that, Bitcoin Cash almost certainly needed a new algorithm at the time of the split. Waiting 2016 blocks to adjust the difficulty could potentially result in the death of the chain. Those 2016 blocks, which normally would take 2 weeks to mine, could take two months or longer to mine if there is a significant drop in hashrate. And if the chain becomes unprofitable enough or a bad enough investment in the eyes of miners, then the chain could simply halt as no one continues to mine it. A potential delay of 2016 blocks is simply much too slow a response for a multi-Bitcoin ecosystem. So a new algorithm was implemented but, unfortunately, it was far from perfect. This “Emergency Difficulty Algorithm” (or “EDA”) worked like the original algorithm, but also detected extreme cases of low hashrate in recent blocks and then lowered the difficulty significantly for the next block in those cases. This algorithm led to wild swings in difficulty and hashrate. Miners would take advantage of the low difficulty when the EDA “kicked in”, mining many blocks in a short period of time, and then they would simply leave the chain to mine BTC when the difficulty went back up and profitability went back down... Until, of course, the EDA kicked in again, which required a long period of slow blocks that were only produced at all because at least some miners mined BCH at a loss during that period of higher difficulty. These “oscillations” between high and low hashrate led to much longer average confirmation times, since a transaction is much more likely to be sent during one of the long periods of slow blocks than in the short bursts of blocks that happen in between. They also caused significantly more blocks to be mined than one every ten minutes on average, which is the reason Bitcoin Cash is currently about a month ahead of BTC in terms of blocks and total number of coins. It’s worth noting, though, that this issue isn’t really the fault of the miners. They don’t even have to “plan ahead” to “abuse” this problem. It happens naturally given the existence of miners who switch what they’re mining in the current moment simply depending on which chain is currently more profitable. It’s up to us to build a system where profit-seeking behavior benefits the system as a whole, or at least doesn’t disrupt it. The EDA was quickly replaced with another new algorithm, this one built from scratch instead of modifying the old DAA, and it did perform much better, but it was and is still prone to “oscillations”, that is, swings between higher and lower difficulty and hashrate. This new difficulty adjustment algorithm, which has been Bitcoin Cash’s algorithm for two and a half years now, recalculates the difficulty every single block, based on the average amount of time between the previous 144 blocks, which is about 1 day’s worth of blocks. Mr. Toomim does a great job explaining where these oscillations come from in his in-depth video, but here’s a condensed version: Because the current algorithm averages the block times of the last 144 blocks, blocks leaving that 144 block window when a new block is mined have just as much effect on the difficulty as the block entering the window. Whenever a quickly mined block leaves the window, it causes a decrease in difficulty, because the average time between blocks goes up. That lower difficulty brings about another faster block. Generally, whatever events took place 144 blocks ago are likely to be “echoed” in the present, and this continues as a positive feedback loop because, of course, that echo will eventually leave the 144 block window, creating its own echo. It’s really neat how you can see as he scrolls that whatever is happening at the lower-left where blocks are leaving the window is what you can expect to then happen with the new blocks in the upper-right. In addition to degrading the user experience with long confirmation times, these oscillations make it more profitable for a miner to not mine BCH at all during points of high difficulty. This is a strategy that, if used by enough miners, could cause the death of the BCH chain as blocks stop coming in at all. We are very lucky to have miners who are invested in BCH enough in the long term to mine it at a loss to keep it functioning, and even point extra hashpower to the chain at great cost to themselves when a block hasn’t been found in an especially long time. But we should certainly not **depend** on the charity of miners to keep BCH working. When it comes to alternatives, there are several options. For example, Real-time Targeting algorithms, or “RTT’s” take into account how long it’s been since the last block to determine the difficulty of the current one. While a neat idea, it’s a relatively large change to how Bitcoin works, and requires miners’ clocks to be well synchronized, which opens up the chain to a wide variety of potential problems and exploits. Instead, let’s consider that the problem with the current algorithm is that data points leave the set abruptly. It’s abrupt because the algorithm is a “Simple Moving Average” algorithm, or SMA, where each block in the window is given equal weight. To address the problem at its root, we can instead reduce the effect any given block has on the current difficulty as it gets older. If we do this “linearly”, with a constant decrease in influence, we get algorithms like lwma, which stands for linearly-weighted moving average, and the wt, or “weighted time”, family of algorithms. Another option is to reduce the influence of a block exponentially as it gets older, which is what the EMA, or “exponential moving average” family of algorithms do. Algorithms in this class include Jacob Eliosoff’s ema-1d and simpexpt-1d, wtema from Tom Harding, and asert from Mark Lunderberg. EMA’s have some unique benefits when it comes to calculating the current difficulty. So with all these options, what can we possibly do to figure out which one is best? Well it turns out, actually a lot. Open-source software, forked by Mr. Toomim from kyuupichan’s difficulty adjustment simulations, makes it much easier to compare the behavior of different algorithms with its graphical user interface, as well as an interface full of the user’s graphs. And while I’m not an expert in the details, it does seem like this simulator was made with lots of important things in mind, like the option to set what percentage of miners mine BCH “steadily”, or no matter what, what percentage are “variable miners” which will switch partial hashrate back and forth depending on profitability, and what percentage are “greedy”, and will switch 100% of their hashpower depending on which chain is more profitable, given a threshold of, say, 3% greater profitability. While models can not, of course, be perfect, they can still help us make as educated a decision as possible. The potential for oscillation problems with the current algorithm was, in fact, predicted before it was implemented back in 2017, using these tools. The current DAA’s oscillations have even been getting worse over time, as more miners switch to more profitable strategies that involve switching chains depending on their relative profitability. The results of these simulations, along with the urgent nature of the current DAA’s problems, make it clear to me that we should absolutely change the DAA this coming upgrade. There are several drastically superior options, and it’s really just about deciding which of them to implement. Take a look at this table showing simulation results for 5 algorithms at three different block window sizes. While all of the algorithms result in average block times of very close to 600 seconds, you’ll notice that several of them actually have much longer average confirmation times. These are the SMA (or “simple-moving-average”) algorithms. All of the other algorithms perform well, though asert does consistently have the edge. The chart also shows how much more profitable it is to have one mining strategy over the others. Once again, the SMA algorithms are vastly outperformed by the other options, which keep the three types of mining much closer in profitability. Since the non-SMA options do perform so similarly, it’s arguably more important to make the choice between them based on considerations other than their simulated performance as a DAA, and instead based in things like how much work they would be to implement, and how costly they are to run (in terms of processing resources). Mr. Toomim counts out lwma and wt because they “require sampling every block header in their windows (e.g. 288 blocks) in order to calculate the next block’s difficulty...” That left wtema and asert, which each only require sampling two block-headers. If you’d like the details on how these two algorithms work, definitely check out Toomim’s original article on read.cash, but here are the two points that he thinks are most important when picking between the two: First, integer approximations are harder with asert, and apparently you shouldn’t use floating point math because different processors can differ slightly in how they handle it. Second, wtema has issues with singularities, where the algorithm fails completely given certain inputs, and negative timestamps, which is when a block has an earlier timestamp than one that is before it on the blockchain. Both algorithms need to get more complex to work around their respective issues, but he argues that asert is the less problematic because it doesn’t require messing with other consensus rules, while wtema would require forbidding large negative solve times. Mr. Toomim then covers picking an integer approximation method, deciding the half-life for the exponential function, picking a block height based activation over a “median time past” activation, testnet details, potential attacks, and how to mitigate those attacks, with his own links to even more information, all of which you should check out if you’re interested but, for the sake of brevity, I won’t get into any of that here. In his conclusion, Mr. Toomim lists 12 desirable properties of a DAA, and I’ll just read them verbatim. It should be stable, and not prone to oscillations; It should keep confirmation times low; It should keep incentives for miners to perform hashrate shenanigans low; It should keep incentives for miners to perform timestamp manipulation shenanigans low; It should keep incentives for miners to perform selfish mining shenanigans low; Because of #3, #4, and #5, honest mining strategies with steady hashrate should get near-optimal income; The chain should recover quickly after sudden changes in hashrate and/or exchange rate; The average block interval should be kept close to the target (600 seconds); The algorithm should be mathematically simple and elegant; The algorithm should be easily understood and analyzed; The algorithm should be easy to implement elegantly and simply; and The algorithm should have few or no edge and corner cases. It will be up to the rest of the development community to decide whether they accept these priorities, and whether or not they agree that asert fits them best. Before finishing up, I want to just give Jonathan Toomim serious props for taking the initiative to create a proposal and put it out there. I also think it’s very reasonable that, as he’s mentioned elsewhere, he would be happy with many of the other options as well, suggesting that instead of trying to find the “best” algorithm, maybe we should just try to find the one that is acceptable to the largest number of relevant parties. I hope that the discussion about the Bitcoin Cash DAA can remain reasonable and evidence-based, and then, once a decision needs to be made, I hope that that decision-making process can also remain reasonable, where everyone is willing to compromise at least a little bit.

@BitcoinOutLoud

HDR photos of the beautiful Shenandoah Valley I'm very lucky to be spending time in the Shenandoah Valley in Virginia, USA. I also love the effect of "HDR" photography, where multiple exposures are used to create a composite image with a higher range of colors and brightness. (To be honest, I overuse the effect... I just love the dreamy look photos get!) So I'd like to share some of the photos I've taken. I hope you enjoy them! Bonus dog photo!

+4 more

@BitcoinOutLoud

WTF is Porcupine Temperament? When I'm not geeking out about Bitcoin (a peer to peer electronic) Cash (system), I'm geeking out about music theory. Specifically, "microtonal music theory". I recently released this video giving an overview of a tuning system called "porcupine temperament", if you'd like to check it out: https://www.youtube.com/watch?v=M6mkyAtwrcw Here's the script for reference, thanks for watching/reading! ___________________________ Most western musicians will be intimately familiar with the diatonic scale. It’s got 5 large steps and 2 small steps. It’s got 3 major chords, 3 minor chords, and a diminished chord. And there are various modifications of the scale arrived at via sharps and flats, like the harmonic scale, the melodic scale, or the double harmonic scale, all with their own modes, sets of chords, and melodic characteristics. But the diatonic scale, with all of those details playing into the intricacies of using it to make music, is just one possible scale structure among many. For example, consider a scale with 1 large step and 6 small steps. With a small step size of around 160 cents (or 1.6 semitones), we end up with a 7-note scale containing two major chords, two minor chords, and three diminished chords. We also end up with some intervals that are pretty far from anything we have access to in standard western tuning. This 1 large 6 small scale can be derived from accurate tunings of what’s called Porcupine temperament. While in western music we have a circle of fifths (which can be flatted to give us better thirds), in Porcupine you have a circle of major-second-ish intervals that can be flatted to give us better… well, pretty much everything. If you continue that chain of seconds beyond the 7 note scale, we get another melodically consistent scale right at 8 notes with a structure of 7 large steps and 1 small step, and then at 15 notes with a structure of 7 large steps and 8 small steps. These scales might be loosely analogous to our pentatonic, diatonic, and chromatic scales, though it’s especially interesting that two of these scales are just one note apart. Perhaps alternating between the two depending on the melodic needs of a given passage would be commonplace in porcupine temperament! This “1L6s” scale can also be modified by a generalized sharp and flat, which is derived as the interval between large and small steps in the scale. These modifications can be used to gain access to combinations of major and minor chords that weren’t available before, and to create melodic interest, especially with small steps surrounding target notes. While this all may seem like relatively familiar territory, the actual function of each of large and small step, of each chord and harmony, is almost entirely unexplored territory, and still honestly feels pretty alien, even after having written some music in this system myself. To hear a 4 part round I wrote using this 1L6s scale, check out this video: https://www.youtube.com/watch?v=chTjHPDhpm0