text:
Strengthening coordination to improve access to comprehensive and integrated services in Portugal
By: Jessica Wiken, Alexandre Lourenço, José Maria Albuquerque, and Jocelyn Fifield
Introduction and context: primary health care reform in Portugal, from the 1970s to present
In the 1970s, Portugal emerged as one of the first European countries to adopt a tax-financed national health system with an integrated approach to primary health care (PHC).[1] Since then, Portugal has worked to ensure equal access to health care as a right for all its citizens through a series of laws and national reforms and the creation of a nationwide health center network.[1-5] The creation of the National Health Service (Serviço Nacional de Saúde, SNS) in 1979 established the State as the provider of this right to universal, comprehensive, and free health care.[5] In practice, Portugal faced many difficulties fulfilling this role due to financial, organizational, and access-related limitations within the greater context of political, economic, and social changes as it decolonized and transitioned to a democracy.[5]
Portugal's health care system has undergone frequent reforms over the last 40 years as changing political forces impact the health agenda.[2,5,6] Many of these reforms have focused on increasing health sector efficiency through autonomous and flexible management strategies.[2,5] Facing ongoing issues with accountability, efficiency, and cost-containment [7], the strategic goals of the New National Health Care System period of 2002 - 2006 and the National Health Plan period of 2004 - 2010 were designed to achieve health gains through health promotion and disease prevention with an emphasis on integrated PHC.[1,5,6] In 2005, Portugal's PHC system underwent major reform as a part of the National Health Service Mission for PHC (Cuidados de Saúde Primários).[1,2] Building on previous reforms, the National Health Service Mission aimed to improve accessibility, organization, timeliness, and ease of use of quality services through decentralized governance and community-based PHC.[1,2] Considered one of the most successful public reforms in Portugal, the National Health Service Mission broke from the traditional hierarchical model and restructured the health system using both a bottom-up and top-down approach to respond to population health needs at local, regional, and national levels.[2,3,8]
While Portugal continues to aim for high-quality, universal PHC, the capacity of the SNS to achieve the aims of these reforms has depended on the fluctuating economic and political pressures on the State.[5] In reaction to the 2008 global economic crisis, Portugal agreed with the EU to an Economic Adjustment Program between 2011 and 2014 aimed at improving cost-containment, transparency, and regulation in the health sector, as a condition of an EUR 78 billion international loan agreement.[9,10] Portugal's latest reforms have responded to these pressures to improve financial sustainability and efficiency.[9] In commitment to the series of reforms over the last few decades, Portugal has also worked to improve the efficiency and quality of its health system through innovative care-coordination strategies and comprehensive community-based health promotion programs.[2,9] As a reflection of these efforts, Portugal has enjoyed substantial improvements in the health status of its population over the last 25 years despite having some of the lowest economic and education indicators in Western Europe.[3,11] This case study focuses on reforms in Portugal in this context, with a specific focus on both horizontal and vertical care integration models for improved coordination of care.
Strengthening coordination across the health system: decentralization and integration
The Ministry of Health oversees the Portuguese health system and is responsible for regulating, monitoring, and financing of the national health system through the National Health Plan.[9,10] Central funding is distributed to Regional Health Authorities, who are responsible for the coordination of hospitals and management of traditional primary health care centers in regional districts, as well as the implementation of national health policy objectives.[2,9,16] A 1993 SNS statute redefined the organization of these districts into five health regions.[5] Local primary health care provision is split between two models, the traditional primary health care centers and primary care services grouped in Family Health Units (Unidades de Saúde Familiar).
Organizational changes implemented as a part of the 2005 reform led to the creation of Health Center Groups (Agrupamentos de Centros de Saúde) in 2008.[2,5,9,13] The Health Center Groups are decentralized public health services under the Regional Health Authorities that have administrative autonomy and are responsible for populations between 50,000 and 200,000.[1-3,6,12] Prior to the creation of these groups, policy initiatives borne of the 2005 reform reorganized the incentive structures and funding of PHC to promote the evolution of traditional primary health care centers into Family Health Units.[1,3,4,12] Traditional primary health care centers were incentivized to organize as Family Health Units through an internal contractualization process in which primary health care teams defined collective performance-related objectives around access, efficiency, and quality.[8] Facing resource management issues, the Health Center Groups were created to build an organizational framework and support structure for community-based PHC.[1,3,4,12] Five different functional units, including the Family Health Units, operate under the management of Health Center Groups, but have technical, functional, and organizational autonomy.[2,3]
Portugal's existing health system structure reflects the efforts of historical reforms to improve coordination across levels of care to provide equitable access to a more comprehensive set of services across the continuum of care, with primary care at the center of the system. Through care integration processes, Portugal has worked to improve the efficiency and accessibility of quality primary health care for all.
Horizontal integrated care initiatives - multidisciplinary teams and intersectoral collaboration
Horizontal integration refers to the coordination and consolidation of multiple types of health care services within PHC facilities and in community-based care. In Portugal, the Family Health Units have contributed significantly to the provision of this people-centered, integrated model of PHC. Considered a cornerstone of the 2005 reform, Family Health Units are self-organized, autonomous multidisciplinary groups comprising three to eight family doctors with an equal number of family nurses and administrative professionals. These Family Health Units operate in health centers run by the State have a targeted focus on access, care coordination, and high-quality continuous care.[2-4] Their core mission is to engage in local priority setting and deliver customized and equitable PHC to a population of between 4,000 and 18,000 individuals in their geographic area.[2,3,6,13] Task sharing among members of the team helps to promote coordination and multidisciplinary collaboration.[2] As a part of the bottom-up approach of the 2005 reform, functional health units like the Family Health Units hold technical responsibilities and authority independent of the management of Health Center Groups but work in accordance with principles and directives issued in regional plans and by the Ministry of Health.[2,6,8,13] In the first three years of the reform, Portugal saw an increase in the percent of patients who visited their usual primary care provider at least once a year from 59.8% in 2005 [3] to 67.6% in 2017; and 89.4% with a medical appointment in the last three years.[14]
Facing issues with worker retention and quality performance in the public sector, especially in rural areas, a new payment scheme was developed to incentivize performance and integrated care delivery.[13,15] To encourage greater autonomy, certain Family Health Unit teams determine the performance-related indicators and goals that they are measured against.[2,15] Achievement of these goals qualifies these teams for both team-based and individual performance-based incentives that are determined through consideration of the patient list, opening hours, and home visits.[2,15] To further promote the delivery of comprehensive, coordinated care, additional incentives are in place to monitor higher-risk subpopulations, such as pregnant women and diabetic patients, coordinate across different levels of care, and promote public health activities such as tobacco cessation programs.[15] Notably, Family Health Unit teams in the learning phase receive exclusively team-based financial incentives.[2,18] The Family Health Unit model has shown better access to care and improved clinical performance -- including better management of hypertensive and diabetic patients -- relative to traditional primary health care centers that did not undergo contractualization to Family Health Unit models.[15]
In addition to the Family Health Units, Portugal has used intersectoral collaboration as a strategy to better meet patients' comprehensive needs through initiatives like the National Network for Long-term Care (2006). This program provides long-term, home-based care and social support through a horizontal network of long-term care providers that links PHC groups, social security services, and private institutions providing social services.[9,19] Another recent measure has aimed to better manage diabetes and reduce wait times across all levels of care delivery through the creation of Functional Coordinating Units for Diabetes (2013).[9]
Vertical integrated care initiatives - multidisciplinary collaboration across the care continuum
Vertical integration involves redefining the role and improving the interactions among primary, secondary, and tertiary facilities to promote better care coordination across levels of care. Portugal started vertical integration in 1999 with the creation of Local Health Units (Unidade Local de Saúde) which integrate hospital and primary health care units in the same geographical area to promote multidisciplinary collaboration and coordination across different levels of care.[4,10] The Local Health Unit model was created due to systemic problems with a lack of coordination and information sharing across different levels of care and the large number of patients bypassing the referral system for ambulatory care needs.[9] Local Health Units have become a resource for providing effective and coordinated care to patients with multiple needs. In 2014, there were eight Local Health Units in Portugal. Since 2009, the Local Health Units have been financed through a mixed model including an adjusted capitation, pay for performance, and service level agreements, which take into account patient flow to and from the catchment area.[17] Although improvements were inconsistent across Local Health Units, there was an association between integrated care and reduced hospital readmissions in vertically-integrated units, especially for diabetes patients.[12,16]
The challenges of sustained motivation for integrated care delivery
Despite these strides, many of these integrated care initiatives have been limited in scope or stalled in large part due to the impact of financial constraints on Portugal's management and economic models.[4,15,13] While Portugal's agreement to rationalize public-sector health spending helped to promote the use of primary care, salary freezes and the removal of various compensation schemes have created issues with worker retention and motivation among primary care providers. As a result, Portugal continues to experience issues with migration of the qualified healthcare workforce out of rural areas to metropolitan areas and to specialty and hospital-based services in the private sector.[6] These shortcomings challenge the capacity of integrated care teams that are motivated by a pay-for-performance model to effectively serve as the first point of contact, especially in rural areas.[12] Creating and sustaining effective and efficient horizontal and vertical integration initiatives is resource and time intensive. Achieving increased access to effective PHC will require a long-term, system-wide commitment to coordination across and within levels of care, and an investment in physical, technical, and human resources, including strong information technology networks and workforce training programs.
Moving forward: investing in integration across the continuum of care
Portugal has made great strides to promote multidisciplinary team-based care and implement innovative integrated-care models. Given the demonstrated potential of Portugal's integrated care models to improve both access and health outcomes, it is especially important for future policy initiatives and investment funds to address the financial constraints challenging the operations of integrated care models. In light of the growing burden of chronic diseases, Portugal's integrated care programs are critical strategies for efficiently managing complex illnesses.[8,10,12,16]
As seen through the National Network for Long-term Care, multisectoral engagement can be a valuable strategy to promote collaboration and increase efficiency through the provision of complementary services. However, robust quality initiatives -- including standards of care, clinical guidelines, and accreditation standards -- and strong information systems must continue to be a priority for all actors involved in the delivery of care, to ensure the delivery of safe, timely, and high-quality services across the continuum of care.[17] In Portugal, important opportunities lie in increasing community engagement efforts, multisectoral collaboration, and innovations in health information technology to deliver more comprehensive responses to address complex population health needs.
1. Pisco Luis. Primary Health care Reform in Portugal on two fronts: autonomous family healthcare units and management of groupings of Health Centers. Ciênc. saúde coletiva [Internet]. 2011 June [cited 2018 Oct 17] ; 16( 6 ): 2841-2852. Available from: http://www.scielo.br/scielo.php?script=sci_arttext&pid=S1413-81232011000.... http://dx.doi.org/10.1590/S1413-81232011000600022.
2. Biscaia, André Rosa, Liliana Correia Valente Heleno, André Rosa Biscaia, and Liliana Correia Valente Heleno. 2017. "Primary Health Care Reform in Portugal: Portuguese, Modern and Innovative." Ciência & Saúde Coletiva 22 (3): 701–12. https://doi.org/10.1590/1413-81232017223.33152016.
3. Fonseca, C., T. Dedeu, L. Pisco, and A. Gouveia. 2015. "Portugal." In Building Primary Care in a Changing Europe: Case Studies. European Observatory on Health Systems and Policies. https://www.ncbi.nlm.nih.gov/books/NBK459011/.
4. Fialho, André S., Mónica D. Oliveira, and Armando B. Sá. 2011. "Using Discrete Event Simulation to Compare the Performance of Family Health Unit and Primary Health Care Centre Organizational Models in Portugal." BMC Health Services Research 11 (October): 274. https://doi.org/10.1186/1472-6963-11-274.
5. Diogo, C. (2004) The reform of the NHS in Portugal. Working Paper. Department of Management Studies, University of York , York.
6. World Health Organization Europe. WHO Evaluation of the National Health Plan of Portugal (2004 - 2010). 2010. Accessible from: http://www.euro.who.int/__data/assets/pdf_file/0003/83991/E93701.pdf
7. OECD (2001b). OECD Economic Surveys: Portugal. OECD, Paris.
8. Monteiro, Baltazar Ricardo, Ana Maria Silva Azenha Pisco, Fátima Candoso, Sónia Bastos, Magda Reis, Baltazar Ricardo Monteiro, Ana Maria Silva Azenha Pisco, Fátima Candoso, Sónia Bastos, and Magda Reis. 2017. "Primary Healthcare in Portugal: 10 Years of Contractualization of Health Services in the Region of Lisbon." Ciência & Saúde Coletiva 22 (3): 725–36. https://doi.org/10.1590/1413-81232017223.33462016.
9. Simões J, Augusto GF, Fronteira I, Hernández-Quevedo C. 2. Health Systems in Transition, 2017; 19(2):1–184.
10. OECD/European Observatory on Health Systems and Policies (2017), Portugal: Country Health Profile 2017, State of Health in the EU, OECD Publishing, Paris/European Observatory on Health Systems and Policies, Brussels. http://dx.doi.org/10.1787/9789264283527-en
11. Instituto Nacional de Estatistica 2010 Instituto Nacional de Estatística. Statistical yearbook of Portugal 2008. Lisbon: Instituto Nacional de Estatística; 2010.
12. World Health Organization. Health System Review Portugal Phase I Final Report. April 2018. Accessible from: http://www.euro.who.int/__data/assets/pdf_file/0008/366983/portugal-revi...
13. Santana, Silvina, Nina Szczygiel, and Patrícia Redondo. 2014. "Integration of Care Systems in Portugal: Anatomy of Recent Reforms." International Journal of Integrated Care 14 (July). https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4113913/.
14. Ministério da Saúde. (2018). Acesso a cuidados de saúde nos estabelecimentos do SNS e entidades convencionadas em 2017 - Relatório Anual. Ministério da Saúde, Lisboa
15. Lourenço, Alexandre. Country Background Note: Primary care P4P in Portugal. Feb 2016. Accessible from: https://www.oecd.org/els/health-systems/Better-Ways-to-Pay-for-Health-Ca...
16. Lopes, H., Mateus, C. and Hernández-Quevedo, C. 2018. Ten Years after the Creation of the Portuguese National Network for Long-Term Care in 2006: Achievements and Challenges. Health Policy 122(3), pp. 210–216.
17. OECD. (2015). OECD Reviews of Health Care Quality: Portugal 2015: Raising Standards. Paris: OECD Publishing. https://doi.org/10.1787/9789264225985-en


