Skip to content

Commit 0c870e6

Browse files
FAB-6621 fix endorsement policy doc
Endorsement policy doc was misleading because it included syntax not yet supported. Removed it for clarity. Can be added back when the capability is introduced. Change-Id: I38052f9d11c7d40a97c3a0786ba6fc7cf680037c Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
1 parent 5360ccc commit 0c870e6

File tree

1 file changed

+22
-51
lines changed

1 file changed

+22
-51
lines changed

docs/source/endorsement-policies.rst

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,16 @@ transaction, it invokes the VSCC (Validation System Chaincode)
77
associated with the transaction's Chaincode as part of the transaction
88
validation flow to determine the validity of the transaction. Recall
99
that a transaction contains one or more endorsement from as many
10-
endorsing peers. VSCC is tasked to make the following determinations: -
11-
all endorsements are valid (i.e. they are valid signatures from valid
12-
certificates over the expected message) - there is an appropriate number
13-
of endorsements - endorsements come from the expected source(s)
10+
endorsing peers. VSCC is tasked to make the following determinations:
11+
12+
- all endorsements are valid (i.e. they are valid signatures from valid
13+
certificates over the expected message)
14+
- there is an appropriate number of endorsements
15+
- endorsements come from the expected source(s)
1416

1517
Endorsement policies are a way of specifying the second and third
1618
points.
1719

18-
Endorsement policy design
19-
-------------------------
20-
21-
Endorsement policies have two main components: - a principal - a
22-
threshold gate
23-
24-
A principal ``P`` identifies the entity whose signature is expected.
25-
26-
A threshold gate ``T`` takes two inputs: an integer ``t`` (the
27-
threshold) and a list of ``n`` principals or gates; this gate
28-
essentially captures the expectation that out of those ``n`` principals
29-
or gates, ``t`` are requested to be satisfied.
30-
31-
For example: - ``T(2, 'A', 'B', 'C')`` requests a signature from any 2
32-
principals out of 'A', 'B' or 'C'; - ``T(1, 'A', T(2, 'B', 'C'))``
33-
requests either one signature from principal ``A`` or 1 signature from
34-
``B`` and ``C`` each.
35-
3620
Endorsement policy syntax in the CLI
3721
------------------------------------
3822

@@ -56,50 +40,37 @@ where ``EXPR`` is either ``AND`` or ``OR``, representing the two boolean
5640
expressions and ``E`` is either a principal (with the syntax described
5741
above) or another nested call to ``EXPR``.
5842

59-
For example: - ``AND('Org1.member', 'Org2.member', 'Org3.member')``
60-
requests 1 signature from each of the three principals -
61-
``OR('Org1.member', 'Org2.member')`` requests 1 signature from either
62-
one of the two principals -
63-
``OR('Org1.member', AND('Org2.member', 'Org3.member'))`` requests either
64-
one signature from a member of the ``Org1`` MSP or 1 signature from a
65-
member of the ``Org2`` MSP and 1 signature from a member of the ``Org3``
66-
MSP.
43+
For example:
44+
- ``AND('Org1.member', 'Org2.member', 'Org3.member')``
45+
requests 1 signature from each of the three principals
46+
- ``OR('Org1.member', 'Org2.member')`` requests 1 signature from either
47+
one of the two principals
48+
- ``OR('Org1.member', AND('Org2.member', 'Org3.member'))``
49+
requests either one signature from a member of the ``Org1`` MSP
50+
or 1 signature from a member of the ``Org2`` MSP and 1 signature
51+
from a member of the ``Org3`` MSP.
6752

6853
Specifying endorsement policies for a chaincode
6954
-----------------------------------------------
7055

7156
Using this language, a chaincode deployer can request that the
7257
endorsements for a chaincode be validated against the specified policy.
7358
NOTE - the default policy requires one signature from a member of the
74-
``DEFAULT`` MSP). This is used if a policy is not specified in the CLI.
59+
``DEFAULT`` MSP). This is used if a policy is not specified in the CLI
60+
when instantiating chaincode.
7561

76-
The policy can be specified at deploy time using the ``-P`` switch,
62+
The policy can be specified at instantiate time using the ``-P`` switch,
7763
followed by the policy.
7864

7965
For example:
8066

8167
::
8268

83-
peer chaincode deploy -C testchainid -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}' -P "AND('Org1.member', 'Org2.member')"
84-
85-
This command deploys chaincode ``mycc`` on chain ``testchainid`` with
86-
the policy ``AND('Org1.member', 'Org2.member')``.
69+
peer chaincode instantiate -C <channelid> -n mycc -P "AND('Org1.member', 'Org2.member')"
8770

88-
Future enhancements
89-
-------------------
90-
91-
In this section we list future enhancements for endorsement policies: -
92-
alongside the existing way of identifying principals by their
93-
relationship with an MSP, we plan to identify principals in terms of the
94-
*Organization Unit (OU)* expected in their certificates; this is useful
95-
to express policies where we request signatures from any identity
96-
displaying a valid certificate with an OU matching the one requested in
97-
the definition of the principal. - instead of the syntax ``AND(., .)``
98-
we plan to move to a more intuitive syntax ``. AND .`` - we plan to
99-
expose generalized threshold gates in the language as well alongside
100-
``AND`` (which is the special ``n``-out-of-``n`` gate) and ``OR`` (which
101-
is the special ``1``-out-of-``n`` gate)
71+
This command deploys chaincode ``mycc`` with the policy ``AND('Org1.member',
72+
'Org2.member')`` which would require that a member of both Org1 and Org2 sign
73+
the transaction.
10274

10375
.. Licensed under Creative Commons Attribution 4.0 International License
10476
https://creativecommons.org/licenses/by/4.0/
105-

0 commit comments

Comments
 (0)