0.1.153 • Published 3 years ago

omp-lib v0.1.153

Weekly downloads
162
License
MIT
Repository
-
Last release
3 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

3 years ago

0.1.152

3 years ago

0.1.151

3 years ago

0.1.150

4 years ago

0.1.149

4 years ago

0.1.148

4 years ago

0.1.147

4 years ago

0.1.146

4 years ago

0.1.143

4 years ago

0.1.145

4 years ago

0.1.144

4 years ago

0.1.142

4 years ago

0.1.141

4 years ago

0.1.140

4 years ago

0.1.139

4 years ago

0.1.138

4 years ago

0.1.137

4 years ago

0.1.135

4 years ago

0.1.134

4 years ago

0.1.133

4 years ago

0.1.132

4 years ago

0.1.129

4 years ago

0.1.131

4 years ago

0.1.130

4 years ago

0.1.128

4 years ago

0.1.127

4 years ago

0.1.126

4 years ago

0.1.125

4 years ago

0.1.124

4 years ago

0.1.123

4 years ago

0.1.122

5 years ago

0.1.121

5 years ago

0.1.120

5 years ago

0.1.119

5 years ago

0.1.118

5 years ago

0.1.117

5 years ago

0.1.116

5 years ago

0.1.115

5 years ago

0.1.114

5 years ago

0.1.113

5 years ago

0.1.112

5 years ago

0.1.111

5 years ago

0.1.110

5 years ago

0.1.109

5 years ago

0.1.108

5 years ago

0.1.107

5 years ago

0.1.106

5 years ago

0.1.105

5 years ago

0.1.104

5 years ago

0.1.103

5 years ago

0.1.102

5 years ago

0.1.101

5 years ago

0.1.100

5 years ago

0.1.99

5 years ago

0.1.98

5 years ago

0.0.97

5 years ago

0.1.96

5 years ago

0.1.95

5 years ago

0.1.94

5 years ago

0.1.93

5 years ago

0.1.92

5 years ago

0.1.91

5 years ago

0.1.90

5 years ago

0.1.89

5 years ago

0.1.88

5 years ago

0.1.87

5 years ago

0.1.86

5 years ago

0.1.85

5 years ago

0.1.84

5 years ago

0.1.83

5 years ago

0.1.82

5 years ago

0.1.81

5 years ago

0.1.80

5 years ago

0.1.79

5 years ago

0.1.78

5 years ago

0.1.77

5 years ago

0.1.76

5 years ago

0.1.75

5 years ago

0.1.74

5 years ago

0.1.73

5 years ago

0.1.72

5 years ago

0.1.71

5 years ago

0.1.70

5 years ago

0.1.69

5 years ago

0.1.68

5 years ago

0.1.67

5 years ago

0.1.66

5 years ago

0.1.65

5 years ago

0.1.64

5 years ago

0.1.63

5 years ago

0.1.62

5 years ago

0.1.61

5 years ago

0.1.60

5 years ago

0.1.59

5 years ago

0.1.58

5 years ago

0.1.57

5 years ago

0.1.56

5 years ago

0.1.55

5 years ago

0.1.54

5 years ago

0.1.53

5 years ago

0.1.52

5 years ago

0.1.51

5 years ago

0.1.50

5 years ago

0.1.49

5 years ago

0.1.48

5 years ago

0.1.47

5 years ago

0.1.46

5 years ago

0.1.45

5 years ago

0.1.44

5 years ago

0.1.43

5 years ago

0.1.42

5 years ago

0.1.41

5 years ago

0.1.40

5 years ago

0.1.39

5 years ago

0.1.38

5 years ago

0.1.37

5 years ago

0.1.36

5 years ago

0.1.35

5 years ago

0.1.34

5 years ago

0.1.33

5 years ago

0.1.32

5 years ago

0.1.31

5 years ago

0.1.30

5 years ago

0.1.29

5 years ago

0.1.28

5 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.10.1

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago