https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3243656

Introduction

(LR is) as flexible and responsive as the market, but avoids free-rider problems.

  • Flexible and responsive: any one can propose a new public good project, and the project can get enough fundings even when only a small community funds it.
  • Subsidies create incentives for citizens to fund projects.

Background

(Free-rider problem is) due to the expense or inefficiency involved in excluding individuals from access.

Cons of Existing Solutions

  • 1p1v: oppress minorities.
  • Capitalism: inefficiently exclude potential users.
  • Charitable organization: difficult to closely align reliably with the common good.
  • QV: it doesn’t solve the problem of flexibility, a.k.a., it requires a curated projects list.

Model

Assumptions

  • We can verifiably distinguish among and identify these citizens.
  • Any citizen may at any time propose a new public good.
  • Our interest here is in maximization of dollar-equivalent value rather than achieving an equitable distribution of value.
  • Utility function V is concave (国内的叫法一般是反的,即我们平常说的凸函数), smooth, increasing.
  • The deficit is not bounded, a.k.a, the funding solution can collect unbounded taxes.

Economic problem of society is mainly one of rapid adaptation to changes in the particular circumstances of time and place, it would seem to follow that the ultimate decisions must be left to the people who are familiar with these circumstances, who know directly of the relevant changes and of the resources immediately available to meet them.

The knowledge is dispersed and rapid changes. To take advantage of this knowledge, people must make decision distributively. People require only relevant information to make better decisions. This communicating mechanism should be

communicating to him such further information as he needs to fit his decisions into the whole pattern of changes of the larger economic system.

It is always a question of the relative importance of the particular things with which he is concerned, and the causes which alter their relative importance are of no interest.

The price system solved it, and

We must look at the price system as such a mechanism for communicating information.

It is an effective communicating system because:

Only the most essential information is passed on and passed on only to those concerned.

It extends the span of our utilization of resources without the control of any one mind. Also, it will make the individuals do the desirable things without anyone having to tell them what to do.

Thoughts

It opened my mind to look at the price system differently. It is an effective way to watch the only the necessary and relevant information, and the messages are propagated rapidly in the system. It makes distributed decisions possible and outperforms central decision authorities in most cases.

Although distributed decisions can achieve local optimum, which may not be the global optimum. We human may also need some centralization to break the equilibrium by a trial and error like method.

References

Orbs - Read the Helix Consensus Algorithm White Paper

Hazel is a Byzantine fault-tolerant and scalable consensus algorithm for the fair ordering of transactions among nodes in a distributed network.

It assumed that:

  • Node-node connections are assumed to be strongly synchronous.
  • There is a known bound for the faulty nodes.

It is scalable because the PBFT committee size is bounded.

Helix archives fairness in these aspects.

  • Committee selection relies on reputation and a random seed.
  • Transactions are randomly selected when they are encrypted.

Both committee election and transactions sampling utilize a random seed derived from the previous decrypted block.

Helix nodes validate block transaction by checking the distribution overlap with local transaction pool.

parent table struct union vector string enum scalar
root Y Y
table Y Y Y Y Y Y Y
struct Y Y Y
union Y Y
vector Y Y Y Y Y Y

If there is a Y in row A column B, B can be used as a child of A. If it is blank, B is not allowed as a child of A.

Parent root means which type can be used as a root object.


the test schema

Official References

  • Based on Bitcoin
  • PoS overlays upon PoW
  • Add signature algorithms Ed25519 and Schnorr
  • Use BLAKE-256 as hash algorithm
  • Enable segwit to solve transaction malleability
  • Transaction expiration mechanism.

Hybrid Consensus

Decredible | Decred hybrid consensus explained

  • PoW miners propose new block.
  • PoS miners vote whether accepting the block. The ticket should be purchased first. 5 tickets are selected randomly using the new PoW block header. Block is accepted if 3 tickets agree.
  • Block reward is split between PoW and PoS miners.
  • PoS tickets are selected using PoW block header. It guaranteed that is has a very high cost to manipulate picking tickets.

I rarely used more than two marks in Vim, so why not use them as a stack and keep latest history?

The idea is that

  • First shift existing marks in a-y to b-z, thus original mark z is dropped.
  • Then save current position into mark a.
function! PushMark(is_global)
  if a:is_global
    let l:curr = char2nr('Z')
  else
    let l:curr = char2nr('z')
  endif
  let l:until = l:curr - 25
  while l:curr > l:until
    call setpos("'" . nr2char(l:curr), getpos("'" . nr2char(l:curr - 1)))
    let l:curr -= 1
  endwhile
  call setpos("'" . nr2char(l:curr), getpos("."))
endfunction

" Push to marks a-z
nnoremap <silent> m, :call PushMark(0)<CR>
" Push to marks A-Z
nnoremap <silent> m. :call PushMark(1)<CR>

I recently worked in a Ruby on Rails project which should integrate with many different payment systems. There system mostly use RSA in encryption and signature. However they provide the RSA keys in different formats, it is a challenge to choose a right way to read the keys in Ruby.

RSA is an asymmetric cryptographic algorithm, thus it requires two keys, private key and public key. The key itself is just binary, but it can be encoded in different format.

Just upgraded Graylog to cluster in a project. Because syslog UDP is used as input, a UDP load balance is required to distribute logs to servers in the cluster. Since the servers are hosted in Aliyun, I tried Aliyun UDP Load Balance first. But it does not forward requests evenly, and health detection diagram cannot be disabled. The popular HTTP load balance tool HAProxy does not support UDP. Fortunately, Nginx can be used as a UDP load balance.

It is common to use Redis as read buffer。To read data, first check whether it exists in Redis. If so, use the cached data, otherwise read from the backend storage and save a copy into Redis. To write data, first save into backend storage, then clear or update Reids cache.

But if the system bottleneck is in writing, the solution above does not work. But it is easy to modify it into a write buffer.

  • Read: Check whether the data exists in Redis. Read from backend storage if not.
  • Write: Just write into Redis. Notify background worker via message queue to flush the cache into backend storage.
  • The background worker watches message queue, save data and delete from Redis.

The message queue can be implemented using Redis LIST. Official RPOPLPUSH – Redis command document already described how to implement a reliable queue. The remaining issue is how to safely delete saved data from Redis.

  • Add properties files into src/main/resources
  • Global messages location:
    • src/main/resources/Messages.properties is for default locale
    • src/main/resources/Messages_en_US.properties is for locale en_US
  • Resource Bundle for component: Same directory structure to the class path. For example the resource bundle file for views.Main can be found in src/main/resources/views/Main.properties, or file name Main_en_US.properties for specific locale.
  • Enable native-to-ascii conversion in IntelliJ to ease editing UTF-8 values.