text:
Q: How to change data using functions? What is the difference between these examples and why are the outputs like this?
Why do we write print A or print L?
def f(N):
    N = N+20

def g():
    A =10
    print A
    f(A)
    print a

#  output
#  10
#  10

def f(List):
    List[0] = 'A'

def g():
    L = [1,2,3]
    print L
    f(L)
    print L

#  output
#  [1,2,3]
#  ['A',2,3]

A: First you have written function f with one argument
def f(N):
    N = N+20

Second function g with no arguments, with local variable A=10
def g():
   A =10
   print A  #so prints 10
   f(A)      # call function `f` passing `10 f(10)` but not printing anything and, not holding return value
   print a   # print `a` values but in the post you have not shown where you declared this `a`

Third function f with one argument, and replacing 0 index of value (overrides above function f)
def f(List):
       List[0] = 'A'

Fourth function g with local variable L of type List (overrides above function g)
def g():
   L = [1,2,3]
   print L  # print list L
   f(L)    # called function `f` passing list so replaces `0` index of `L`
   print L  # prints modified `L`

A: Because when you pass a number to f() it will receive a copy of the number.
But when you pass a list to f() it will receive a reference to that.
Take a look at Difference between call by value and call by reference

redpajama_set_name: RedPajamaStackExchange


My mother was my first teacher and one of my best. She visited some of my classes. I miss her, especially on Mother's Day.
Mother's Day is around the corner in the US today, now that the calendar has turned to May.
This annual special Sunday for moms is celebrated on different days in different parts of the world.
In the UK, Mothering Sunday falls on March 6 each year.
The US and the Ukraine share the second Sunday in May each year to recognize the many contributions that mothers make to our lives.
As it is celebrated in the US, Mother's Day was first observed on May 10, 1908 in West Virginia, in honor of Mrs. Reese Jarvis.
This thanks to efforts begun in 1858 by her daughters, Anna and Elsinore.
By (US) Presidential proclamation on May 9, 1914, the second Sunday in May was declared to be observed as Mother's Day.
Mother's Day celebrations are centuries old.
one role that all mothers play is…first teacher.
Take your mom to school!
This may be possible only in a photo or video, but IF you can bring your mom to school in person – that would be best of all.
Nancy Hulse and her daughter, Debbie Slais, dress in prairie costumes to help students in Debbie's third grade class learn about pioneer days in the US.
Bringing mom to school is a cool attention-getting tool.
That's what Debbie Slais, a third grade teacher, does when her mom, Nancy Hulse, visits each year.
This special mother-daughter team dresses to impress – that is – to catch and hold students' attention – in Debbie's class.
As part of her Social Studies curriculum Debbie teaches a third grade unit on The Oregon Trail.
She has had success helping students learn by bringing history to life through costuming.
Like mother, like daughter…Nancy worked as a Special Education teacher for twenty-eight years before retiring.
Ask her if she knows a thing or two about kids and her smile and eyes reveal her experience. Imagine the stories she has to tell!
Storytelling is part of the costuming "gig" that Nancy and Debbie have created.
Nancy explains why their teacher is not in the room. The kids instantly get the "gig" and take their seats eager to see what comes next.
Debbie rushes into her classroom in character attire and voice, announcing that it's time to sew marble bags to prepare for a long journey along The Oregon Trail.
When Debbie brings her mom to school, their entertaining and educational skit in costume holds students spellbound. Oregon Trail (pretend) travel activities include reaching the west coast and having a quilting bee, piecing together some of the fabric squares the students have learned to design and stitch.
No matter what part of the world you live in, you can invite your mom (in-person or not) to be part of your teaching plan.
Every nation has a history that children who are native to that land learn.
Making simple costumes based on your nation's history, like pioneer women costumes are to America, or simply wearing or showing special occasion clothing you and your mom have or had can help connect kids to your Social Studies curriculum.
Costuming is a classroom-tested trick for effective teaching.
As every mother and every teacher knows, children learn by doing. When you set the classroom stage for learning by wearing curriculum-connected costumes in school, and by using "props," like crafts that are part of your traditions, you engage students in learning.
Here's to celebrating our first teachers and dressing, not just to impress, but to support your curriculum.
Please send comments about how you use costumes for teaching.
1 Pings/Trackbacks for "Celebrating Our First Teachers and Costuming to Catch Attention"


text:
Ask a question or post a comment about the paper
Join the discussion! Ask questions and share your comments.
"Peer-to-Peer" is an important concept in Bitcoin. It means that Bi...
Here I give a quick overview of a few concepts important for a good...
Satoshi Nakamoto is the name used by an unknown person or persons. ...
The double spending problem in a cryptocurrency is about a user bei...
What is proof of work?
The risk that a digital currency can be spent twice. Double-spendin...
**Reversible Transactions** Credit card payments are monitored b...
This nicely — and correctly — shows crypto systems are alternatives...
Here, I believe escrows can only help the buyers but merchants stil...
This diagram can be hard to understand at first. The diagram is i...
As it stands, the system is still vulnerable to double spending. Sa...
The purpose of the timestamp server is to prove (or disprove) the e...
Is this the only purpose of the timestamp?
*Hashcash* is a proof-of-work system that can be used for instance ...
A [block](https://en.bitcoin.it/wiki/Block) is a record of a number...
I don't think Satoshi intended one-ASIC 50,000+ votes
When we talk about 'modifying a block' we are not talking about cha...
This is the step at which we are checking for any double spending.
The "longest" chain isn't necessarily the one with the most blocks ...
Highlighted for importance
Doesn't this jeopardise Satochi's initial idea of a currency for sm...
Here the author describes a way to develop bitcoin clients that don...
A quick resource for understanding Merkle Trees: https://hackernoon...
Simplified Payment Verification (SPV) is about verifying that a tra...
One important thing to understand here is that each transaction can...
In case it wasn't clear: Alice has 3 Bitcoins and wants to send Bob...
Consider an attacker that has paid some merchant, has had its trans...
Analysis to show that as long as an attacker possesses less than 50...
$k$ is the number of blocks the attacker has already mined in secre...
Bitcoin: A Peer-to-Peer Electronic Cash System
satoshin@gmx.com
www.bitcoin.org
Abstract. A purely peer-to-peer version of electronic cash would allow online
payments to be sent directly from one party to another without going through a
financial institution. Digital signatures provide part of the solution, but the main
benefits are lost if a trusted third party is still required to prevent double-spending.
We propose a solution to the double-spending problem using a peer-to-peer network.
The network timestamps transactions by hashing them into an ongoing chain of
hash-based proof-of-work, forming a record that cannot be changed without redoing
the proof-of-work. The longest chain not only serves as proof of the sequence of
events witnessed, but proof that it came from the largest pool of CPU power. As
long as a majority of CPU power is controlled by nodes that are not cooperating to
attack the network, they'll generate the longest chain and outpace attackers. The
network itself requires minimal structure. Messages are broadcast on a best effort
basis, and nodes can leave and rejoin the network at will, accepting the longest
proof-of-work chain as proof of what happened while they were gone.
Commerce on the Internet has come to rely almost exclusively on financial institutions serving as
trusted third parties to process electronic payments. While the system works well enough for
most transactions, it still suffers from the inherent weaknesses of the trust based model.
Completely non-reversible transactions are not really possible, since financial institutions cannot
avoid mediating disputes. The cost of mediation increases transaction costs, limiting the
minimum practical transaction size and cutting off the possibility for small casual transactions,
and there is a broader cost in the loss of ability to make non-reversible payments for non-
reversible services. With the possibility of reversal, the need for trust spreads. Merchants must
be wary of their customers, hassling them for more information than they would otherwise need.
A certain percentage of fraud is accepted as unavoidable. These costs and payment uncertainties
can be avoided in person by using physical currency, but no mechanism exists to make payments
over a communications channel without a trusted party.
What is needed is an electronic payment system based on cryptographic proof instead of trust,
allowing any two willing parties to transact directly with each other without the need for a trusted
third party. Transactions that are computationally impractical to reverse would protect sellers
from fraud, and routine escrow mechanisms could easily be implemented to protect buyers. In
this paper, we propose a solution to the double-spending problem using a peer-to-peer distributed
timestamp server to generate computational proof of the chronological order of transactions. The
system is secure as long as honest nodes collectively control more CPU power than any
cooperating group of attacker nodes.
2. Transactions
We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the
next by digitally signing a hash of the previous transaction and the public key of the next owner
and adding these to the end of the coin. A payee can verify the signatures to verify the chain of
The problem of course is the payee can't verify that one of the owners did not double-spend
the coin. A common solution is to introduce a trusted central authority, or mint, that checks every
transaction for double spending. After each transaction, the coin must be returned to the mint to
issue a new coin, and only coins issued directly from the mint are trusted not to be double-spent.
The problem with this solution is that the fate of the entire money system depends on the
company running the mint, with every transaction having to go through them, just like a bank.
We need a way for the payee to know that the previous owners did not sign any earlier
transactions. For our purposes, the earliest transaction is the one that counts, so we don't care
about later attempts to double-spend. The only way to confirm the absence of a transaction is to
be aware of all transactions. In the mint based model, the mint was aware of all transactions and
decided which arrived first. To accomplish this without a trusted party, transactions must be
publicly announced [1], and we need a system for participants to agree on a single history of the
order in which they were received. The payee needs proof that at the time of each transaction, the
majority of nodes agreed it was the first received.
3. Timestamp Server
The solution we propose begins with a timestamp server. A timestamp server works by taking a
hash of a block of items to be timestamped and widely publishing the hash, such as in a
newspaper or Usenet post [2-5]. The timestamp proves that the data must have existed at the
time, obviously, in order to get into the hash. Each timestamp includes the previous timestamp in
its hash, forming a chain, with each additional timestamp reinforcing the ones before it.
Item Item ...
Owner 1's
Private Key
4. Proof-of-Work
To implement a distributed timestamp server on a peer-to-peer basis, we will need to use a proof-
of-work system similar to Adam Back's Hashcash [6], rather than newspaper or Usenet posts.
The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the
hash begins with a number of zero bits. The average work required is exponential in the number
of zero bits required and can be verified by executing a single hash.
For our timestamp network, we implement the proof-of-work by incrementing a nonce in the
block until a value is found that gives the block's hash the required zero bits. Once the CPU
effort has been expended to make it satisfy the proof-of-work, the block cannot be changed
without redoing the work. As later blocks are chained after it, the work to change the block
would include redoing all the blocks after it.
The proof-of-work also solves the problem of determining representation in majority decision
making. If the majority were based on one-IP-address-one-vote, it could be subverted by anyone
able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote. The majority
decision is represented by the longest chain, which has the greatest proof-of-work effort invested
in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the
fastest and outpace any competing chains. To modify a past block, an attacker would have to
redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the
work of the honest nodes. We will show later that the probability of a slower attacker catching up
diminishes exponentially as subsequent blocks are added.
To compensate for increasing hardware speed and varying interest in running nodes over time,
the proof-of-work difficulty is determined by a moving average targeting an average number of
blocks per hour. If they're generated too fast, the difficulty increases.
5. Network
The steps to run the network are as follows:
1) New transactions are broadcast to all nodes.
2) Each node collects new transactions into a block.
3) Each node works on finding a difficult proof-of-work for its block.
4) When a node finds a proof-of-work, it broadcasts the block to all nodes.
5) Nodes accept the block only if all transactions in it are valid and not already spent.
6) Nodes express their acceptance of the block by working on creating the next block in the
chain, using the hash of the accepted block as the previous hash.
Nodes always consider the longest chain to be the correct one and will keep working on
extending it. If two nodes broadcast different versions of the next block simultaneously, some
nodes may receive one or the other first. In that case, they work on the first one they received,
but save the other branch in case it becomes longer. The tie will be broken when the next proof-
of-work is found and one branch becomes longer; the nodes that were working on the other
branch will then switch to the longer one.
Prev Hash Nonce
Tx Tx ...
New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach
many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped
messages. If a node does not receive a block, it will request it when it receives the next block and
realizes it missed one.
6. Incentive
By convention, the first transaction in a block is a special transaction that starts a new coin owned
by the creator of the block. This adds an incentive for nodes to support the network, and provides
a way to initially distribute coins into circulation, since there is no central authority to issue them.
The steady addition of a constant of amount of new coins is analogous to gold miners expending
resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.
The incentive can also be funded with transaction fees. If the output value of a transaction is
less than its input value, the difference is a transaction fee that is added to the incentive value of
the block containing the transaction. Once a predetermined number of coins have entered
circulation, the incentive can transition entirely to transaction fees and be completely inflation
The incentive may help encourage nodes to stay honest. If a greedy attacker is able to
assemble more CPU power than all the honest nodes, he would have to choose between using it
to defraud people by stealing back his payments, or using it to generate new coins. He ought to
find it more profitable to play by the rules, such rules that favour him with more new coins than
everyone else combined, than to undermine the system and the validity of his own wealth.
7. Reclaiming Disk Space
Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space. To facilitate this without breaking the block's hash,
transactions are hashed in a Merkle Tree [7][2][5], with only the root included in the block's hash.
Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do
not need to be stored.
A block header with no transactions would be about 80 bytes. If we suppose blocks are
generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems
typically selling with 2GB of RAM as of 2008, and Moore's Law predicting current growth of
1.2GB per year, storage should not be a problem even if the block headers must be kept in
BlockBlock
Block Header (Block Hash)
Hash01
Hash0 Hash1 Hash2 Hash3
Root Hash
Hash2
Transactions Hashed in a Merkle Tree After Pruning Tx0-2 from the Block
Tx0 Tx1 Tx2 Tx3
8. Simplified Payment Verification
It is possible to verify payments without running a full network node. A user only needs to keep
a copy of the block headers of the longest proof-of-work chain, which he can get by querying
network nodes until he's convinced he has the longest chain, and obtain the Merkle branch
linking the transaction to the block it's timestamped in. He can't check the transaction for
himself, but by linking it to a place in the chain, he can see that a network node has accepted it,
and blocks added after it further confirm the network has accepted it.
As such, the verification is reliable as long as honest nodes control the network, but is more
vulnerable if the network is overpowered by an attacker. While network nodes can verify
transactions for themselves, the simplified method can be fooled by an attacker's fabricated
transactions for as long as the attacker can continue to overpower the network. One strategy to
protect against this would be to accept alerts from network nodes when they detect an invalid
block, prompting the user's software to download the full block and alerted transactions to
confirm the inconsistency. Businesses that receive frequent payments will probably still want to
run their own nodes for more independent security and quicker verification.
9. Combining and Splitting Value
Although it would be possible to handle coins individually, it would be unwieldy to make a
separate transaction for every cent in a transfer. To allow value to be split and combined,
transactions contain multiple inputs and outputs. Normally there will be either a single input
from a larger previous transaction or multiple inputs combining smaller amounts, and at most two
outputs: one for the payment, and one returning the change, if any, back to the sender.
It should be noted that fan-out, where a transaction depends on several transactions, and those
transactions depend on many more, is not a problem here. There is never the need to extract a
complete standalone copy of a transaction's history.
Hash2 Hash3
Block Header
Merkle Branch for Tx3
Longest Proof-of-Work Chain
The traditional banking model achieves a level of privacy by limiting access to information to the
parties involved and the trusted third party. The necessity to announce all transactions publicly
precludes this method, but privacy can still be maintained by breaking the flow of information in
another place: by keeping public keys anonymous. The public can see that someone is sending
an amount to someone else, but without information linking the transaction to anyone. This is
similar to the level of information released by stock exchanges, where the time and size of
individual trades, the "tape", is made public, but without telling who the parties were.
As an additional firewall, a new key pair should be used for each transaction to keep them
from being linked to a common owner. Some linking is still unavoidable with multi-input
transactions, which necessarily reveal that their inputs were owned by the same owner. The risk
is that if the owner of a key is revealed, linking could reveal other transactions that belonged to
the same owner.
11. Calculations
We consider the scenario of an attacker trying to generate an alternate chain faster than the honest
chain. Even if this is accomplished, it does not throw the system open to arbitrary changes, such
as creating value out of thin air or taking money that never belonged to the attacker. Nodes are
not going to accept an invalid transaction as payment, and honest nodes will never accept a block
containing them. An attacker can only try to change one of his own transactions to take back
money he recently spent.
The race between the honest chain and an attacker chain can be characterized as a Binomial
Random Walk. The success event is the honest chain being extended by one block, increasing its
lead by +1, and the failure event is the attacker's chain being extended by one block, reducing the
gap by -1.
The probability of an attacker catching up from a given deficit is analogous to a Gambler's
Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an
infinite number of trials to try to reach breakeven. We can calculate the probability he ever
reaches breakeven, or that an attacker ever catches up with the honest chain, as follows [8]:
p = probability an honest node finds the next block
q = probability the attacker finds the next block
= probability the attacker will ever catch up from z blocks behind
1 if p≤q
q / p
if pq
Identities Transactions
Counterparty Public
Identities Transactions Public
New Privacy Model
Traditional Privacy Model
Given our assumption that p > q, the probability drops exponentially as the number of blocks the
attacker has to catch up with increases. With the odds against him, if he doesn't make a lucky
lunge forward early on, his chances become vanishingly small as he falls further behind.
We now consider how long the recipient of a new transaction needs to wait before being
sufficiently certain the sender can't change the transaction. We assume the sender is an attacker
who wants to make the recipient believe he paid him for a while, then switch it to pay back to
himself after some time has passed. The receiver will be alerted when that happens, but the
sender hopes it will be too late.
The receiver generates a new key pair and gives the public key to the sender shortly before
signing. This prevents the sender from preparing a chain of blocks ahead of time by working on
it continuously until he is lucky enough to get far enough ahead, then executing the transaction at
that moment. Once the transaction is sent, the dishonest sender starts working in secret on a
parallel chain containing an alternate version of his transaction.
The recipient waits until the transaction has been added to a block and z blocks have been
linked after it. He doesn't know the exact amount of progress the attacker has made, but
assuming the honest blocks took the average expected time per block, the attacker's potential
progress will be a Poisson distribution with expected value:
=z
To get the probability the attacker could still catch up now, we multiply the Poisson density for
each amount of progress he could have made by the probability he could catch up from that point:
k =0
−
 z−k 
if k≤ z
1 if k z
Rearranging to avoid summing the infinite tail of the distribution...
1−
1−q / p
 z− k 
Converting to C code...
double p = 1.0 - q;
sum -= poisson * (1 - pow(q / p, z - k));
Running some results, we can see the probability drop off exponentially with z.
Solving for P less than 0.1%...
We have proposed a system for electronic transactions without relying on trust. We started with
the usual framework of coins made from digital signatures, which provides strong control of
ownership, but is incomplete without a way to prevent double-spending. To solve this, we
proposed a peer-to-peer network using proof-of-work to record a public history of transactions
that quickly becomes computationally impractical for an attacker to change if honest nodes
control a majority of CPU power. The network is robust in its unstructured simplicity. Nodes
work all at once with little coordination. They do not need to be identified, since messages are
not routed to any particular place and only need to be delivered on a best effort basis. Nodes can
leave and rejoin the network at will, accepting the proof-of-work chain as proof of what
happened while they were gone. They vote with their CPU power, expressing their acceptance of
valid blocks by working on extending them and rejecting invalid blocks by refusing to work on
them. Any needed rules and incentives can be enforced with this consensus mechanism.
[1] W. Dai, "b-money," http://www.weidai.com/bmoney.txt, 1998.
[2] H. Massias, X.S. Avila, and J.-J. Quisquater, "Design of a secure timestamping service with minimal
trust requirements," In 20th Symposium on Information Theory in the Benelux, May 1999.
[3] S. Haber, W.S. Stornetta, "How to time-stamp a digital document," In Journal of Cryptology, vol 3, no
2, pages 99-111, 1991.
[4] D. Bayer, S. Haber, W.S. Stornetta, "Improving the efficiency and reliability of digital time-stamping,"
In Sequences II: Methods in Communication, Security and Computer Science, pages 329-334, 1993.
[5] S. Haber, W.S. Stornetta, "Secure names for bit-strings," In Proceedings of the 4th ACM Conference
on Computer and Communications Security, pages 28-35, April 1997.
[6] A. Back, "Hashcash - a denial of service counter-measure,"
http://www.hashcash.org/papers/hashcash.pdf, 2002.
[7] R.C. Merkle, "Protocols for public key cryptosystems," In Proc. 1980 Symposium on Security and
Privacy, IEEE Computer Society, pages 122-133, April 1980.
[8] W. Feller, "An introduction to probability theory and its applications," 1957.
403 error on that link Joao, any other links? Craig S Wright is a suspect https://twitter.com/proffaustus I don't think Satoshi intended one-ASIC 50,000+ votes Is this the only purpose of the timestamp? To understand better this concept of process of work there is this video: https://www.youtube.com/watch?v=bBC-nXj3Ng4&list=WL&index=162 Highlighted for importance This is the step at which we are checking for any double spending. What is proof of work? Any PoW system can be used to fight spam. It is in Hashcash that you are looking for a nonce such that the hash has many leading zeroes. that's not possible, and is part of the transaction validation the miners are doing. The "longest" chain isn't necessarily the one with the most blocks in it, but the one which represents the greatest amount of work. I have explained it further below on page 3. When we talk about 'modifying a block' we are not talking about changing the bits of a block that is already in the blockchain. In order to 'change' a block, and 'rewrite history' an attacker has to generate an alternative chain of blocks which contains the manipulated blocks and is longer than the existing chain. If the attacker manages to do this his alternative chain will be the one that gets accepted by the other nodes. A quick resource for understanding Merkle Trees: https://hackernoon.com/merkle-trees-181cb4bc30b4 Satoshi Nakamoto is the name used by an unknown person or persons. The exact identity is unknown. This nicely — and correctly — shows crypto systems are alternatives to trust. Craig has largely been discredited, Nur. What, in the case of bitcoin, is the *challenge string* exactly? One important thing to understand here is that each transaction can only be forwarded as a whole and cannot be broken into smaller parts. Imagine that you just got your bitcoin wallet and a friend of yours sent you 10 bitcoins (let's call it Transaction 0 - $Tx_0$). Now you want to send 2 bitcoins to Alice (which will be $Tx_1$). In order to only send 2 bitcoins to Alice you will setup $Tx_1$ with one input -$Tx_0$ and with two outputs: * *Output 0* - sends 2 bitcoins to Alice * *Output 1* - sends 8 bitcoins back to you $k$ is the number of blocks the attacker has already mined in secret. If the attacker has mined more blocks than the current $z$ blocks in the blockchain, then he has already won. the difficulty scaling was chosen in such a way, that it support it. also, even in 2009 he did foresee an arms race and called for gentlemen agreement to postpone it a bit https://bitcointalk.org/index.php?topic=12.msg54#msg54 Amos, thank you for your clarification. I have another question: what happens to all of the transactions that were approved in the "loser" blockchain (i.e.: say three blocks were mined and coins minted on two simultaneous chains, and 30 minutes later, one chain turns out to be the one with more proof of work, thereby rendering the other one a dud. Do all transactions and minted coins from the losing chain automatically fail)? The double spending problem in a cryptocurrency is about a user being able to successfully spend the same digital token multiple times. If you were designing a system relying on a central, trusted authority this issue could be simply solved by just always checking with that authority before accepting a token from another user. In this case, the central authority has a global view of all transactions happening in the system and can therefore prevent a user from spending the same token twice. In a decentralized system, this problem is much harder to solve. Bitcoin proposes a solution that is efficient and makes use of a peer-to-peer network instead of a trusted authority. Can escrow be used to prevent charge-back fraud for credit cards? More broadly, can escrow (or a similar scheme) be used to enable completely non-reversible transactions in traditional, centralized finance? Simplified Payment Verification (SPV) is about verifying that a transaction has been accepted into the blockchain without having to download the entire blockchain. With SPV the client downloads only the block headers and not the transactions themselves. In the diagram, we can see a sequence of block headers. We are trying to check if transaction $Tx_{3}$ is part of the second block (block 2). In order to do that the client performing SPV needs to request a few more nodes of block 2's Merkle tree from some other bitcoin client that has the whole blockchain locally. We only need to request *Hash01* and *Hash2*. Then we can use *Hash2* and *Hash3* (which we got from $Tx_{3}$) to compute *Hash23* and then we can use *Hash23* and *Hash01* to compute the Merkle Root hash. Finally, we compare the computed Merkle Root hash against the one referenced on block 2's header. If those values match, $Tx_{3}$ has been accepted into the blockchain. If you want to learn more about SPV I suggest you check out [Bitcoin and the Blockchain - Chapter 6. The Bitcoin Network](http://chimera.labs.oreilly.com/books/1234000001802/ch06.html#spv_nodes) I will like to point out that João sentence starts with "As it stands", validation comes later. "Peer-to-Peer" is an important concept in Bitcoin. It means that Bitcoin does not require a trusted, central authority that oversees all transactions, but instead relies solely on the network of machines participating in the bitcoin protocol. Analysis to show that as long as an attacker possesses less than 50% of the computational power in the network, he produces blocks at a lower expected rate than the rest of the nodes, and so the probability of a successful attack on a given transaction decreases exponentially as more blocks are added to the chain on top of it. Can you elaborate please? Are these two almost the same concept? How the Bitcoin nodes calculate the chain with the greatest amount of work? Would we even know if that has happened? Doesn't this jeopardise Satochi's initial idea of a currency for small transactions free of charge? Is this transaction fee a percentage or a fixed rate? The miners need to be rewarded for their work. In bitcoin that is accomplished via the mining reward and transaction fees. As the mining reward gets smaller (it halves approximately every 4 years), transaction fees will increasingly become the way miners get paid. The transaction fees are voluntary and set by the person that wants to execute the transaction. Nevertheless miners are not obliged to accept a specific transaction and include it in the block. Therefore transaction fees work as an incentive on the part of the bitcoin user to make sure that a specific transaction will be included in the next block. Here, I believe escrows can only help the buyers but merchants still have the problem of not getting paid with escrows. The purpose of the timestamp server is to prove (or disprove) the existence of a piece of data at a certain point in time. To do that the timestamp server calculates the hash of the data and publishes it widely. The timestamp server is therefore a series of $(hash, timestamp)$ pairs. One can confirm the existence of a piece of data at a certain point in time by recomputing the hash of the data and checking it against the one published by the timestamp server. **Reversible Transactions** Credit card payments are monitored by a central authority (the credit card networks). The central authority reserves the right to reverse a transaction under some situations - e.g. fraud. Being able to reverse a transaction can be useful in some situations but it also has some disadvantages. The reversible nature of credit card payments puts businesses at risk of charge-back fraud - e.g. a consumer initiates a payment reversal by falsely claiming that the item they bought was never delivered. Merchants can therefore lose the payment for the item after sending the item to the customer, and also have to pay a fee for the charge-back. Bitcoin transactions are non-reversible, meaning that after a transaction has been successfully completed there is no entity that can undo that transaction. In case it wasn't clear: Alice has 3 Bitcoins and wants to send Bob 1 of them. She generates a new identity Charlie and publishes the transaction -- 3 Bitcoins from Alice, 1 to Bob, 2 to Charlie. By only looking at the transaction, you would not be able to tell that the person behind "Charlie" is the same as the person behind "Alice," thus providing an additional layer of anonymity. Here the author describes a way to develop bitcoin clients that don't need to have the complete block chain on disk. The main reason for this would be to conserve disk space (e.g. perhaps you want to have a bitcoin client on your phone but you don't want it to take up multiple gigabytes of disk space). Using this scheme does make the user vulnerable to a specific type of [attack](http://sourceforge.net/p/bitcoin/mailman/message/28618979/), which is not possible if you have the entire blockchain locally. A [block](https://en.bitcoin.it/wiki/Block) is a record of a number of transactions in the bitcoin network. A block contains: * The transactions that happened during a period of time * A number of metadata fields such as: * Timestamp * Nonce (the solution to the proof-of-work problem) * The current difficulty (how hard it is to solve the proof-of-work problem) * Reference to the previous block * The root hash of the [Merkle tree](https://en.wikipedia.org/wiki/Merkle_tree) of all transactions in the block As it stands, the system is still vulnerable to double spending. Say that Owner 1 just completed the transaction to Owner 2. Right after he does this, nothing prevents him from approaching another person, Owner 4, and repeating the exact same process, reusing the funds he got from Owner 0. In order words, Owner 1 would do exactly the same thing he did for the transaction to Owner 2, but he would instead use Owner 4's public key. Doesn't the specific attack mentioned in that post still require amassing enough computing power to generate a substitute blockchain, and will affect you regardless of whether you do this pruning? As far as I understand, the argument metioned there is basically -- say the value of your transaction is small compared to the cost of generating an alternate blockchain without your transaction in it. Even then, an attacker may find it profitable to fool many others such as you at the same exact time, so that the combined profit from small transactions is greater than the cost of overtaking the network for a certain amount of time. As such, you cannot actually rely on the insignificance of your own transaction to assume that nobody would bother to undo it. As Mike Hearn says in the end, this seems to be discussing a different problem than the transaction pruning mentioned here. Consider an attacker that has paid some merchant, has had its transaction embedded in the block chain, but wishes to reverse it (after obtaining some goods in return). The attacker may then use the fact that nodes will adopt an alternative version of the block chain if it is longer than their current one. It can try to create a fork of the current chain that splits off just before the block containing his transaction, and extend this fork in the chain until it is longer than the current chain. Once published, this alternative chain will take over as the accepted version of events and the attacker's original transaction will be discarded along with the block that contained it. Each block contains a nonce that is hashed together with the actual data in the block to produce a final hash containing $n$ leading zeros. As noted above in the explanation of Hashcash, the greater $n$ is, the more exponentially hard it is to generate such a hash. The greater the difficulty, the more work has to be put into finding a nonce that generates such a hash. As such, by looking at the number of leading zeros there are, one can determine the difficulty and thus estimate the amount of work put into generating said blocks. So a single block with ten leading zeros for its hash would represent more work than ten blocks with one leading zero for their hashes. The risk that a digital currency can be spent twice. Double-spending is a problem unique to digital currencies because digital information can be reproduced relatively easily. Physical currencies do not have this issue because they cannot be easily replicated, and the parties involved in a transaction can immediately verify the bona fides of the physical currency. With digital currency, there is a risk that the holder could make a copy of the digital token and send it to a merchant or another party while retaining the original. Read more: Double-Spending Definition | Investopedia https://www.investopedia.com/terms/d/doublespending.asp#ixzz50lZqicke Daniel, lets say there is t1, t2 and t3 transactions were made at 10 min. When two nodes create the blocks, both of the block will contain t1, t2 and t3, only the order might be differ. Even if one of them fails, all the transactions will be processed, of course if the transactions are valid. I don't get it, is there a single chain in order, where Owner 1 needs to prove that got the same amount of money from Owner 0, to be able to transfer the same amount to Owner 2? Exactly, the transactions are basically chained together with the last person being the current owner of the transaction chain, i.e the only one who can spend the transaction. He can prove to be the rightful owner of this transaction by signing it with his private key. Only then is he able to spend it, e.g. by sending it to the next person. Here I give a quick overview of a few concepts important for a good understanding of bitcoin. **Public-keys and Private-keys** The concept of public-key and private-key come from Public-key cryptography. Public-key cryptography is a set of cryptographic protocols based on algorithms that require two separate keys: - Private-key - which as the name indicates is meant to be secret - Public-key - which is public / visible to others These two keys are mathematically linked. In public-key cryptography the public key is used to encrypt plaintext, where the private key is used to decrypt cipher text. Every node in the bitcoin network has a public-key and a private-key. **Digital Signatures** Digital signatures make heavy use of public-key cryptography. You can think of a digital signature as somewhat similar to a physical signature. A digital signature is also used to prove the authenticity of a document/digital message. A digital signature binds an identity to a message. Only the person with the private key can produce valid signatures. Anybody with access to the public key can test the validity of the signatures. Say alice wants to digitally sign a message *m*. In order to do that Alice must have: - Private-key (signing key) - $KEY_{private}$ - Public-key (verification key) - $KEY_{public}$ Alice then uses the *signing* function to produce a valid signature: $$signing(message, KEY_{private}) \rightarrow signature$$ Don't worry about the internals of the *signing* function. What you need to know is that it takes a *message* and the Private-key and it will produce a signature (a short string). Again, only a person who possesses a private key can produce a valid signature. Anyone can use the public key to verify the signature: $$verify(m,signature,KEY_{public}) \rightarrow true\ or\ false$$ **Hash Functions** A hash function takes a string of characters of arbitrary length (called message) and maps it to another string of characters of fixed length (called a hash value or simply hash). Bitcoin uses a hash function called SHA-256. Let's look at an example: $$SHA-256(fermat) = 5e494e69...139dab5e$$ In this example the input/message is 'fermat' and the output/hash is 32 byte hash (I omitted part of the hash). Note that the length of the output/hash is always the same regardless of the size of the input. If you are an OS X user you can compute the SHA-256 hash value of 'fermat' by running the following command in your terminal: ``` echo -n fermat | shasum -a 256 ``` Here are 4 properties of a hash function that are important to note: - it is easy to compute the hash value for any given message - it is infeasible to generate a message from its hash - it is infeasible to modify a message without changing the hash - it is infeasible to find two different messages with the same hash. This diagram can be hard to understand at first. The diagram is illustrating the transaction flow from Owner 0 to Owner 1 to Owner 2. The idea is that before Owner 2 can accept the transaction from Owner 1, Owner 1 needs to show proof that he is entitled to the funds. In this case, that proof is a record showing that Owner 1 got the funds from Owner 0. In the first transaction box of the diagram we can see that Owner 0 takes the previous transaction (arrow coming from the left), adds Owner 1's public key (the public key of the person Owner 0 wants to transfer funds to) and hashes the result. The output of the hash is then digitally signed by Owner 0 using his private key (which proves that Owner 0 was indeed the person that put together the transaction). Then Owner 0 sends this transaction to Owner 1. Owner 1 follows the same process and sends the transaction to Owner 2. *Hashcash* is a proof-of-work system that can be used for instance to fight email spam. The idea is that in order to send an email the sender has to spend some CPU resource (i.e. perform a costly operation) to come up with a value that is attached to the email header. This will not affect you much if you are a regular user using email in a legitimate way. However, a spammer, who might be sending millions of emails per day, cannot afford to spend the aggregate amount of CPU power necessary to send all of those emails (it would just be too expensive to have that many computers computing all of the proofs of work necessary to send the emails) In a proof of work you usually have a challenge string *c* and you are looking for a nonce *n* such that $hash(c + n)$ will result in a string with a certain number of leading zeroes. Let's say our challenge string was *"Hello, world!"* and our target was to get a *SHA-256* hash beginning with '000'. One way to go about it is to start with a nonce of '0' and progressively increment it until you get an hash starting with '000'. In this case that would take 4251 tries (which happens to have 4 leading zeroes): ``` SHA-256("Hello, world!0") = 1312af17... SHA-256("Hello, world!1") = e9afc424... ... SHA-256("Hello, world!4249") = c004190b... SHA-256("Hello, world!4250") = 0000c3af... ``` Computing 4251 hashes on a modern computer is not that much work, however you can easily ramp up the difficulty by increasing the leading number of zeroes required for the proof of work. I believe the escrow service can be designed in a way that it also protects the seller if all parties which physically participate in the transaction are involved. If we take for example a product delivery, we could design a multisigniture escrow where the buyer and the seller have to sign a transaction to be valid. In this case of course the buyer could just claim to have never received the package and thus not pay the seller despite package delivery. Changing this to include all participants, that is, the buyer, the seller and the delivery service offers the possibility to make a 2 out of 3 multisigniture escrow. If the seller and the delivery service both claim to have delivered the product the transaction becomes valid. There should be no incentive for the delivery service to cheat or cooperate with the seller to trick the buyer, besides the possibility of just an incapable delivery employee (But this is outside of the scope of Bitcoin). Also more strict definitions of delivery (you have to sign-off when delivered) and just plain use of modern day technology (packing stations) should avoid lost packages. But this is again outside of the scope of Bitcoin itself. One could argue that the delivery service is a third party in this case (where Bitcoin tries to be purely peer-2-peer). But I would say, that there is no third party involved in the payment process (as promised by Bitcoin), but purely in the physical delivery process. And just like in the physical transaction it acts as a checkpoint that the product was delivered correctly, it acts like a checkpoint on the multisigniture escrow.

redpajama_set_name: RedPajamaCommonCrawl


Why did this stick with me? Well, as a physical educator, often times I see that students fear making mistakes. They fear trying something new or looking foolish should they not be able to immediately master a skill. And with their peers watching there is an extra sense of pressure and urgency to do it right. Certainly not effective grounds for building the confidence that they need to succeed in our classes. What results much of the time is that students either shut down and refuse to participate or they have a dismissive attitude which can be interpreted as them being bored or not caring when in fact this is simply not the case at all.
Gyorgy's quote makes me reflect on my own pattern of teaching and to ensure that I am constantly creating a warm and inviting environment that allows students to learn at a pace that they can handle, but challenges them at the same time. Getting them to understand that courage is about taking risks and success comes over time, provided effort and determination are ever present. Teaching our students that courage is only the accumulation of small steps will help to alleviate the unnecessary pressure that they may feel which can greatly slow development and learning.


Hersheypark in Hershey, Pennsylvania, had simple beginnings in 1907 It was built by Milton Hershey, owner of the eponymous confection company, as a place for his employees to picnic, relax or take a boat ride. The year 1923 saw the construction of the park's first roller coaster, and a water flume ride was added in 1933. Today anyone, Hershey employee or not, can explore the park, which offers thrill rides such as roller coasters, a water park and ZooAmerica, a wildlife park. Within three miles of the park are five hotels with pleasing accommodations and pools.
One of the official resorts of the park is the Hotel Hershey (thehotelhershey.com). This hotel, just one mile from the park, offers guest rooms, suites and cottages with free wireless Internet, flat screen televisions with DVD players, refrigerators and single-cup coffeemakers. Indoor fun includes swimming in the pool or letting the kids in the wading pool while outdoor fun includes a pool with two water slides and a children's play area. Guests can even ice skate year-round at the all-weather rink. The hotel has several eateries, from the full-service Circular Dining Room, confections at Sweets or drinks and appetizers at the Iberian Lounge. Stop by the on-site spa for a massage or beauty treatment or enjoy the free seasonal shuttle to the park. Other local attractions include ZooAmerica and Hershey Stadium.
In downtown Hershey is the Days Inn (daysinnhershey.com). The hotel features standard guest rooms with free Wi-Fi, televisions, laptop safes, microwaves and refrigerators or upgrade to a deluxe guest room which also have wet bars. Pet-friendly rooms are also available. Swim in the heated indoor pool, use the exercise room, play in the game room or use the guest laundry. Start the day with a complimentary continental breakfast, enjoy free access to the nearby Gold's Gym Hershey or take advantage of the complimentary seasonal shuttle to the park. Area restaurants include Fenicci's of Hershey and Breads N Cheese. Area attractions include Hershey Theatre and Dutch Wonderland.
Three miles from the park and another official resort of the park is the Hershey Lodge (hersheylodge.com). The lodge offers guest rooms and suites with free wireless Internet, coffeemakers, refrigerators, flat screen televisions and chocolate-inspired décor. Swim in the heated indoor pool or the two outdoor pools, which are open seasonally. Play in the game room, explore the outdoor playground or work out in the fitness room. Start your day with breakfast at the on-site Lebbie Lebkicher's and enjoy lunch or dinner at either the Bear's Den or the Hershey Grill. The lodge offers a free seasonal shuttle to the park. Local attractions include Chocolate World and Hershey Giant Center.
Another downtown Hershey hotel is the Hampton Inn & Suites (hamptoninn.hilton.com). This hotel features guest rooms and suites with high-speed Internet access, refrigerators and other basic amenities. Partake in a free breakfast, shop at the 24-hour market, use the coin-operated laundry or take a dip in the pool. Nearby restaurants include Red Robin Gourmet Burgers and the Hershey Pantry. Area attractions include Indian Echo Caverns and the Hershey Arena.
Two miles away from the park is the Comfort Inn (comfortinn.com). This hotel offers non-smoking guest rooms with complimentary Wi-Fi. Rooms with refrigerators and microwaves are also available. Enjoy a complimentary hot breakfast, swim in the heated indoor pool, use the guest laundry room or use the guest business center. Nearby dining options include the Panera Bread Company and Bob Evan's Restaurant. Local attractions include Hershey Gardens and the Hershey Museum.
Gleba, Kris. "Hotels Near Hersheypark, Pennsylvania With a Pool." Travel Tips - USA Today, https://traveltips.usatoday.com/hotels-near-hersheypark-pennsylvania-pool-53963.html. Accessed 25 April 2019.
Wild Mouse ride at Hersheypark, Hershey PA, US. Taken from beneath ride on exit path looking up.
Lightning Racer at Hersheypark, Hershey PA, US. View of the loading station with the primary lift hill behind it. The two trains are about to descend down the first hill. Taken from the ferris wheel. Image was cropped.
Roller Soaker roller coaster at Hersheypark.


First of all, you will need to log in to your Catch account, then you will be able to change your email address, password, newsletter subscriptions or delivery address details.
You can add an address (or multiple addresses) by clicking "Add new address".
You can delete a saved address by clicking on the "X".
You can click "Edit Address" if you need to update an existing address.
Or, you can click "Set as primary" to save your first choice delivery address.
Make sure you hit the "Save" button to save your changes.
If you have already placed an order that contains MarketPlace items, please contact the seller directly via your account to request this change. To ensure your request has been updated, you must receive confirmation from the seller directly.
Please note that if you change the email address linked to your Catch account you will receive an email from us to your previous email address, notifying you of this change. This is a security feature that we have in place to ensure that no one is able to change your personal details without your permission. If you are aware of this change, please disregard our email.
Your account details can be updated as often as you need.


A new, thoughtful and inspired mixed-use community, Essex Landing will be a unique village with exciting amenities and a nod to the rich history of both Saugus and Essex County. Residents will be able to eat, sleep, and play with dramatic views overlooking Boston. The development will feature first-class retail offerings to make daily life easy along with restaurants and bars that entice you to come in, dynamic fitness offerings, and ample outdoor space to run or walk your dog; Essex Landing will be the most sought after community to call home. Units feature open-concept floor plan, spacious master bedroom & closets with built-in storage systems, black stainless steel appliances, quartz counter tops, expansive views, parking, more!Short walk to bus stop and easy access to subway.
Residents will be able to eat, sleep, and play with dramatic views overlooking Boston and the Atlantic Ocean. The development will feature first-class retail offerings to make daily life easy. And with restaurants and bars that entice you to come in, dynamic fitness offerings, and ample outdoor space to run or walk your dog; Essex Landing will be the most sought after community to call home.
I'm interested in Essex Landing. Please send me current availability and additional details.


In regards to the theme of action verses inaction, Hamlet plays an instrumental role in the play. In order to explore this theme, Hamlet is unable to take action. However, Shakespeare uses other characters in the play such as Fortinbras and Laertes. These two characters capably execute revenge. The first one travels many miles to succeed in taking over Denmark, while the latter, plots the death of Hamlet following the demise of his father, Polonius. In fact, Hamlet is one of the most remarkable plays that explores about feelings of cultural identity that is represented through the isolated character, Hamlet. Hamplet after being commanded by his father's ghost to take action, he fails to do so. This creates conflict of responsibility and lack of respect to his father and the community. Following the agitated murder of Hamlet's father bring him isolation, thus, making him unable to react over the demise of his dad (Barnet 19). However, he delays to act, but when he acts he does so with indecisiveness. As a son, the first duty to from a son whose father has been murdered is to find the murderer and punish him accordingly.
When reading this play, the reader realizes that Hamlet is a king in waiting and if he follows his dad's wish, the society is likely to support him. However, being a king demands for safety and security of the people and he must also ensure that there is stability in his Kingdom. To this point, we revisit Hamlet's use of soliloquy after he had met the ghost earlier on. If one reviews the "To be or not to be" soliloquy, one realizes how Shakespeare develops this theme of action verses inaction (Barnet 18). In fact, Hamlet is directed to take retaliation, which he acknowledges as a son. It is worth noting that Hamlet's vengeance is ineffectual because after concurring that he is going to act, he delays any action until the play ends. This is not a common feature in other revenge tragedies. Nonetheless, it is true that Shakespeare uses this delay in building Hamlet's emotional and psychological complexity.
Just like Hamlet's move of not taking any vengeance or action against the killers of his father affects him negatively, it also doesn't work out for other characters that happens to take vengeance. This clearly presents to the reader, how Hamlet is complicated and interesting. While it is a fact that Hamlet does not act and many characters act, this action by other character does not work out in their favor. For instance, the plot by Claudius backfires, Laertes is manipulated and finally killed by his own treachery, and Gertrude marries her husband's murderer and dies for it. Eventually, Hamlet fails to take action and fails to provide merits and demerits of action verses inaction (Barnet 27). Instead, one may conclude that this play makes a sceptical implication that there is just a single result of both action and inaction, demise. Presently, this story about a man who is incapable to act is a tool that that contributes to ideals of values and morality. Hamlet's downfall is also a definite asset of improving the society, and teaches about being empathetic to others.


DRSC/TRiP-FGR Director S. Mohr will be presenting on our technologies at 10th annual Flies on the Beach group meeting. Big thanks to meeting founder and organizer, Grace Zhai of the University of Miami's Miller School of Medicine.
The DRSC-Functional Genomics Resources (formerly DRSC & TRiP) will be participating in the Boston Area Drosophila Meeting, which was organized by Alexey Verakas of UMass Boston and Jim Walker of Harvard Medical School. Hear about what's new in technologies and online tools at this regional meeting of experts in Drosophila research.


text:
Q: Плавающая точка (float числа) IEEE-754 как пофикси? Как избавится от проблем формата IEEE-754, который создаёт проблемы с записью числа:
4.3-3=1.2999999999999998

0.1+0.2=0.30000000000000004

Как мне избавится от этих проблем?

A: Никаких проблем нет:

*

*Для вывода результатов нужно использовать форматирование.

*Для сравнения использовать допустимую погрешность.

*Для денег использовать специальный тип.

*В каких-то случаях можно использовать целые числа вместо вещественных.

A: Я бы лично для таких ситуаций просто использовал числа по больше, вот пример:

class CorrectFloat {
  constructor(x) {
    this.x = +x || 0
  }

  increase(y) {
    return correctFloat(((this.x * 1e3) + (y * 1e3)) / 1e3)
  }

  decrease(y) {
    return correctFloat(((this.x * 1e3) - (y * 1e3)) / 1e3)
  }

  get() {
    return this.x
  }
}

function correctFloat(n) {
  return new CorrectFloat(n)
}

console.log('0.1 + 0.2 =', correctFloat(0.1)
  .increase(0.2)
  .get()
)

console.log('4.3 - 3 =', correctFloat(4.3)
  .decrease(3)
  .get()
)

Конечно с такими числами могут возникнуть проблемы, для примера, если число будет слишком большим, то тогда оно (число) не измениться вообще, но для таких ситуаций можно использовать BigInt, нужно будет создавать отдельный класс и функцию под это. Но если работать с не большими числами то всё будет работать вполне нормально. (Ну и где по меньше чисел после запятой :), в смысле после точки)


