0.1.153 • Published 4 years ago

omp-lib v0.1.153

Weekly downloads
162
License
MIT
Repository
-
Last release
4 years ago

OPEN MARKET PROTOCOL

The reference implementation for the Open Market Protocol

Note: the documentation is very outdated for the private message format.

MPA FUNCTIONS

* build(..MPA_*):  rebuilds the transaction for a given and spits outs the rawtx.
* validate(MPA_*): validate that a marketplace action conforms to the protocol.
* verify(..MPA_*): verifies a _chain_ of MarketPlaceActions.
* strip(MPA_*):  strip any fields that do not belong in the protocol (simple: delete all that start with "_").

* create(MPA_LISTING_ADD): returns MPA_BID.
* accept(MPA_LISTING_ADD, MPA_BID): returns MPA_ACCEPT (partially signed destruction tx, partially signed release tx).
* lock(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT): make this also create the release tx. returns MPA_LOCK. (signed destruction tx, partially signed bix txn)
* complete(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed bid rawtx for the seller.
* release(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed release rawtx for the buyer.
* refund(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed refund rawtx for the seller.

Format validators

The format validators can be found in the src/format-validators directory. These purely validate:

  • required fields
  • the right types (string, number, ..)
  • non-negative fields

Sequence verifiers

The sequence verifiers can be found in the src/sequence-verifiers directory. These purely verify that the provide sequence of actions is correct:

  • validate format of action first
  • check the sequence to verify that the order is correct (e.g. no bids before listing)
  • verify that the sequence linked by the hashes is correct
  • verify that the cryptocurrency in the bid is allowed in the listing
  • verify that the escrow type over the sequence doesn't change

Deterministic transaction generation

Given a sequence of MPA's (marketplace actions), the resulting transaction generated by this library should be identical, byte-for-byte. The library rebuilds the transactions and stores a state of (potentially incomplete) transactions in the private fields of a message.

Private fields

Additional fields can be supplied by the database with an "_", these should be stripped out using strip(). We only use these when building transactions.

Testing

Run the test environment by running: python3 particl-test-env.py

Then run the test with: yarn test

0.1.153

4 years ago

0.1.152

4 years ago

0.1.151

4 years ago

0.1.150

5 years ago

0.1.149

5 years ago

0.1.148

5 years ago

0.1.147

5 years ago

0.1.146

5 years ago

0.1.143

5 years ago

0.1.145

5 years ago

0.1.144

5 years ago

0.1.142

5 years ago

0.1.141

5 years ago

0.1.140

5 years ago

0.1.139

5 years ago

0.1.138

5 years ago

0.1.137

5 years ago

0.1.135

5 years ago

0.1.134

5 years ago

0.1.133

5 years ago

0.1.132

5 years ago

0.1.129

5 years ago

0.1.131

5 years ago

0.1.130

5 years ago

0.1.128

5 years ago

0.1.127

5 years ago

0.1.126

5 years ago

0.1.125

6 years ago

0.1.124

6 years ago

0.1.123

6 years ago

0.1.122

6 years ago

0.1.121

6 years ago

0.1.120

6 years ago

0.1.119

6 years ago

0.1.118

6 years ago

0.1.117

6 years ago

0.1.116

6 years ago

0.1.115

6 years ago

0.1.114

6 years ago

0.1.113

6 years ago

0.1.112

6 years ago

0.1.111

6 years ago

0.1.110

6 years ago

0.1.109

6 years ago

0.1.108

6 years ago

0.1.107

6 years ago

0.1.106

6 years ago

0.1.105

6 years ago

0.1.104

6 years ago

0.1.103

6 years ago

0.1.102

6 years ago

0.1.101

6 years ago

0.1.100

6 years ago

0.1.99

6 years ago

0.1.98

6 years ago

0.0.97

6 years ago

0.1.96

6 years ago

0.1.95

6 years ago

0.1.94

6 years ago

0.1.93

6 years ago

0.1.92

6 years ago

0.1.91

6 years ago

0.1.90

6 years ago

0.1.89

6 years ago

0.1.88

6 years ago

0.1.87

6 years ago

0.1.86

6 years ago

0.1.85

6 years ago

0.1.84

6 years ago

0.1.83

6 years ago

0.1.82

6 years ago

0.1.81

6 years ago

0.1.80

6 years ago

0.1.79

6 years ago

0.1.78

6 years ago

0.1.77

6 years ago

0.1.76

6 years ago

0.1.75

6 years ago

0.1.74

6 years ago

0.1.73

6 years ago

0.1.72

6 years ago

0.1.71

6 years ago

0.1.70

6 years ago

0.1.69

6 years ago

0.1.68

6 years ago

0.1.67

6 years ago

0.1.66

6 years ago

0.1.65

6 years ago

0.1.64

6 years ago

0.1.63

6 years ago

0.1.62

6 years ago

0.1.61

6 years ago

0.1.60

6 years ago

0.1.59

6 years ago

0.1.58

6 years ago

0.1.57

6 years ago

0.1.56

6 years ago

0.1.55

6 years ago

0.1.54

6 years ago

0.1.53

6 years ago

0.1.52

6 years ago

0.1.51

6 years ago

0.1.50

6 years ago

0.1.49

6 years ago

0.1.48

6 years ago

0.1.47

6 years ago

0.1.46

6 years ago

0.1.45

6 years ago

0.1.44

6 years ago

0.1.43

6 years ago

0.1.42

6 years ago

0.1.41

6 years ago

0.1.40

6 years ago

0.1.39

6 years ago

0.1.38

6 years ago

0.1.37

6 years ago

0.1.36

6 years ago

0.1.35

6 years ago

0.1.34

6 years ago

0.1.33

6 years ago

0.1.32

6 years ago

0.1.31

6 years ago

0.1.30

6 years ago

0.1.29

6 years ago

0.1.28

6 years ago

0.1.27

6 years ago

0.1.26

6 years ago

0.1.25

6 years ago

0.1.24

6 years ago

0.1.23

6 years ago

0.1.22

6 years ago

0.1.21

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.10.1

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago