diff --git a/rfc/0010_Duniter_Blockchain_Protocol_V12.md b/rfc/0010_Duniter_Blockchain_Protocol_V12.md index 4d56c009e9daa7f24cd78116613f817c8419de6f..54c97abbb093313f57dbbb8d4c2c9c5714b0e0fb 100644 --- a/rfc/0010_Duniter_Blockchain_Protocol_V12.md +++ b/rfc/0010_Duniter_Blockchain_Protocol_V12.md @@ -438,7 +438,7 @@ A Transaction structure is considered *valid* if: * `IN_INDEX` must be an integer value * `UL_CONDITIONS` must be a valid [Input Condition](#input-condition) * Field `Outputs` is a multiline field whose lines follow `AMOUNT:BASE:CONDITIONS` format: - * `AMOUNT` must be an integer value + * `AMOUNT` must be an integer value. If `HEAD.version >= 12`, then `AMOUNT` must be greater than or equal to `100`. * `BASE` must be an integer value * `CONDITIONS` must be a valid [Output Condition](#output-condition) * Field `Comment` is a string of maximum 255 characters, exclusively composed of alphanumeric characters, space, `-`, `_`, `:`, `/`, `;`, `*`, `[`, `]`, `(`, `)`, `?`, `!`, `^`, `+`, `=`, `@`, `&`, `~`, `#`, `{`, `}`, `|`, `\`, `<`, `>`, `%`, `.`. Must be present even if empty. @@ -462,9 +462,11 @@ It follows a machine-readable BNF grammar composed of * `(` and `)` characters * `&&` and `||` operators -* `SIG(PUBLIC_KEY)`, `XHX(SHA256_HASH)`, `CLTV(INTEGER)`, `CSV(INTEGER)` functions +* `SIG(PUBLIC_KEY)`, `XHX(SHA256_HASH)`, `CLTV(INTEGER)`, `CSV(INTEGER)`, `DESTROY()` functions * ` ` space +**A condition that associates `DESTROY()` with other functions or operators is considered invalid.** + **An empty condition or a condition fully composed of spaces is considered an invalid output condition**. Also, the maximum length of a condition is 1000 characters. // TODO: OK? @@ -476,6 +478,7 @@ Also, the maximum length of a condition is 1000 characters. // TODO: OK? * `(SIG(HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd) && CSV(3600))` * `(SIG(HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd) && (CLTV(1489677041) || CSV(3600)))` * `(SIG(HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd) || (SIG(DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV) && XHX(309BC5E644F797F53E5A2065EAF38A173437F2E6)))` +* `DESTROY()` #### Condition matching @@ -829,6 +832,24 @@ Then the `25` units can be spent *exclusively* in a block whose `MedianTime - Tx `CSV`'s parameter must be an integer with a length between `1` and `8` chars. +##### DESTROY function + +###### Definition + +Lock: + + DESTROY() + +Unlock: no unlocking function. + +###### Condition + +`DESTROY()` always return false. + +###### Description + +This fonction lock an output for all eternity. This makes it possible to destroy money. + #### Compact format A transaction may be described with a more compact format, to be used in a [Block](#block) document. The general format is: @@ -1255,6 +1276,7 @@ A block cannot contain revocations whose signature does not match the revocation * A transaction cannot have `SIG(INDEX)` unlocks with `INDEX >= ` issuers count. * A transaction **must** have signatures matching its content **for each issuer** * Transaction's version must be equal to `10`. +* If `HEAD.version >= 12`, then `AMOUNT` of each output must be greater than or equal to `100`. * Signatures count must be the same as issuers count * Signatures are ordered by issuer * Signatures are made over the transaction's content, signatures excepted @@ -1420,7 +1442,7 @@ Each transaction input produces 1 new entry: consumed = true ) -Each transaction output produces 1 new entry: +Each transaction output for which `OUTPUT_CONDITIONS != DESTROY()` produces 1 new entry: SINDEX ( op = 'CREATE' @@ -2725,30 +2747,6 @@ For each `LOCAL_IINDEX[member=true] as IDTY` add a new LOCAL_SINDEX entry: consumed = false ) -###### BR_G106 - Low accounts - -Set: - - ACCOUNTS = UNIQ(GLOBAL_SINDEX, 'conditions') - -For each `ACCOUNTS as ACCOUNT` then: - -Set: - - ALL_SOURCES = CONCAT(GLOBAL_SINDEX[conditions=ACCOUNT.conditions], LOCAL_SINDEX[conditions=ACCOUNT.conditions]) - SOURCES = REDUCE_BY(ALL_SOURCES, 'identifier', 'pos')[consumed=false] - BALANCE = SUM(MAP(SOURCES => SRC: SRC.amount * POW(10, SRC.base))) - -If `BALANCE < 100 * POW(10, HEAD.unitBase)`, then for each `SOURCES AS SRC` add a new LOCAL_SINDEX entry: - - SINDEX ( - op = 'UPDATE' - identifier = SRC.identifier - pos = SRC.pos - written_on = BLOCKSTAMP - written_time = MedianTime - consumed = true - ) ###### BR_G92 - Certification expiry