Thanks for taking the time to view our web store. We bring the best value for money and equipment available for recreation and leisure skaters. Whether you skate in the Roller Disco, in the park, commuting, fitness or leisure we have a pair of skates suitable for you. All our skates can be colour customised, offering you the perfect pair of quad skates to impress your friends.


Paul Gold's success is a testament to his knowledge and skill as an attorney. His past work as both judge and prosecutor has given him insight into the legal system that few defense attorneys have. He is well respected throughout the legal system and the Louisville community, which he has served for over 30 years. His experience and competence will give you confidence in his representation. Feel free to read a few of the testimonials on the home page of this website from former clients.
Wouldn't you want a former Judge and Prosecutor on your side? His experience and professionalism will give you confidence regarding case. If you have any questions or want to schedule a free consultation, please contact us and we will be happy to help.


Billy Ray Taylor, the Director of Commercial Manufacturing for Goodyear, spoke with CFE Media about his management style and the challenges and opportunities for plant managers.
Billy Ray Taylor is a visionary leader with more than 20 years of experience in all phases of manufacturing management and leadership. He has been repeatedly called upon to implement improvement strategies in under-performing operations, to improve production efficiency and employee engagement. As plant manager for a Goodyear 2.2 million sq-ft consumer tire manufacturing plant in Fayetteville, N.C., he was instrumental in achieving and sustaining significant productivity increases of over 18% in units in just six months with no additional cost or capital investment.
In June 2012, Taylor was appointed Director, Commercial Manufacturing. He now oversees operations at four commercial tire manufacturing plants in Buffalo, N.Y.; Danville, Va.; Social Circle, Ga.; and Topeka, Kan.
Previously, Billy led numerous manufacturing teams as a plant, production, and business center manager for Goodyear Tire and Rubber, consistently improving performance across all areas of production efficiency, labor costs, quality and safety, resulting in his teams winning numerous internal and external awards and recognition.
Taylor holds a MBA from Baker University and a bachelor's degree in electrical engineering from Prairie View A+M University. Throughout his career, Taylor has attended a range of leadership development and six sigma certification programs and has also been certified in Toyota Lean Manufacturing in Shirakawa, Japan. He spoke with CFE Media about his management style and the challenges and opportunities for plant managers.
CFE: One of the principles in Stephen Covey's book, "The 7 Habits of Highly Successful People" is to "begin with the end in mind." When you arrived at the Goodyear plant Fayetteville, N.C., what was the end that you were trying to achieve?
Taylor: To build a high performance self sustaining culture that would continue to evolve and yield value to the customer even after I exited the organization. The challenge when I first arrived in Fayetteville was that we were not meeting our goals and objectives to create sustainable economic value. People were not visible in the continuous improvement process.
My goal was to foster an environment where everyone is a CEO, an environment where individuals own the team's results.
CFE: You have talked about empowering your employees. Talk about the large and small ways that empowerment took place.
Taylor: Fayetteville has a unionized workforce. We communicated, with facts, our competitive position and where true north was in a market back strategy. We wanted the workforce's input on the strategy and methods of execution; the "HOW" we get there.
At the onset, I started having two plant manager roundtable meetings five days a week with 25 people at a time, one at 6:15 a.m. and one at 2:15 p.m. to explain the business case for change and the importance of personal ownership. We cycled through the entire workforce. They could ask me anything they wanted to ask me.
A continuous improvement process was introduced right at the beginning whereby individuals from the shop floor presented their completed projects to senior management in twice-weekly meetings where they were recognized with medals of achievement. "When we first started in 2010, participation was about 38 associates a month. In 2011, we averaged 262 associates participating a month. In 2012, it is currently up to 532 people on average. This year we will complete over 756 different projects. These improvements netted significant quality, efficiency, and financial savings.
One small engagement project was issuing everyone a custom football jersey. The jersey had the productivity goal as the player number, mission and vision as the player name, company and union logo on the sleeve as the player league, and the plant team name on the front. As we issued individuals a jersey, we communicated the significance of the jersey defining true north. With this simple project, we aligned and united everyone behind a common critical goal.
CFE: You shared statistical goals with all of your employees – both production goals and financial goals. In successful plants we've been in, that also takes place. Why is that important to a successful operation? Conversely, why don't more plant managers do it?
Taylor: "Knowledge is power" and for people who are motivated by power, that is where the quote stops. However, I believe that knowledge is power and shared knowledge is more powerful.
People want to know the score—what does winning look like? What is the end goal in mind? This affects how people, think, feel and act our mindsets and behaviors. We instituted what is called Red/Green boards on all equipment. This enabled every associate not only to know the score, but keep score of their personal contributions to the enterprise goals and objectives.
Some leaders understand the need for change and empowerment, but fear relinquishing control and specific information to the shop floor due to a perceived loss of power. "Leaders must be willing to build a culture that trusts, encourages and supports their employees to be innovative, to experiment with change, to take risks, and to learn from failures." In short bosses tell people what to do, leaders empower so people can do.
CFE: What were the tough choices and challenges in Fayetteville? What was the toughest decision you had to make in your time there?
Taylor: The choice to trust the organization and recognize that some failures are innovative opportunities. We committed to support, encourage, and embrace the true experts that reside on the shop floor.
Also, we made the decision to get the right people in the right chair. Old paradigms are hard to change, so sometimes you must change those in position to execute new evolutionary paradigms.
CFE: The statistics you achieved in Fayetteville – an almost 20% improvement in production without an increase in staff – are simply remarkable. To what do you attribute your success, and the success of your team?
Taylor: The engagement and empowerment of the organization as a whole, from the janitor to senior staff, everyone is a CEO of their specific job function. I attribute the success and sustainment to alignment of the organization; linking tools, systems, and behaviors to drive results through strategic deployment and tactical execution.
CFE: When you left Fayetteville this year for your promotion to Goodyear's Akron headquarters, the local press gave you high marks not just for your efforts inside the plant, but for your community involvement. Why is that important for a plant manager? How did it benefit you in your job and in reaching your goals?
Taylor: The community is the workforce. You don't hire the associate, you hire the family. By being an organization that is active in the community, you become a fixture that people respect and are proud to be associated with. People make you successful, I believe when you make people visible, they make you valuable. By being visible in the community, they value the organization as a whole.


text:
Q: confused as how to use componentsSeparatedByString on iphone after nsXml pasring value of my NSMutable array    AB
=\n\n\n\thttp://xyz.com/uploads/resto_6298__20091209@1621_250.JPG\n\thttp://xyz.com/uploads/resto_6298__200912099_2_250.JPG\n"

now i am doing this to make this url working
NSString *sw=AB;

NSArray *strings = [sw componentsSeparatedByString: @"\n\t"];
NSLog(@"what I have %@",strings);

but my app always crash and i am getting this error
[NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x1b28b0
2010-10-05 10:17:31.382 Wat2Eat[2311:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x1b28b0'

how to parse this AB so that i can extract exact URL

A:
NSString *sw=AB;

AB is an NSMutableArray?
the compiler should print a warning if you try to do this. You tried to assign an NSArray to an NSString. This will not work.
Did you mean NSString *sw = [AB objectAtIndex:foo]; ?


If you want to lose weight the graceful and non-stressful way, then swimming for weight loss will be the perfect solution to that heavy problem of yours. Swimming can be a wonderful form of exercise. It uses almost all the major muscle groups, and places a vigorous demand on your heart and lungs. You can train to swim at a competitive level or you can enjoy a few healthy lengths at your local pool; you decide how much you want to achieve in swimming and set your own pace.
Swimming burns calories, so helps you lose weight and swimming for weight loss has been regularly praised for its cardiovascular health benefits, especially for older people.
Plus the swimmers weight gain could be attributed to an increase in lean muscle mass, which would have changed their body composition without weight loss.
Swimming is an all-around great workout for cardio and strength. Also, since most people don't like to bulk up with muscle, swimming is the perfect physical activity for building lean, toned muscle.
It's also a great way to relax and loosen up the body. If you have a lot on your mind, a leisurely swim is a wonderful way to de-stress. Stiff joints or muscles? A good swim is the answer to loosen up and stretch those muscles.
Even if you do not know how to swim, a pool can help you get an effective calorie-burning workout. Deep water walking burns more calories than walking on solid ground because of the resistance of the water. Water fitness classes also provide an opportunity to exercise in a group setting, without the impact of traditional aerobics.
Regular swimming when losing weight will improve your health and may reduce the risk of chronic illnesses, such as heart disease, type 2 diabetes and stroke.
When you do finish a swim workout, take a sauna, a steam, hot tub, or a hot shower to help heat your body. Also try sipping on some hot herbal tea as a post-workout drink.
Lastly, keep in mind that being overweight is the major cause of many serious and fatal diseases, so its not just about looking and feeling better, but actually having better health overall. Swimming can be a fun activity to add to your workout routine, whether you're a novice or a master. Enjoy!