├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── cmd └── tokenized │ ├── cmd │ ├── cmd_create_contract.go │ ├── cmd_create_instrument.go │ ├── cmd_create_transfer.go │ ├── cmd_decode.go │ ├── cmd_display_script.go │ ├── cmd_display_tx.go │ ├── cmd_gen_extended_key.go │ ├── cmd_gen_key.go │ ├── helpers.go │ └── main.go │ ├── main.go │ └── samples │ ├── entity_contract_offer.json │ ├── instrument_contract_offer.json │ ├── instrument_definition.json │ └── instrument_payload.json ├── dist ├── c++ │ ├── actions │ │ ├── actions.pb.cc │ │ └── actions.pb.h │ ├── instruments │ │ ├── instruments.pb.cc │ │ └── instruments.pb.h │ └── messages │ │ ├── messages.pb.cc │ │ └── messages.pb.h ├── csharp │ └── .gitkeep ├── golang │ ├── README.md │ ├── actions │ │ ├── actions.go │ │ ├── actions.pb.go │ │ ├── actions_test.go │ │ ├── amendments.go │ │ ├── amendments_test.go │ │ ├── article_depth_test.go │ │ ├── binary_marshal.go │ │ ├── binary_marshal_test.go │ │ ├── copy.go │ │ ├── equal.go │ │ ├── instruments_test.go │ │ ├── permission_templates.go │ │ ├── resources.go │ │ ├── terms_test.go │ │ ├── validate.go │ │ └── write_deterministic.go │ ├── instruments │ │ ├── amendments.go │ │ ├── amendments_test.go │ │ ├── binary_marshal.go │ │ ├── bond_test.go │ │ ├── copy.go │ │ ├── equal.go │ │ ├── instruments.go │ │ ├── instruments.pb.go │ │ ├── instruments_test.go │ │ ├── resources.go │ │ └── validate.go │ ├── internal │ │ └── amendment.go │ ├── messages │ │ ├── binary_marshal.go │ │ ├── copy.go │ │ ├── equal.go │ │ ├── messages.go │ │ ├── messages.pb.go │ │ ├── messages_test.go │ │ ├── resources.go │ │ └── validate.go │ ├── permissions │ │ ├── field_index_path.go │ │ ├── permissions.go │ │ └── permissions_test.go │ ├── print │ │ └── print.go │ └── protocol │ │ ├── authority.go │ │ ├── fee_test.go │ │ ├── fees.go │ │ ├── oracle.go │ │ ├── protocol.go │ │ └── protocol_test.go ├── java │ └── .gitkeep ├── json │ ├── action_examples.json │ ├── actions.json │ ├── instruments.json │ └── messages.json ├── markdown │ ├── protocol-actions.md │ ├── protocol-instruments.md │ ├── protocol-messages.md │ └── protocol-resources.md ├── objectivec │ └── .gitkeep ├── php │ └── .gitkeep ├── protobuf │ ├── actions.proto │ ├── instruments.proto │ └── messages.proto ├── python │ ├── actions_generated.py │ ├── actions_pb2.py │ ├── assets_pb2.py │ ├── instruments_pb2.py │ ├── messages_pb2.py │ └── protocol.py ├── ruby │ └── .gitkeep ├── swagger │ ├── actions │ │ ├── Addition.yaml │ │ ├── AdminIdentityCertificateField.yaml │ │ ├── AdministratorField.yaml │ │ ├── Alteration.yaml │ │ ├── AmendmentField.yaml │ │ ├── AssetCreation.yaml │ │ ├── AssetDefinition.yaml │ │ ├── AssetModification.yaml │ │ ├── AssetReceiverField.yaml │ │ ├── AssetSettlementField.yaml │ │ ├── AssetTransferField.yaml │ │ ├── BallotCast.yaml │ │ ├── BallotCounted.yaml │ │ ├── BodyOfAgreementAmendment.yaml │ │ ├── BodyOfAgreementFormation.yaml │ │ ├── BodyOfAgreementOffer.yaml │ │ ├── ChapterField.yaml │ │ ├── ClauseField.yaml │ │ ├── Confiscation.yaml │ │ ├── ConflictedSettlement.yaml │ │ ├── ContractAddressChange.yaml │ │ ├── ContractAmendment.yaml │ │ ├── ContractFormation.yaml │ │ ├── ContractOffer.yaml │ │ ├── DefinedTermField.yaml │ │ ├── Deprecated Reconciliation.yaml │ │ ├── DeprecatedReconciliation.yaml │ │ ├── DocumentField.yaml │ │ ├── EntityField.yaml │ │ ├── Establishment.yaml │ │ ├── FeeField.yaml │ │ ├── Field.yaml │ │ ├── Freeze.yaml │ │ ├── InstrumentCreation.yaml │ │ ├── InstrumentDefinition.yaml │ │ ├── InstrumentModification.yaml │ │ ├── InstrumentReceiverField.yaml │ │ ├── InstrumentSettlementField.yaml │ │ ├── InstrumentTransferField.yaml │ │ ├── ManagerField.yaml │ │ ├── Message.yaml │ │ ├── OracleField.yaml │ │ ├── Order.yaml │ │ ├── Proposal.yaml │ │ ├── QuantityIndexField.yaml │ │ ├── Reconciliation.yaml │ │ ├── RectificationSettlement.yaml │ │ ├── ReferenceTransactionField.yaml │ │ ├── Rejection.yaml │ │ ├── Removal.yaml │ │ ├── Result.yaml │ │ ├── ServiceField.yaml │ │ ├── Settlement.yaml │ │ ├── StaticContractFormation.yaml │ │ ├── TargetAddressField.yaml │ │ ├── Thaw.yaml │ │ ├── Transfer.yaml │ │ ├── Vote.yaml │ │ ├── VotingSystemField.yaml │ │ └── components.yaml │ ├── instruments │ │ ├── AgeRestrictionField.yaml │ │ ├── BondFixedRate.yaml │ │ ├── CasinoChip.yaml │ │ ├── Coupon.yaml │ │ ├── CreditNote.yaml │ │ ├── Currency.yaml │ │ ├── CurrencyValueField.yaml │ │ ├── DeprecatedLoyaltyPoints.yaml │ │ ├── DiscountCoupon.yaml │ │ ├── FixedCurrencyValueField.yaml │ │ ├── InformationServiceLicense.yaml │ │ ├── LoyaltyPoints.yaml │ │ ├── Membership.yaml │ │ ├── RateField.yaml │ │ ├── RewardPoint.yaml │ │ ├── ShareCommon.yaml │ │ ├── TicketAdmission.yaml │ │ └── components.yaml │ └── messages │ │ ├── AcceptRelationship.yaml │ │ ├── AdministratorField.yaml │ │ ├── ChannelPartyField.yaml │ │ ├── Distribution.yaml │ │ ├── DocumentField.yaml │ │ ├── EntityField.yaml │ │ ├── IdentityOracleProofField.yaml │ │ ├── InitiateRelationship.yaml │ │ ├── InitiateThread.yaml │ │ ├── ManagerField.yaml │ │ ├── Offer.yaml │ │ ├── OracleSignatureField.yaml │ │ ├── OutpointField.yaml │ │ ├── OutputMetadata.yaml │ │ ├── OutputTagField.yaml │ │ ├── PaymailProofField.yaml │ │ ├── PendingAcceptRelationship.yaml │ │ ├── PeriodField.yaml │ │ ├── PrivateMessage.yaml │ │ ├── PublicMessage.yaml │ │ ├── RelationshipAmendment.yaml │ │ ├── RevertedTx.yaml │ │ ├── SettlementRequest.yaml │ │ ├── SignatureRequest.yaml │ │ ├── TargetAddressField.yaml │ │ └── components.yaml └── typescript │ ├── .gitignore │ ├── .npmignore │ ├── README.md │ ├── dist │ ├── actions.js │ ├── authorization.js │ ├── bytes.js │ ├── field_types.js │ ├── instruments.js │ ├── messages.js │ ├── protocol.js │ ├── protocol_types.js │ ├── rejection_codes.js │ ├── resource_data.js │ └── resources.js │ ├── gulpfile.config.js │ ├── gulpfile.js │ ├── index.js │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── protobuf │ ├── actions │ │ └── actions.js │ ├── instruments │ │ ├── assets.js │ │ └── instruments.js │ └── messages │ │ └── messages.js │ ├── src │ ├── actions.ts │ ├── authorization.ts │ ├── bytes.ts │ ├── field_types.ts │ ├── instruments.ts │ ├── messages.ts │ ├── protocol.ts │ ├── protocol_types.ts │ ├── rejection_codes.ts │ ├── resource-data.ts │ ├── resource_data.ts │ └── resources.ts │ ├── test │ ├── actions.test.ts │ ├── authorization.test.ts │ ├── bytes.test.ts │ ├── messages.test.ts │ ├── protocol.test.ts │ ├── protocol_types.test.ts │ └── resources.test.ts │ ├── tsconfig.json │ └── tslint.json ├── go.mod ├── go.sum ├── internal ├── cmd │ └── generate │ │ └── main.go ├── golang │ ├── golang.go │ └── templates │ │ ├── action_amendments.tpl │ │ ├── actions.tpl │ │ ├── actions_test.tpl │ │ ├── apply_amendments.tpl │ │ ├── binary_marshal.tpl │ │ ├── copy.tpl │ │ ├── create_amendments.tpl │ │ ├── equal.tpl │ │ ├── instrument_amendments.tpl │ │ ├── instruments.tpl │ │ ├── instruments_test.tpl │ │ ├── messages.tpl │ │ ├── messages_test.tpl │ │ ├── resources.tpl │ │ ├── validate.tpl │ │ └── write_deterministic.tpl ├── json │ ├── example.go │ └── json.go ├── markdown │ ├── markdown.go │ └── templates │ │ ├── protocol-actions.tpl │ │ ├── protocol-instruments.tpl │ │ ├── protocol-messages.tpl │ │ └── protocol-resources.tpl ├── platform │ └── parser │ │ ├── field.go │ │ ├── helpers.go │ │ ├── models.go │ │ ├── parser.go │ │ ├── permissions.go │ │ └── template_funcs.go ├── protobuf │ ├── protobuf.go │ └── templates │ │ └── schema.tpl ├── python │ ├── python.go │ └── templates │ │ └── actions.tpl ├── swagger │ ├── swagger.go │ └── templates │ │ ├── components.tpl │ │ ├── field_type.tpl │ │ └── message.tpl └── typescript │ └── typescript.go └── src ├── actions └── develop │ ├── actions │ ├── C1 - Contract Offer.yaml │ ├── C2 - Contract Formation.yaml │ ├── C3 - Contract Amendment.yaml │ ├── C4 - Static Contract Formation.yaml │ ├── C5 - Contract Address Change.yaml │ ├── C6 - Body of Agreement Offer.yaml │ ├── C7 - Body of Agreement Formation.yaml │ ├── C8 - Body of Agreement Amendment.yaml │ ├── E1 - Order.yaml │ ├── E2 - Freeze.yaml │ ├── E3 - Thaw.yaml │ ├── E4 - Confiscation.yaml │ ├── E5 - Deprecated Reconciliation.yaml │ ├── G1 - Proposal.yaml │ ├── G2 - Vote.yaml │ ├── G3 - Ballot Cast.yaml │ ├── G4 - Ballot Counted.yaml │ ├── G5 - Result.yaml │ ├── I1 - Instrument Definition.yaml │ ├── I2 - Instrument Creation.yaml │ ├── I3 - Instrument Modification.yaml │ ├── M1 - Message.yaml │ ├── M2 - Rejection.yaml │ ├── R1 - Establishment.yaml │ ├── R2 - Addition.yaml │ ├── R3 - Alteration.yaml │ ├── R4 - Removal.yaml │ ├── T1 - Transfer.yaml │ ├── T2 - Settlement.yaml │ └── T3 - Rectification Settlement.yaml │ ├── schema.yaml │ └── types │ ├── AdminIdentityCertificate.yaml │ ├── Administrator.yaml │ ├── Amendment.yaml │ ├── Chapter.yaml │ ├── Clause.yaml │ ├── DefinedTerm.yaml │ ├── Document.yaml │ ├── Entity.yaml │ ├── Fee.yaml │ ├── InstrumentReceiver.yaml │ ├── InstrumentSettlement.yaml │ ├── InstrumentTransfer.yaml │ ├── Manager.yaml │ ├── Oracle.yaml │ ├── QuantityIndex.yaml │ ├── ReferenceTransaction.yaml │ ├── Service.yaml │ ├── TargetAddress.yaml │ └── VotingSystem.yaml ├── instruments └── develop │ ├── currency │ └── CCY - Currency.yaml │ ├── identity │ └── MBR - Membership.yaml │ ├── schema.yaml │ ├── security │ ├── BFR - Bond Fixed Rate.yaml │ └── SHC - Common Share.yaml │ ├── types │ ├── AgeRestriction.yaml │ ├── CurrencyValue.yaml │ ├── FixedCurrencyValue.yaml │ └── Rate.yaml │ └── utility │ ├── CHP - Casino Chip.yaml │ ├── COU - Coupon.yaml │ ├── CRN - Credit Note.yaml │ ├── ISL - Information Service License.yaml │ ├── LOY - Loyalty Points.yaml │ ├── RPT - Reward Point.yaml │ └── TIC - Admission Ticket.yaml ├── messages └── develop │ ├── commercial │ ├── 1001 - Offer.yaml │ ├── 1002 - Signature Request.yaml │ ├── 1003 - Settlement Request.yaml │ ├── 1004 - Output Metadata.yaml │ └── 1005 - Distribution.yaml │ ├── general │ ├── 0002 - Public Message.yaml │ ├── 0003 - Private Message.yaml │ └── 0004 - Reverted Tx.yaml │ ├── relationships │ ├── 2001 - Initiate Relationship.yaml │ ├── 2002 - Pending Accept Relationship.yaml │ ├── 2003 - Accept Relationship.yaml │ ├── 2004 - Relationship Amendment.yaml │ └── 2005 - Initiate Thread.yaml │ ├── schema.yaml │ └── types │ ├── Administrator.yaml │ ├── ChannelParty.yaml │ ├── Document.yaml │ ├── Entity.yaml │ ├── IdentityOracleProof.yaml │ ├── Manager.yaml │ ├── OracleSignature.yaml │ ├── Outpoint.yaml │ ├── OutputTag.yaml │ ├── PaymailProof.yaml │ ├── Period.yaml │ └── TargetAddress.yaml ├── resources └── develop │ ├── Currencies.yaml │ ├── Entities.yaml │ ├── LegalSystems.yaml │ ├── Polities.yaml │ ├── Rejections.yaml │ ├── Roles.yaml │ └── Tags.yaml └── templates └── develop └── private_company ├── Contract.yaml ├── VotingSystems.yaml └── instruments ├── Casino Chip.yaml ├── Common Share.yaml ├── Coupon.yaml ├── Currency.yaml ├── Loyalty Points.yaml ├── Membership.yaml └── Ticket (Admission).yaml /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | .#* 3 | .DS_Store 4 | .DS_Store? 5 | ._* 6 | .Spotlight-V100 7 | .Trashes 8 | tmp 9 | __pycache__ 10 | dist/tokenized 11 | *.log 12 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2024 Tokenized Group Pty Ltd. -------------------------------------------------------------------------------- /cmd/tokenized/cmd/cmd_decode.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | 7 | "github.com/tokenized/pkg/bitcoin" 8 | "github.com/tokenized/specification/dist/golang/print" 9 | 10 | "github.com/pkg/errors" 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | var cmdDecode = &cobra.Command{ 15 | Use: "decode hex_or_asm", 16 | Short: "Decode a transaction or output script (hex or asm)", 17 | Args: cobra.MinimumNArgs(1), 18 | RunE: func(c *cobra.Command, args []string) error { 19 | if len(args) < 1 { 20 | return errors.New("Wrong argument count : requires 1") 21 | } 22 | 23 | if len(args[0]) > 2 && args[0][0] == '0' && args[0][1] == 'x' { 24 | b, hexErr := hex.DecodeString(args[0][2:]) 25 | if hexErr == nil { 26 | if err := print.PrintBytes(b); err != nil { 27 | return errors.Wrap(err, "decode") 28 | } 29 | 30 | return nil 31 | } 32 | } 33 | 34 | b, hexErr := hex.DecodeString(args[0]) 35 | if hexErr == nil { 36 | if err := print.PrintBytes(b); err != nil { 37 | return errors.Wrap(err, "decode") 38 | } 39 | 40 | return nil 41 | } 42 | 43 | // Concatenate all arguments 44 | // TODO This still trims the quotes around strings out because of bash. --ce 45 | s := "" 46 | first := true 47 | for _, arg := range args { 48 | if first { 49 | s = arg 50 | first = false 51 | } else { 52 | s += " " + arg 53 | } 54 | } 55 | 56 | script, scriptErr := bitcoin.StringToScript(s) 57 | if scriptErr == nil { 58 | if err := print.PrintScript(script, false); err != nil { 59 | return errors.Wrap(err, "script") 60 | } 61 | 62 | return nil 63 | } 64 | 65 | return fmt.Errorf("Not hex or asm script: hex error (%s), asm error (%s)", hexErr, 66 | scriptErr) 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /cmd/tokenized/cmd/cmd_display_tx.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "context" 5 | "time" 6 | 7 | "github.com/tokenized/pkg/bitcoin" 8 | "github.com/tokenized/pkg/whatsonchain" 9 | "github.com/tokenized/specification/dist/golang/print" 10 | 11 | "github.com/pkg/errors" 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | var cmdDisplayTx = &cobra.Command{ 16 | Use: "display_tx txid", 17 | Short: "Download and display a transaction", 18 | Args: cobra.ExactArgs(1), 19 | RunE: func(c *cobra.Command, args []string) error { 20 | if len(args) != 1 { 21 | return errors.New("Wrong argument count : requires 1") 22 | } 23 | 24 | txid, err := bitcoin.NewHash32FromStr(args[0]) 25 | if err != nil { 26 | return errors.Wrap(err, "txid") 27 | } 28 | 29 | woc := whatsonchain.NewService("", bitcoin.MainNet, 5*time.Second, 30*time.Second) 30 | 31 | tx, err := woc.GetTx(context.Background(), *txid) 32 | if err != nil { 33 | return errors.Wrap(err, "get tx") 34 | } 35 | 36 | if err := print.PrintTx(tx); err != nil { 37 | return errors.Wrap(err, "print tx") 38 | } 39 | 40 | return nil 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /cmd/tokenized/cmd/cmd_gen_extended_key.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/tokenized/pkg/bitcoin" 7 | 8 | "github.com/pkg/errors" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | var cmdGenerateExtendedKey = &cobra.Command{ 13 | Use: "gen_extended_key", 14 | Short: "Generates a random BIP32 extended private key", 15 | Args: cobra.ExactArgs(0), 16 | RunE: func(c *cobra.Command, args []string) error { 17 | key, err := bitcoin.GenerateMasterExtendedKey() 18 | if err != nil { 19 | return errors.Wrap(err, "generate") 20 | } 21 | 22 | fmt.Printf("Extended Key (BIP32): %s\n", key.String58()) 23 | fmt.Printf("Extended Public Key (BIP32): %s\n", key.ExtendedPublicKey().String58()) 24 | return nil 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /cmd/tokenized/cmd/cmd_gen_key.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/hex" 6 | "fmt" 7 | 8 | "github.com/tokenized/pkg/bitcoin" 9 | 10 | "github.com/pkg/errors" 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | var cmdGenerateKey = &cobra.Command{ 15 | Use: "gen_key", 16 | Short: "Generates a random WIF key", 17 | Args: cobra.ExactArgs(0), 18 | RunE: func(c *cobra.Command, args []string) error { 19 | network, err := Network() 20 | if err != nil { 21 | return errors.Wrap(err, "network") 22 | } 23 | 24 | key, err := bitcoin.GenerateKey(network) 25 | if err != nil { 26 | return errors.Wrap(err, "generate") 27 | } 28 | 29 | fmt.Printf("Key (WIF): %s\n", key) 30 | 31 | publicKey := key.PublicKey() 32 | fmt.Printf("Public Key: %s\n", publicKey) 33 | fmt.Printf("Public Key (Base64): %s\n", base64.StdEncoding.EncodeToString(publicKey.Bytes())) 34 | 35 | ra, err := key.RawAddress() 36 | if err != nil { 37 | return errors.Wrap(err, "address") 38 | } 39 | 40 | fmt.Printf("P2PKH (Pay To Public Key Hash):\n") 41 | 42 | address := bitcoin.NewAddressFromRawAddress(ra, network) 43 | fmt.Printf(" Address: %s\n", address) 44 | 45 | lockingScript, err := key.LockingScript() 46 | if err != nil { 47 | return errors.Wrap(err, "locking script") 48 | } 49 | 50 | fmt.Printf(" Locking Script: %s\n", lockingScript) 51 | fmt.Printf(" Locking Script (hex): %x\n", []byte(lockingScript)) 52 | 53 | fmt.Printf(" Raw Address: %s\n", hex.EncodeToString(ra.Bytes())) 54 | fmt.Printf(" Raw Address (Base64): %s\n", base64.StdEncoding.EncodeToString(ra.Bytes())) 55 | 56 | return nil 57 | }, 58 | } 59 | -------------------------------------------------------------------------------- /cmd/tokenized/cmd/main.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | ) 6 | 7 | var scCmd = &cobra.Command{ 8 | Use: "tokenized", 9 | Short: "Tokenized CLI", 10 | } 11 | 12 | func Execute() { 13 | scCmd.AddCommand(cmdDecode) 14 | scCmd.AddCommand(cmdGenerateKey) 15 | scCmd.AddCommand(cmdGenerateExtendedKey) 16 | scCmd.AddCommand(cmdCreateContract) 17 | scCmd.AddCommand(cmdCreateInstrument) 18 | scCmd.AddCommand(cmdCreateTransfer) 19 | scCmd.AddCommand(cmdDisplayTx) 20 | scCmd.AddCommand(cmdDisplayScript) 21 | scCmd.Execute() 22 | } 23 | -------------------------------------------------------------------------------- /cmd/tokenized/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/tokenized/specification/cmd/tokenized/cmd" 5 | ) 6 | 7 | func main() { 8 | cmd.Execute() 9 | } 10 | -------------------------------------------------------------------------------- /cmd/tokenized/samples/entity_contract_offer.json: -------------------------------------------------------------------------------- 1 | { 2 | "ContractType": 0, 3 | "GoverningLaw": "GBR", 4 | "Jurisdiction": "GBR", 5 | "ContractName": "Sample Business (Development - Test purposes only)", 6 | "Issuer": { 7 | "Name": "Sample Business Incorporated", 8 | "Type": "C", 9 | "CountryCode": "GBR", 10 | "DomainName": "sample_business.com" 11 | }, 12 | "ContractFee": 2000 13 | } 14 | -------------------------------------------------------------------------------- /cmd/tokenized/samples/instrument_contract_offer.json: -------------------------------------------------------------------------------- 1 | { 2 | "ContractType": 1, 3 | "GoverningLaw": "USA", 4 | "Jurisdiction": "USA", 5 | "ContractName": "Sample Instrument (Development - Test purposes only)", 6 | "ContractFee": 500 7 | } 8 | -------------------------------------------------------------------------------- /cmd/tokenized/samples/instrument_definition.json: -------------------------------------------------------------------------------- 1 | { 2 | "EnforcementOrdersPermitted": false, 3 | "AuthorizedTokenQty": 100000, 4 | "InstrumentType": "CCY" 5 | } 6 | -------------------------------------------------------------------------------- /cmd/tokenized/samples/instrument_payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrencyCode": "USD", 3 | "Precision": 2 4 | } 5 | -------------------------------------------------------------------------------- /dist/csharp/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/csharp/.gitkeep -------------------------------------------------------------------------------- /dist/golang/README.md: -------------------------------------------------------------------------------- 1 | # Go Tokenized Protocol 2 | 3 | Usage 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | 10 | "github.com/tokenized/specification/dist/golang/actions" 11 | "github.com/tokenized/specification/dist/golang/protocol" 12 | ) 13 | 14 | func main() { 15 | permissions := protocol.Permissions{ 16 | protocol.Permission{ 17 | Permitted: true, 18 | AdministrationProposal: true, 19 | HolderProposal: false, 20 | AdministrativeMatter: false, 21 | VotingSystemsAllowed: []bool{true, true}, 22 | // Fields: nil, // Leave Fields blank to use as default for all fields. 23 | }, 24 | } 25 | 26 | // Serialize permissions 27 | permBytes, err := permissions.Bytes() 28 | if err != nil { 29 | fmt.Printf("Failed to serialize permissions\n") 30 | return 31 | } 32 | 33 | // Generate a new contract offer action 34 | action := actions.ContractOffer{ 35 | ContractName: "Test", 36 | BodyOfAgreementType: 2, 37 | BodyOfAgreement: []byte(""), 38 | ContractType: "Test Type", 39 | ContractPermissions: permBytes, 40 | // Specify any other fields necessary 41 | // ... 42 | } 43 | 44 | // Serialize action 45 | isTest := true // use "test.tokenized" OP_RETURN signature 46 | actionData, err := protocol.Serialize(&action, isTest) 47 | if err != nil { 48 | fmt.Printf("Failed to serialize payload\n") 49 | return 50 | } 51 | 52 | // Convert to hex 53 | fmt.Printf("Contract Offer Hex :\n%x\n\n", actionData) 54 | 55 | // Output as human readable string 56 | fmt.Printf("Contract Offer text : \n%s\n", action.String()) 57 | } 58 | -------------------------------------------------------------------------------- /dist/golang/internal/amendment.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import "bytes" 4 | 5 | // Amendment is an internal data structure used to communicate amendment data between actions and 6 | // instruments, since instruments can't see the actions data structure. 7 | type Amendment struct { 8 | FIP []uint32 9 | Operation uint32 10 | Data []byte 11 | } 12 | 13 | // Equal returns true if the objects are equal. 14 | func (a Amendment) Equal(b Amendment) bool { 15 | if len(a.FIP) != len(b.FIP) { 16 | return false 17 | } 18 | 19 | for i := range a.FIP { 20 | if a.FIP[i] != b.FIP[i] { 21 | return false 22 | } 23 | } 24 | 25 | if a.Operation != b.Operation { 26 | return false 27 | } 28 | 29 | if !bytes.Equal(a.Data, b.Data) { 30 | return false 31 | } 32 | 33 | return true 34 | } 35 | -------------------------------------------------------------------------------- /dist/golang/protocol/authority.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "context" 5 | "crypto/sha256" 6 | "encoding/binary" 7 | 8 | "github.com/tokenized/pkg/bitcoin" 9 | "github.com/tokenized/specification/dist/golang/actions" 10 | 11 | "github.com/golang/protobuf/proto" 12 | "github.com/pkg/errors" 13 | ) 14 | 15 | // OrderAuthoritySigHash returns a Double SHA256 of the data in an order op return that needs to 16 | // 17 | // be signed by an authority for the OrderSignature field. 18 | // 19 | // The Order must be fully populated including the AuthorityName. 20 | func OrderAuthoritySigHash(ctx context.Context, contractAddress bitcoin.RawAddress, 21 | order *actions.Order) (*bitcoin.Hash32, error) { 22 | 23 | // Calculate the hash 24 | digest := sha256.New() 25 | 26 | digest.Write([]byte(order.AuthorityName)) 27 | digest.Write(contractAddress.Bytes()) 28 | digest.Write([]byte{byte(order.ComplianceAction[0])}) 29 | digest.Write(order.InstrumentCode) 30 | digest.Write(order.SupportingEvidence[:]) 31 | 32 | for _, refTx := range order.ReferenceTransactions { 33 | data, err := proto.Marshal(refTx) 34 | if err != nil { 35 | return nil, errors.Wrap(err, "Failed to serialize reference transaction") 36 | } 37 | digest.Write(data) 38 | } 39 | 40 | err := binary.Write(digest, binary.LittleEndian, order.FreezePeriod) 41 | if err != nil { 42 | return nil, errors.Wrap(err, "Failed to serialize freeze timeout") 43 | } 44 | 45 | for _, target := range order.TargetAddresses { 46 | data, err := proto.Marshal(target) 47 | if err != nil { 48 | return nil, errors.Wrap(err, "Failed to serialize target address") 49 | } 50 | digest.Write(data) 51 | } 52 | 53 | digest.Write(order.DepositAddress) 54 | 55 | hash := bitcoin.Hash32(sha256.Sum256(digest.Sum(nil))) 56 | return &hash, nil 57 | } 58 | -------------------------------------------------------------------------------- /dist/java/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/java/.gitkeep -------------------------------------------------------------------------------- /dist/objectivec/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/objectivec/.gitkeep -------------------------------------------------------------------------------- /dist/php/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/php/.gitkeep -------------------------------------------------------------------------------- /dist/ruby/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/ruby/.gitkeep -------------------------------------------------------------------------------- /dist/swagger/actions/Addition.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Adds an entry to the Register. 3 | type: object 4 | properties: 5 | Message: 6 | description: A custom message to include with this action. 7 | type: string 8 | example: "username" 9 | 10 | -------------------------------------------------------------------------------- /dist/swagger/actions/AdminIdentityCertificateField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A certificate provided by an identity oracle to verify the administrator address is associated 4 | with the issuer entity identification information. Also if a contract operator is provided then it 5 | verifies that the contract operator address is associated with the specified contract operator 6 | identity information. For a child contract that references a parent entity contract the certificate 7 | verifies that the administrator address is associated with that entity contract. 8 | type: object 9 | properties: 10 | EntityContract: 11 | description: > 12 | The entity contract address of the service on chain that defines the identity oracle. 13 | type: string 14 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 15 | Signature: 16 | description: > 17 | The signature provided by the oracle specified. The first input must correspond to the 18 | administration entity and, if a contract operator is included, the second input must 19 | correspond to the contract operator entity." 20 | type: string 21 | example: "3044022036164b0c724e6f19e234306444a11631b2f8e47d05468a099928adce0dead62102205138a635827d61915483e7ca1a53b37975a9aa0617c78ef7ac199d94742c36cf" 22 | BlockHeight: 23 | description: The block height of the block hash used in the oracle signature. 24 | type: number 25 | Expiration: 26 | description: > 27 | Oracles have the option to specify an expiration after which a new certificate should be 28 | provided. 29 | type: number 30 | example: 1594668650000000000 31 | 32 | -------------------------------------------------------------------------------- /dist/swagger/actions/AdministratorField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Administrator is used to refer to a Administration role in an Entity. 3 | type: object 4 | properties: 5 | Type: 6 | description: > 7 | Chairman, Director, Managing Partner, etc.. Found in 'Roles' in Specification/Resources 8 | type: number 9 | example: 5 10 | Name: 11 | description: Length 0-255 bytes. 0 is valid. 12 | type: string 13 | example: "Satoshi Nakamoto" 14 | 15 | -------------------------------------------------------------------------------- /dist/swagger/actions/Alteration.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A register entry/record can be altered. 3 | type: object 4 | properties: 5 | EntryTxID: 6 | description: Transaction ID of the register entry to be altered. 7 | type: string 8 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 9 | Message: 10 | description: A custom message to include with this action. 11 | type: string 12 | example: "Changed Country of Residence" 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/actions/AmendmentField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | An Amendment is used to describe the modification of a single field in a Contract or Instrument, as 4 | defined in the ContractFormation and InstrumentCreation messages. 5 | type: object 6 | properties: 7 | FieldIndexPath: 8 | description: List of indices that identify the field/sub-field to be amended. 9 | type: string 10 | Operation: 11 | description: > 12 | 0 = Modify. 1 = Add an element to the data to the array of elements. 2 = Delete the element 13 | listed in the Element field. The Add and Delete operations only apply to a particilar element 14 | of a complex array type. For example, it could be used to remove a particular VotingSystem from 15 | a Contract. 16 | type: number 17 | example: 0 18 | Data: 19 | description: > 20 | New data for the amended subfield. Data type depends on the the type of the field being 21 | amended. The value should be serialize as defined by the protocol. 22 | type: string 23 | 24 | -------------------------------------------------------------------------------- /dist/swagger/actions/AssetModification.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Token Dilutions, Call Backs/Revocations, burning etc. 3 | type: object 4 | properties: 5 | InstrumentType: 6 | description: Three letter character that specifies the instrument type. 7 | type: string 8 | example: "SHC" 9 | InstrumentCode: 10 | description: > 11 | A unique code that is used to identify the instrument. It is generated by hashing the contract 12 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 13 | type: string 14 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 15 | InstrumentRevision: 16 | description: > 17 | The current revision figure to ensure the modification provided is based on the latest version. 18 | type: number 19 | example: 0 20 | Amendments: 21 | description: A collection of modifications to perform on this instrument. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/AmendmentField" 26 | RefTxID: 27 | description: > 28 | The Bitcoin transaction ID of the associated result action that permitted the modifications. 29 | See Governance for more details. 30 | type: string 31 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 32 | 33 | -------------------------------------------------------------------------------- /dist/swagger/actions/AssetReceiverField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | An InstrumentReceiver is a quantity, address, and oracle signature. The quantity could be used to 4 | describe a number of tokens, or a value. The address is where the instrument will be sent. 5 | type: object 6 | properties: 7 | Address: 8 | description: The address receiving the tokens 9 | type: string 10 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 11 | Quantity: 12 | description: Number of tokens to be received by address at Output X 13 | type: number 14 | example: 100 15 | OracleSigAlgorithm: 16 | description: > 17 | 0 = No Oracle-signed Message (OracleConfirmationSig skipped in serialization), 1 = 18 | ECDSA+secp256k1. If the contract for the instrument being received has oracles, then a signature is 19 | required from one of them. 20 | type: number 21 | example: 1 22 | OracleIndex: 23 | description: > 24 | Specifies the index into the list of oracles in the contract offer that was used to authorize 25 | this transfer. 26 | type: number 27 | OracleConfirmationSig: 28 | description: > 29 | Length 0-255 bytes. If restricted to a oracle (whitelist) or has transfer restrictions (age, 30 | location, investor status): ECDSA+secp256k1 (or the like) signed message provided by an 31 | approved/trusted oracle through an API signature of the defined message. If no transfer 32 | restrictions(trade restriction/age restriction fields in the Instrument Type payload. or restricted 33 | to a whitelist by the Contract Auth Flags, it is a NULL field. 34 | type: string 35 | example: "3044022036164b0c724e6f19e234306444a11631b2f8e47d05468a099928adce0dead62102205138a635827d61915483e7ca1a53b37975a9aa0617c78ef7ac199d94742c36cf" 36 | OracleSigBlockHeight: 37 | description: The block height of the block hash used in the oracle signature. 38 | type: number 39 | OracleSigExpiry: 40 | description: This specifies the time at which the Oracle signature expires. 41 | type: number 42 | example: 1594668650000000000 43 | 44 | -------------------------------------------------------------------------------- /dist/swagger/actions/AssetSettlementField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: InstrumentSettlement is the data required to settle an instrument transfer. 3 | type: object 4 | properties: 5 | ContractIndex: 6 | description: Index of input containing the contract's address for this offset 7 | type: number 8 | InstrumentType: 9 | description: "Three letter character that specifies the instrument type. Example: COU" 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | Settlements: 19 | description: > 20 | Each element contains the resulting token balance of Instrument X for the output Address, which is 21 | referred to by the index. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/QuantityIndexField" 26 | 27 | -------------------------------------------------------------------------------- /dist/swagger/actions/AssetTransferField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: InstrumentTransfer is the data required to transfer an instrument. 3 | type: object 4 | properties: 5 | ContractIndex: 6 | description: Index of output containing the contract's address for this offset 7 | type: number 8 | InstrumentType: 9 | description: "Three letter character that specifies the instrument type. Example: COU" 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | InstrumentSenders: 19 | description: > 20 | Each element has the value of tokens to be spent from the input address, which is referred to 21 | by the index. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/QuantityIndexField" 26 | InstrumentReceivers: 27 | description: > 28 | Each element has the value of tokens to be received, the address, and an oracle signature if 29 | required. 30 | type: array 31 | items: 32 | type: object 33 | $ref: "#/components/schemas/InstrumentReceiverField" 34 | 35 | -------------------------------------------------------------------------------- /dist/swagger/actions/BallotCast.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Used by Token Owners to cast their ballot (vote) on proposals. 1 Vote per token unless a vote 4 | multiplier is specified in the relevant Instrument Definition action. 5 | type: object 6 | properties: 7 | VoteTxId: 8 | description: Tx ID of the Vote the Ballot Cast is being made for. 9 | type: string 10 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 11 | Vote: 12 | description: > 13 | Length 1-255 bytes. 0 is not valid. Max length is the VoteMax value from the Proposal action. 14 | Accept, Reject, Abstain, Spoiled, Multiple Choice, or Preference List. 15 options total. Order 15 | of preference. 1st position = 1st choice. 2nd position = 2nd choice, etc. A is always Accept 16 | and B is always reject in a Y/N votes. 17 | type: string 18 | example: "A" 19 | 20 | -------------------------------------------------------------------------------- /dist/swagger/actions/BallotCounted.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The smart contract will respond to a Ballot Cast action with a Ballot Counted action if the Ballot 4 | Cast is valid. If the Ballot Cast is not valid, then the smart contract will respond with a 5 | Rejection Action. 6 | type: object 7 | properties: 8 | VoteTxId: 9 | description: Tx ID of the Vote the Ballot Cast is being made for. 10 | type: string 11 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 12 | Vote: 13 | description: > 14 | Length 1-255 bytes. 0 is not valid. Max length is the VoteMax value from the Proposal action. 15 | Accept, Reject, Abstain, Spoiled, Multiple Choice, or Preference List. 15 options total. Order 16 | of preference. 1st position = 1st choice. 2nd position = 2nd choice, etc. A is always Accept 17 | and B is always reject in a Y/N votes. 18 | type: string 19 | example: "A" 20 | Quantity: 21 | description: > 22 | Number of votes counted for this ballot. Factors in vote multipliers if there are any allowed, 23 | otherwise it is just quantity of tokens held. 24 | type: number 25 | Timestamp: 26 | description: Timestamp in nanoseconds of when the smart contract created the action. 27 | type: number 28 | example: 1594668650000000000 29 | 30 | -------------------------------------------------------------------------------- /dist/swagger/actions/BodyOfAgreementAmendment.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Allows the administration to modify the agreement for the contract. 3 | type: object 4 | properties: 5 | Revision: 6 | description: > 7 | The current revision figure to ensure the modification provided is based on the latest version. 8 | type: number 9 | example: 0 10 | Amendments: 11 | description: A collection of modifications to perform on this instrument. 12 | type: array 13 | items: 14 | type: object 15 | $ref: "#/components/schemas/AmendmentField" 16 | RefTxID: 17 | description: > 18 | The Bitcoin transaction ID of the associated result action that permitted the modifications. 19 | See Governance for more details. 20 | type: string 21 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/actions/BodyOfAgreementFormation.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Provides the current version of the body of agreement for the contract. 3 | type: object 4 | properties: 5 | Chapters: 6 | description: A list of chapters for the agreement. 7 | type: array 8 | items: 9 | type: object 10 | $ref: "#/components/schemas/ChapterField" 11 | Definitions: 12 | description: Definition of terms within the agreement. 13 | type: array 14 | items: 15 | type: object 16 | $ref: "#/components/schemas/DefinedTermField" 17 | Revision: 18 | description: > 19 | A counter for the number of times this agreement has been revised using a modification action. 20 | type: number 21 | example: 0 22 | Timestamp: 23 | description: Timestamp in nanoseconds of when the smart contract created the action. 24 | type: number 25 | example: 1594668650000000000 26 | 27 | -------------------------------------------------------------------------------- /dist/swagger/actions/BodyOfAgreementOffer.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Allows the administration to define the agreement for the contract. 3 | type: object 4 | properties: 5 | Chapters: 6 | description: A list of chapters for the agreement. 7 | type: array 8 | items: 9 | type: object 10 | $ref: "#/components/schemas/ChapterField" 11 | Definitions: 12 | description: Definition of values within the agreement. 13 | type: array 14 | items: 15 | type: object 16 | $ref: "#/components/schemas/DefinedTermField" 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/actions/ChapterField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A chapter is the top level structure of an agreement. It contains articles. 3 | type: object 4 | properties: 5 | Title: 6 | description: The title of the chapter. 7 | type: string 8 | Preamble: 9 | description: The introduction to the chapter. 10 | type: string 11 | Articles: 12 | description: A list of articles for the chapter. 13 | type: array 14 | items: 15 | type: object 16 | $ref: "#/components/schemas/ClauseField" 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/actions/ClauseField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A clause is the standard piece of an agreement, contained in each of the sub-levels of the 4 | agreement. Articles, Sections, Subsections, Paragraphs, and Subparagraphs. 5 | type: object 6 | properties: 7 | Title: 8 | description: The title of the clause. 9 | type: string 10 | Body: 11 | description: The body of the clause. 12 | type: string 13 | Children: 14 | description: A list of clauses under this clause. 15 | type: array 16 | items: 17 | type: object 18 | $ref: "#/components/schemas/ClauseField" 19 | 20 | -------------------------------------------------------------------------------- /dist/swagger/actions/Confiscation.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The contract responding to an Order action to confiscate instruments. To be used to comply with 4 | contractual obligations, legal and/or issuer requirements. 5 | type: object 6 | properties: 7 | InstrumentType: 8 | description: Three letter character that specifies the instrument type. 9 | type: string 10 | example: "SHC" 11 | InstrumentCode: 12 | description: > 13 | A unique code that is used to identify the instrument. It is generated by hashing the contract 14 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 15 | type: string 16 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 17 | Quantities: 18 | description: The holders effected by the confiscation and their balance remaining. 19 | type: array 20 | items: 21 | type: object 22 | $ref: "#/components/schemas/QuantityIndexField" 23 | DepositQty: 24 | description: Deposit address's token balance after confiscation. 25 | type: number 26 | example: 10000 27 | Timestamp: 28 | description: Timestamp in nanoseconds of when the smart contract created the action. 29 | type: number 30 | example: 1594668650000000000 31 | 32 | -------------------------------------------------------------------------------- /dist/swagger/actions/ConflictedSettlement.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Settles the transfer request of bitcoins and tokens from transfer (T1) actions in the case when a 4 | transaction conflicting with the T1 transaction prevents the T1 and T2 from being confirmed in a 5 | block. 6 | type: object 7 | properties: 8 | Transfer: 9 | description: > 10 | The transfer (T1) transaction that had a conflict that kept it from confirming in a block. 11 | type: object 12 | $ref: "#/components/schemas/ReferenceTransactionField" 13 | Instruments: 14 | description: The Instruments settled by the transfer action. 15 | type: array 16 | items: 17 | type: object 18 | $ref: "#/components/schemas/InstrumentSettlementField" 19 | Timestamp: 20 | description: Timestamp in nanoseconds of when the smart contract created the action. 21 | type: number 22 | example: 1594668650000000000 23 | 24 | -------------------------------------------------------------------------------- /dist/swagger/actions/ContractAddressChange.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | This txn is signed by the master contract key defined in the contract formation and changes the 4 | active contract address which the contract uses to receive and respond to requests. This is a worst 5 | case scenario fallback to only be used when the contract private key is believed to be exposed. 6 | type: object 7 | properties: 8 | NewContractAddress: 9 | description: The address to be used by all future requests/responses for the contract. 10 | type: string 11 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 12 | Timestamp: 13 | description: Timestamp in nanoseconds of when the action was created. 14 | type: number 15 | example: 1594668650000000000 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/actions/ContractAmendment.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The administration can initiate an amendment to the contract establishment metadata. The ability to 4 | make an amendment to the contract is restricted by the Authorization Flag set on the current 5 | revision of Contract Formation action. 6 | type: object 7 | properties: 8 | ChangeAdministrationAddress: 9 | description: > 10 | Used to change the administration address. The new administration address must be in the 11 | input[1] position. A change of the administration or operator address requires both the 12 | operator and the administration address to be in the inputs (both signatures) of the Contract 13 | Amendment action. 14 | type: boolean 15 | example: 1 16 | ChangeOperatorAddress: 17 | description: > 18 | Used to change the smart contract operator address. The new operator address must be in the 19 | input[1] position, unless the administration is being changed too, then it is in input[2]. A 20 | change of the administration or operator address requires both the operator and the 21 | administration address to be in the inputs (both signatures) of the Contract Amendment action. 22 | type: boolean 23 | example: 1 24 | ContractRevision: 25 | description: Counter 0 to (2^32)-1 26 | type: number 27 | example: 42 28 | Amendments: 29 | description: A collection of modifications to perform on this contract. 30 | type: array 31 | items: 32 | type: object 33 | $ref: "#/components/schemas/AmendmentField" 34 | RefTxID: 35 | description: > 36 | The Bitcoin transaction ID of the associated result action that permitted the modifications. 37 | See Governance for more details. 38 | type: string 39 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 40 | 41 | -------------------------------------------------------------------------------- /dist/swagger/actions/DefinedTermField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A definition define a term specified throughout an agreement. 3 | type: object 4 | properties: 5 | Term: 6 | description: > 7 | The name of the term being defined. Linked to from within the agreement with curly braces {} 8 | around the name. 9 | type: string 10 | Definition: 11 | description: The definition of the name. 12 | type: string 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/actions/Deprecated Reconciliation.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | This action has been deprecated for Rectified Settlement. The contract responding to an Order 4 | action to reconcile instruments. To be used at the direction of the administration to fix record 5 | keeping errors with bitcoin and token balances. 6 | type: object 7 | properties: 8 | InstrumentType: 9 | description: Three letter character that specifies the instrument type. 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | Quantities: 19 | description: The holders effected by the reconciliation and their balance remaining. 20 | type: array 21 | items: 22 | type: object 23 | $ref: "#/components/schemas/QuantityIndexField" 24 | Timestamp: 25 | description: Timestamp in nanoseconds of when the smart contract created the action. 26 | type: number 27 | example: 1594668650000000000 28 | 29 | -------------------------------------------------------------------------------- /dist/swagger/actions/DeprecatedReconciliation.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | This action has been deprecated for Rectified Settlement. The contract responding to an Order 4 | action to reconcile instruments. To be used at the direction of the administration to fix record 5 | keeping errors with bitcoin and token balances. 6 | type: object 7 | properties: 8 | InstrumentType: 9 | description: Three letter character that specifies the instrument type. 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | Quantities: 19 | description: The holders effected by the reconciliation and their balance remaining. 20 | type: array 21 | items: 22 | type: object 23 | $ref: "#/components/schemas/QuantityIndexField" 24 | Timestamp: 25 | description: Timestamp in nanoseconds of when the smart contract created the action. 26 | type: number 27 | example: 1594668650000000000 28 | 29 | -------------------------------------------------------------------------------- /dist/swagger/actions/DocumentField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A file containing data. 3 | type: object 4 | properties: 5 | Name: 6 | description: Full name, including file extension, of the file. Length 0-255 bytes. 0 is valid. 7 | type: string 8 | example: "Agreement.pdf" 9 | Type: 10 | description: MIME type of the file. Length 0-255 bytes. 0 is valid. 11 | type: string 12 | example: "application/pdf" 13 | Contents: 14 | description: The contents of the file. 15 | type: string 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/actions/Establishment.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Establishes an on-chain register. 3 | type: object 4 | properties: 5 | Message: 6 | description: A custom message to include with this action. 7 | type: string 8 | example: "North America Whitelist" 9 | 10 | -------------------------------------------------------------------------------- /dist/swagger/actions/FeeField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A fee paid for a service. Only bitcoin currently supported as the instrument. 3 | type: object 4 | properties: 5 | Address: 6 | description: The address to receive the fee. 7 | type: string 8 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 9 | Quantity: 10 | description: The quantity of tokens of the specified instrument to be paid. 11 | type: number 12 | example: 100 13 | UseCurrentInstrument: 14 | description: > 15 | When true this means the fee quantity is paid in the current instrument's tokens. For example, 16 | for transfer fees the transfer fee is paid by including extra sender quantity of the instrument 17 | being transfered. When using the current instrument this should not be specified via the 18 | InstrumentCode field below as the instrument code value is not known for certain until the 19 | instrument is created and this field can be specified at instrument definition. 20 | type: boolean 21 | example: true 22 | Contract: 23 | description: > 24 | This feature is not supported by the reference implementation yet but the field is included for 25 | backwards compatibility so when support is added the quantity will not be mistaken for a 26 | bitcoin quantity by older clients. The contract containing the instrument's tokens that should 27 | be used for the fee. 28 | type: string 29 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 30 | InstrumentCode: 31 | description: > 32 | This feature is not supported by the reference implementation yet but the field is included for 33 | backwards compatibility so when support is added the quantity will not be mistaken for a 34 | bitcoin quantity by older clients. The instrument code identifying the instrument's tokens that 35 | should be used for the fee. 36 | type: string 37 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 38 | 39 | -------------------------------------------------------------------------------- /dist/swagger/actions/Field.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: 3 | type: object 4 | properties: 5 | 6 | -------------------------------------------------------------------------------- /dist/swagger/actions/Freeze.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The contract responding to an Order action to freeze instruments. To be used to comply with 4 | contractual/legal/issuer requirements. The target public address(es) will be marked as frozen. 5 | However the Freeze action publishes this fact to the public blockchain for transparency. The 6 | contract will not respond to any actions requested by the frozen address. 7 | type: object 8 | properties: 9 | InstrumentType: 10 | description: Three letter character that specifies the instrument type. 11 | type: string 12 | example: "SHC" 13 | InstrumentCode: 14 | description: > 15 | A unique code that is used to identify the instrument. It is generated by hashing the contract 16 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 17 | type: string 18 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 19 | Quantities: 20 | description: > 21 | Indices to addresses in outputs and the quantities being frozen. If the only address is the 22 | contract address and the instrument code is zeros, then it is a contract wide freeze. If the 23 | only address is the contract address and the instrument code is specified, then it is an 24 | instrument wide freeze. 25 | type: array 26 | items: 27 | type: object 28 | $ref: "#/components/schemas/QuantityIndexField" 29 | FreezePeriod: 30 | description: > 31 | Used for a 'time out'. Tokens are automatically unfrozen after the expiration timestamp 32 | without requiring a Thaw Action. 33 | type: number 34 | example: 1594668650000000000 35 | Timestamp: 36 | description: Timestamp in nanoseconds of when the smart contract created the action. 37 | type: number 38 | example: 1594668650000000000 39 | 40 | -------------------------------------------------------------------------------- /dist/swagger/actions/InstrumentModification.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Token Dilutions, Call Backs/Revocations, burning etc. 3 | type: object 4 | properties: 5 | InstrumentType: 6 | description: Three letter character that specifies the instrument type. 7 | type: string 8 | example: "SHC" 9 | InstrumentCode: 10 | description: > 11 | A unique code that is used to identify the instrument. It is generated by hashing the contract 12 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 13 | type: string 14 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 15 | InstrumentRevision: 16 | description: > 17 | The current revision figure to ensure the modification provided is based on the latest version. 18 | type: number 19 | example: 0 20 | Amendments: 21 | description: A collection of modifications to perform on this instrument. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/AmendmentField" 26 | RefTxID: 27 | description: > 28 | The Bitcoin transaction ID of the associated result action that permitted the modifications. 29 | See Governance for more details. 30 | type: string 31 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 32 | 33 | -------------------------------------------------------------------------------- /dist/swagger/actions/InstrumentSettlementField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: InstrumentSettlement is the data required to settle an instrument transfer. 3 | type: object 4 | properties: 5 | ContractIndex: 6 | description: Index of input containing the contract's address for this offset 7 | type: number 8 | InstrumentType: 9 | description: "Three letter character that specifies the instrument type. Example: COU" 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | Settlements: 19 | description: > 20 | Each element contains the resulting token balance of Instrument X for the output Address, which 21 | is referred to by the index. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/QuantityIndexField" 26 | 27 | -------------------------------------------------------------------------------- /dist/swagger/actions/InstrumentTransferField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: InstrumentTransfer is the data required to transfer an instrument. 3 | type: object 4 | properties: 5 | ContractIndex: 6 | description: Index of output containing the contract's address for this offset 7 | type: number 8 | InstrumentType: 9 | description: "Three letter character that specifies the instrument type. Example: COU" 10 | type: string 11 | example: "SHC" 12 | InstrumentCode: 13 | description: > 14 | A unique code that is used to identify the instrument. It is generated by hashing the contract 15 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 16 | type: string 17 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 18 | InstrumentSenders: 19 | description: > 20 | Each element has the value of tokens to be spent from the input address, which is referred to 21 | by the index. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/QuantityIndexField" 26 | InstrumentReceivers: 27 | description: > 28 | Each element has the value of tokens to be received, the address, and an oracle signature if 29 | required. 30 | type: array 31 | items: 32 | type: object 33 | $ref: "#/components/schemas/InstrumentReceiverField" 34 | RefundAddress: 35 | description: > 36 | The address to receive the refund of the instrument transfer fee if the transfer is rejected. 37 | type: string 38 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 39 | 40 | -------------------------------------------------------------------------------- /dist/swagger/actions/ManagerField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Manager is used to refer to a role that is responsible for the Management of an Entity. 4 | type: object 5 | properties: 6 | Type: 7 | description: CEO, COO, CFO, etc. Found in 'Roles' in Specification/Resources 8 | type: number 9 | example: 5 10 | Name: 11 | description: Length 0-255 bytes. 0 is valid. 12 | type: string 13 | example: "Satoshi Nakamoto" 14 | 15 | -------------------------------------------------------------------------------- /dist/swagger/actions/Message.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The message action is a general purpose communication action. 'Twitter/SMS' for 4 | Issuers/Investors/Users. The message txn can also be used for passing partially signed txns 5 | on-chain, establishing private communication channels and EDI (receipting, invoices, PO, and 6 | private offers/bids). The messages are broken down by type for easy filtering in the a user's 7 | wallet. The Message Types are listed in the Message Types table. 8 | type: object 9 | properties: 10 | SenderIndexes: 11 | description: > 12 | Associates the message to a particular input by the index. If none are specified then the first 13 | input is assumed. 14 | type: array 15 | items: 16 | type: number 17 | ReceiverIndexes: 18 | description: > 19 | Associates the message to a particular output by the index. If none are specified then the 20 | first output is assumed. 21 | type: array 22 | items: 23 | type: number 24 | MessageCode: 25 | type: number 26 | MessagePayload: 27 | description: > 28 | Public or private (RSA public key, Diffie-Hellman). Issuers/Contracts can send the signifying 29 | amount of satoshis to themselves for public announcements or private 'notes' if encrypted. See 30 | Message Types for a full list of potential use cases. 31 | type: string 32 | example: "Hello world!" 33 | 34 | -------------------------------------------------------------------------------- /dist/swagger/actions/OracleField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A Oracle defines the details of a public Oracle. 3 | type: object 4 | properties: 5 | OracleTypes: 6 | description: > 7 | The type of the oracle. 0 = Identity, 1 = Authority, 2 = Event. More than one value can be 8 | included to specify the oracle has more than one type. 9 | type: array 10 | items: 11 | type: number 12 | EntityContract: 13 | description: The entity contract address of the service on chain that defines the oracle. 14 | type: string 15 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/actions/QuantityIndexField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A QuantityIndex contains a quantity, and an index. The quantity could be used to describe a number 4 | of tokens, or a value. The index is used to refer to an input or output index position. 5 | type: object 6 | properties: 7 | Index: 8 | description: The index of the input/output (depending on context) sending/receiving the tokens. 9 | type: number 10 | example: 0 11 | Quantity: 12 | description: Number of tokens being sent 13 | type: number 14 | example: 100 15 | 16 | -------------------------------------------------------------------------------- /dist/swagger/actions/Reconciliation.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The contract responding to an Order action to reconcile instruments. To be used at the direction of 4 | the administration to fix record keeping errors with bitcoin and token balances. 5 | type: object 6 | properties: 7 | InstrumentType: 8 | description: Three letter character that specifies the instrument type. 9 | type: string 10 | example: "SHC" 11 | InstrumentCode: 12 | description: > 13 | A unique code that is used to identify the instrument. It is generated by hashing the contract 14 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 15 | type: string 16 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 17 | Quantities: 18 | description: The holders effected by the reconciliation and their balance remaining. 19 | type: array 20 | items: 21 | type: object 22 | $ref: "#/components/schemas/QuantityIndexField" 23 | Timestamp: 24 | description: Timestamp in nanoseconds of when the smart contract created the action. 25 | type: number 26 | example: 1594668650000000000 27 | 28 | -------------------------------------------------------------------------------- /dist/swagger/actions/RectificationSettlement.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Settles the transfer request of tokens from transfer (T1) actions in the case when a transaction 4 | conflicting with the T1 transaction prevents the T1 and T2 from being confirmed in a block. 5 | type: object 6 | properties: 7 | Transfer: 8 | description: > 9 | The transfer (T1) transaction that had a conflict that kept it from confirming in a block. 10 | type: object 11 | $ref: "#/components/schemas/ReferenceTransactionField" 12 | Instruments: 13 | description: The Instruments settled by the transfer action. 14 | type: array 15 | items: 16 | type: object 17 | $ref: "#/components/schemas/InstrumentSettlementField" 18 | Timestamp: 19 | description: Timestamp in nanoseconds of when the smart contract created the action. 20 | type: number 21 | example: 1594668650000000000 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/actions/ReferenceTransactionField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A bitcoin transaction and the outputs that it spends. 3 | type: object 4 | properties: 5 | Transaction: 6 | description: A bitcoin transaction serialized in the bitcoin P2P format. 7 | type: string 8 | example: "0" 9 | Outputs: 10 | description: > 11 | The bitcoin outputs corresponding to the inputs for the transaction. Serialized in bitcoin P2P 12 | format. There must be the same count as there are inputs in the contained transaction and they 13 | must be in the same order." 14 | type: array 15 | items: 16 | type: string 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/actions/Rejection.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Used to reject request actions that do not comply with the Contract. If money is to be returned to 4 | a User then it is used in lieu of the Settlement Action to properly account for token balances. All 5 | Administration/User request Actions must be responded to by the Contract with an Action. The only 6 | exception to this rule is when there is not enough fees in the first Action for the Contract 7 | response action to remain revenue neutral. If not enough fees are attached to pay for the Contract 8 | response then the Contract will not respond. 9 | type: object 10 | properties: 11 | AddressIndexes: 12 | description: > 13 | Associates the message to a particular output by the index. If none are specified then the 14 | first output is assumed. 15 | type: array 16 | items: 17 | type: number 18 | RejectAddressIndex: 19 | description: The address which is believed to have caused the rejection. 20 | type: number 21 | RejectionCode: 22 | description: Classifies the rejection by a type. 23 | type: number 24 | example: 10 25 | Message: 26 | description: > 27 | Length 0-65,535 bytes. Message that explains the reasoning for a rejection, if needed. Most 28 | rejection types will be captured by the Rejection Type Subfield. 29 | type: string 30 | example: "Sorry, you don't have enough tokens." 31 | Timestamp: 32 | description: Timestamp in nanoseconds of when the smart contract created the action. 33 | type: number 34 | example: 1594668650000000000 35 | 36 | -------------------------------------------------------------------------------- /dist/swagger/actions/Removal.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Removes an entry/record from the Register. 3 | type: object 4 | properties: 5 | EntryTxID: 6 | description: Transaction ID of the register entry to be altered. 7 | type: string 8 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 9 | Message: 10 | description: A custom message to include with this action. 11 | type: string 12 | example: "Removed due to violation of company policy." 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/actions/ServiceField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A definition of a service provided by an identity oracle to verify the administrator address is 4 | associated with the issuer entity identification information. Also if a contract operator is 5 | provided then it verifies that the contract operator address is associated with the specified 6 | contract operator identity information. For a child contract that references a parent entity 7 | contract the certificate verifies that the administrator address is associated with that entity 8 | contract. 9 | type: object 10 | properties: 11 | Type: 12 | description: > 13 | Describes the type of service. 14 | 0 - Identity Oracle 15 | 1 - Authority Oracle 16 | 2 - Event Oracle 17 | 3 - Contract Operator 18 | type: number 19 | example: 0 20 | URL: 21 | description: > 22 | The base URL of the service. For each service type there are predefined methods for 23 | determining the specific endpoints. 24 | type: string 25 | PublicKey: 26 | description: The public key used to verify and authorize the service. 27 | type: string 28 | example: "027fed903fe7d94a7a5bab491fb728aebcc74260840c0b3d4dadb870cd34ffbfc4" 29 | 30 | -------------------------------------------------------------------------------- /dist/swagger/actions/Settlement.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Settles the transfer request of bitcoins and tokens from transfer (T1) actions. 3 | type: object 4 | properties: 5 | Instruments: 6 | description: The Instruments settled by the transfer action. 7 | type: array 8 | items: 9 | type: object 10 | $ref: "#/components/schemas/InstrumentSettlementField" 11 | Timestamp: 12 | description: Timestamp in nanoseconds of when the smart contract created the action. 13 | type: number 14 | example: 1594668650000000000 15 | 16 | -------------------------------------------------------------------------------- /dist/swagger/actions/TargetAddressField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A TargetAddress defines a public address and quantity. 3 | type: object 4 | properties: 5 | Address: 6 | description: Public address where the token balance will be changed. 7 | type: string 8 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 9 | Quantity: 10 | description: > 11 | Qty of tokens to be frozen, thawed, confiscated or reconciled. For Contract-wide freezes 0 will 12 | be used. 13 | type: number 14 | example: 10000 15 | 16 | -------------------------------------------------------------------------------- /dist/swagger/actions/Thaw.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | The contract responding to an Order action to thaw instruments. To be used to comply with 4 | contractual obligations or legal requirements. The Alleged Offender's tokens will be unfrozen to 5 | allow them to resume normal exchange and governance activities. 6 | type: object 7 | properties: 8 | FreezeTxId: 9 | description: The tx id of the freeze action that is being reversed. 10 | type: string 11 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 12 | Timestamp: 13 | description: Timestamp in nanoseconds of when the smart contract created the action. 14 | type: number 15 | example: 1594668650000000000 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/actions/Transfer.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A Token Owner(s) Sends, Exchanges or Swaps a token(s) or Bitcoin for a token(s) or Bitcoin. Can be 4 | as simple as sending a single token to a receiver. Or can be as complex as many senders sending 5 | many different instruments - controlled by many different smart contracts - to a number of 6 | receivers. This action also supports atomic swaps (tokens for tokens). Since many parties and 7 | contracts can be involved in a transfer and the corresponding settlement action, the partially 8 | signed T1 and T2 actions will need to be passed around on-chain with an M1 action, or off-chain. 9 | type: object 10 | properties: 11 | Instruments: 12 | description: The Instruments involved in the Transfer Action. 13 | type: array 14 | items: 15 | type: object 16 | $ref: "#/components/schemas/InstrumentTransferField" 17 | OfferExpiry: 18 | description: > 19 | This prevents any party from holding on to the partially signed message as a form of an option. 20 | Eg. the exchange at this price is valid for 30 mins. 21 | type: number 22 | example: 1594668650000000000 23 | ExchangeFee: 24 | description: Fixed amount of bitcoin being paid to an exchange for facilitating a transfer. 25 | type: number 26 | example: 0.01 27 | ExchangeFeeAddress: 28 | description: Identifies the public address that the exchange fee should be paid to. 29 | type: string 30 | example: "20f8d521553a2b0de0ceba82b70c5dd184c6cd2f43" 31 | 32 | -------------------------------------------------------------------------------- /dist/swagger/actions/Vote.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A vote is created by the Contract in response to a valid Proposal Action. 3 | type: object 4 | properties: 5 | Timestamp: 6 | description: Timestamp in nanoseconds of when the smart contract created the action. 7 | type: number 8 | example: 1594668650000000000 9 | 10 | -------------------------------------------------------------------------------- /dist/swagger/instruments/AgeRestrictionField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Age restriction is used to specify required ages for instrument ownership. 3 | type: object 4 | properties: 5 | Lower: 6 | description: The lowest age valid to own instrument. Zero for no restriction. 7 | type: number 8 | Upper: 9 | description: The highest age valid to own instrument. Zero for no restriction. 10 | type: number 11 | 12 | -------------------------------------------------------------------------------- /dist/swagger/instruments/CasinoChip.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Casino Chip 3 | type: object 4 | properties: 5 | UseType: 6 | description: Real Money (R), Free Play (F) 7 | type: string 8 | example: "R" 9 | AgeRestriction: 10 | description: Age restriction is used to specify required ages for instrument ownership. 11 | type: object 12 | $ref: "#/components/schemas/AgeRestrictionField" 13 | ExpirationTimestamp: 14 | type: number 15 | example: 1594668650000000000 16 | TransfersPermitted: 17 | description: > 18 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 19 | peer-to-peer transfers. 20 | type: boolean 21 | CasinoName: 22 | description: The name of the casino, or host, of the chip. 23 | type: string 24 | FaceValue: 25 | description: Face value of each coupon specified in a currency. 26 | type: object 27 | $ref: "#/components/schemas/CurrencyValueField" 28 | 29 | -------------------------------------------------------------------------------- /dist/swagger/instruments/Coupon.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A voucher entitling the holder to a discount on a particular product or service. 3 | type: object 4 | properties: 5 | RedeemingEntity: 6 | description: The entity responsible for redemption of this coupon. 7 | type: string 8 | example: "Woolworths - Robina Town Centre" 9 | ValidFromTimestamp: 10 | type: number 11 | example: 1594668650000000000 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | CouponName: 16 | type: string 17 | example: "Gift Card" 18 | TransfersPermitted: 19 | description: > 20 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 21 | peer-to-peer transfers. 22 | type: boolean 23 | FaceValue: 24 | description: Face value of each coupon specified in a currency. 25 | type: object 26 | $ref: "#/components/schemas/CurrencyValueField" 27 | RedemptionVenue: 28 | type: string 29 | Details: 30 | type: string 31 | 32 | -------------------------------------------------------------------------------- /dist/swagger/instruments/CreditNote.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A credit for a specified value in currency. 3 | type: object 4 | properties: 5 | FaceValue: 6 | description: > 7 | Face value of each token specified in a currency. The "Value" must be 1. Theis value is fixed 8 | after instrument creation and can't be modified with instrument modifications. 9 | type: object 10 | $ref: "#/components/schemas/FixedCurrencyValueField" 11 | ExpirationTimestamp: 12 | type: number 13 | example: 1594668650000000000 14 | TransfersPermitted: 15 | description: > 16 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 17 | peer-to-peer transfers. 18 | type: boolean 19 | 20 | -------------------------------------------------------------------------------- /dist/swagger/instruments/Currency.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Currency, fiat money, cash. Issued by a monetary authority (eg. Reserve Bank of Australia, ECB, 4 | Bank of England). Currency is free of counterparty risk except for the risks associated with the 5 | management of the currency by the monetary authority and its recognition as acceptable legal tender 6 | by the market and associated government(s). Custody of currency must be backed by a 1:1 ratio, or 7 | a full reserve. A currency instrument type should be considered the digital equivalent of physical 8 | cash. 9 | type: object 10 | properties: 11 | CurrencyCode: 12 | description: > 13 | International Organization for Standardization code for Currency. (Specification/Resources) 14 | type: string 15 | example: "AUD" 16 | MonetaryAuthority: 17 | type: string 18 | example: "Reserve Bank of Australia" 19 | Precision: 20 | description: > 21 | Required field to specify the decimal precision of a currency. It will normally be the 22 | "precision" value associated with the CurrencyCode. It is the number of decimal places between 23 | the number of tokens and the common unit of measure. For example, in AUD, the common unit is 24 | the dollar, but a token would only be worth a penny. So the precision should be 2 for the two 25 | decimal places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. 26 | type: number 27 | example: 100 28 | 29 | -------------------------------------------------------------------------------- /dist/swagger/instruments/CurrencyValueField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A value specified in terms of a currency. 3 | type: object 4 | properties: 5 | Value: 6 | description: The value of each token denominated in precision specified in Precision field. 7 | type: number 8 | example: 100 9 | CurrencyCode: 10 | description: > 11 | International Organization for Standardization code for Currency. Currency for coupon. From 12 | resources/currency. 13 | type: string 14 | example: "AUD" 15 | Precision: 16 | description: > 17 | Specify the decimal precision of the value. It will normally be the "precision" value 18 | associated with the Currency. It is the number of decimal places between the number of tokens 19 | and the common unit of measure. For example, in AUD, the common unit is the dollar, but a token 20 | would only be worth a penny. So the precision should be 2 for the two decimal places in a 21 | dollar amount "$1.00". In this scenario 100 tokens are worth $1. Zero is assumed if no value is 22 | specified. 23 | type: number 24 | example: 2 25 | 26 | -------------------------------------------------------------------------------- /dist/swagger/instruments/DeprecatedLoyaltyPoints.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Deprecated - This has been deprecated for RPT - Reward Points. A Loyalty Point 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | ProgramName: 10 | type: string 11 | example: "Qantas Frequent Flyer Points" 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | Details: 16 | type: string 17 | TransfersPermitted: 18 | description: > 19 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 20 | peer-to-peer transfers. 21 | type: boolean 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/instruments/DiscountCoupon.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A voucher entitling the holder to a discount on a particular product or service. 3 | type: object 4 | properties: 5 | RedeemingEntity: 6 | description: The entity responsible for redemption of this coupon. 7 | type: string 8 | example: "Woolworths - Robina Town Centre" 9 | ValidFromTimestamp: 10 | type: number 11 | example: 1594668650000000000 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | CouponName: 16 | type: string 17 | example: "Gift Card" 18 | TransfersPermitted: 19 | description: > 20 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 21 | peer-to-peer transfers. 22 | type: boolean 23 | FaceValue: 24 | description: Face value of each coupon specified in a currency. 25 | type: object 26 | $ref: "#/components/schemas/CurrencyValueField" 27 | RedemptionVenue: 28 | type: string 29 | Details: 30 | type: string 31 | 32 | -------------------------------------------------------------------------------- /dist/swagger/instruments/FixedCurrencyValueField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A fixed value specified in terms of a currency. The "Value" must be 1. Theis value is fixed after 4 | instrument creation and can't be modified with instrument modifications. 5 | type: object 6 | properties: 7 | Value: 8 | description: The value of each token denominated in precision specified in Precision field. 9 | type: number 10 | example: 1 11 | CurrencyCode: 12 | description: > 13 | International Organization for Standardization code for Currency. Currency for coupon. From 14 | resources/currency. 15 | type: string 16 | example: "AUD" 17 | Precision: 18 | description: > 19 | Specify the decimal precision of the value. It will normally be the "precision" value 20 | associated with the Currency. It is the number of decimal places between the number of tokens 21 | and the common unit of measure. For example, in AUD, the common unit is the dollar, but a token 22 | would only be worth a penny. So the precision should be 2 for the two decimal places in a 23 | dollar amount "$1.00". In this scenario 100 tokens are worth $1. Zero is assumed if no value is 24 | specified. 25 | type: number 26 | example: 2 27 | 28 | -------------------------------------------------------------------------------- /dist/swagger/instruments/InformationServiceLicense.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Information Service License 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | ExpirationTimestamp: 10 | type: number 11 | example: 1594668650000000000 12 | ServiceName: 13 | type: string 14 | TransfersPermitted: 15 | description: > 16 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 17 | peer-to-peer transfers. 18 | type: boolean 19 | URL: 20 | description: URL linking to any related documents or media 21 | type: string 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/instruments/LoyaltyPoints.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A Loyalty Point 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | ProgramName: 10 | type: string 11 | example: "Qantas Frequent Flyer Points" 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | Details: 16 | type: string 17 | TransfersPermitted: 18 | description: > 19 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 20 | peer-to-peer transfers. 21 | type: boolean 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/instruments/Membership.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A Membership 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | ValidFrom: 10 | type: number 11 | example: 1594668650000000000 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | ID: 16 | type: string 17 | example: "34536457575486868" 18 | MembershipClass: 19 | type: string 20 | example: "Owner, Administrator, Manager, General, can be NULL." 21 | RoleType: 22 | type: string 23 | example: "Director, Partner, CEO, COO, etc., can be NULL from Roles in Resources/Roles" 24 | MembershipType: 25 | type: string 26 | example: "Silver, Platinum, can be NULL." 27 | Description: 28 | type: string 29 | example: "Rights and duties listed." 30 | TransfersPermitted: 31 | description: > 32 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 33 | peer-to-peer transfers. 34 | type: boolean 35 | 36 | -------------------------------------------------------------------------------- /dist/swagger/instruments/RateField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A rate value specified in terms of a precision. 3 | type: object 4 | properties: 5 | Precision: 6 | description: > 7 | Required field to specify the decimal precision of the value. It will normally be the 8 | "precision" value associated with the Currency. It is the number of decimal places between the 9 | number of tokens and the common unit of measure. For example, in AUD, the common unit is the 10 | dollar, but a token would only be worth a penny. So the precision should be 2 for the two 11 | decimal places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. 12 | type: number 13 | example: 2 14 | Value: 15 | type: number 16 | example: Denominated in precision specified in Precision field. 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/instruments/RewardPoint.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A Reward Point 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | ProgramName: 10 | type: string 11 | example: "Qantas Frequent Flyer Points" 12 | ExpirationTimestamp: 13 | type: number 14 | example: 1594668650000000000 15 | Details: 16 | type: string 17 | TransfersPermitted: 18 | description: > 19 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 20 | peer-to-peer transfers. 21 | type: boolean 22 | 23 | -------------------------------------------------------------------------------- /dist/swagger/instruments/ShareCommon.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Common stock represents ownership interests in companies. 3 | type: object 4 | properties: 5 | Ticker: 6 | description: Ticker symbol assigned by exchanges to represent the instrument. 7 | type: string 8 | example: "AAPL" 9 | ISIN: 10 | description: International Securities Identification Number 11 | type: string 12 | example: "US0004026250" 13 | Description: 14 | type: string 15 | example: "Class C" 16 | TransfersPermitted: 17 | description: > 18 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 19 | peer-to-peer transfers. 20 | type: boolean 21 | 22 | -------------------------------------------------------------------------------- /dist/swagger/instruments/TicketAdmission.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Admission ticket 3 | type: object 4 | properties: 5 | AgeRestriction: 6 | description: Age restriction is used to specify required ages for instrument ownership. 7 | type: object 8 | $ref: "#/components/schemas/AgeRestrictionField" 9 | Venue: 10 | type: string 11 | example: "Orion Cinemas - 293 Stehpens St, Vancouver, BC V4A 9V1" 12 | Area: 13 | type: string 14 | example: "Upper Bowl" 15 | Seat: 16 | type: string 17 | example: "Seat 5, or A122" 18 | EventStartTimestamp: 19 | type: number 20 | example: 1594668650000000000 21 | EventName: 22 | type: string 23 | example: "Coingeek Conference - London (November 2018)." 24 | TransfersPermitted: 25 | description: > 26 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 27 | peer-to-peer transfers. 28 | type: boolean 29 | Details: 30 | type: string 31 | Section: 32 | type: string 33 | example: "Sec 1" 34 | Row: 35 | type: string 36 | example: "Sec 1" 37 | EventEndTimestamp: 38 | type: number 39 | example: 1594668650000000000 40 | 41 | -------------------------------------------------------------------------------- /dist/swagger/instruments/components.yaml: -------------------------------------------------------------------------------- 1 | components: 2 | tokenized: 3 | Membership: 4 | $ref: ./_components/schemas/tokenized/instruments/Membership.yaml 5 | Currency: 6 | $ref: ./_components/schemas/tokenized/instruments/Currency.yaml 7 | ShareCommon: 8 | $ref: ./_components/schemas/tokenized/instruments/ShareCommon.yaml 9 | BondFixedRate: 10 | $ref: ./_components/schemas/tokenized/instruments/BondFixedRate.yaml 11 | DiscountCoupon: 12 | $ref: ./_components/schemas/tokenized/instruments/DiscountCoupon.yaml 13 | DeprecatedLoyaltyPoints: 14 | $ref: ./_components/schemas/tokenized/instruments/DeprecatedLoyaltyPoints.yaml 15 | TicketAdmission: 16 | $ref: ./_components/schemas/tokenized/instruments/TicketAdmission.yaml 17 | CasinoChip: 18 | $ref: ./_components/schemas/tokenized/instruments/CasinoChip.yaml 19 | InformationServiceLicense: 20 | $ref: ./_components/schemas/tokenized/instruments/InformationServiceLicense.yaml 21 | CreditNote: 22 | $ref: ./_components/schemas/tokenized/instruments/CreditNote.yaml 23 | RewardPoint: 24 | $ref: ./_components/schemas/tokenized/instruments/RewardPoint.yaml 25 | AgeRestrictionField: 26 | $ref: ./_components/schemas/tokenized/instruments/AgeRestrictionField.yaml 27 | CurrencyValueField: 28 | $ref: ./_components/schemas/tokenized/instruments/CurrencyValueField.yaml 29 | FixedCurrencyValueField: 30 | $ref: ./_components/schemas/tokenized/instruments/FixedCurrencyValueField.yaml 31 | RateField: 32 | $ref: ./_components/schemas/tokenized/instruments/RateField.yaml 33 | -------------------------------------------------------------------------------- /dist/swagger/messages/AcceptRelationship.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Accept a relationship. 3 | type: object 4 | properties: 5 | ProofOfIdentityType: 6 | description: The type/format of the sender's proof of identity. 7 | type: number 8 | ProofOfIdentity: 9 | description: Sender's proof of identity. 10 | type: string 11 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 12 | 13 | -------------------------------------------------------------------------------- /dist/swagger/messages/AdministratorField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Administrator is used to refer to a Administration role in an Entity. 3 | type: object 4 | properties: 5 | Type: 6 | description: > 7 | Chairman, Director, Managing Partner, etc.. Found in 'Roles' in Specification/Resources 8 | type: number 9 | Name: 10 | description: Length 0-255 bytes. 0 is valid. 11 | type: string 12 | example: "Satoshi Nakamoto" 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/messages/ChannelPartyField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Information about an entity in a channel. 3 | type: object 4 | properties: 5 | AdministrativeAddress: 6 | description: > 7 | The address representing the locking script that is required to perform entity administrative 8 | level operations on a channel. Such as add/remove a member, accept/reject proposals, and 9 | requesting/receiving payments. This is recommended to be an m of n multi-signature address. 10 | type: string 11 | OutputIndex: 12 | description: > 13 | Specifies the output containing the locking script for the party. It should also be included in 14 | the M1 ReceiverIndexes. That output must respond with a proof of identity that identifies the 15 | company involved. 16 | type: number 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/messages/Distribution.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | An administrator is making a distribution/payout. Used to publicly declare these payments and allow 4 | holders to be notified of them via the smart contract agent. 5 | type: object 6 | properties: 7 | InstrumentCode: 8 | description: > 9 | A unique code that is used to identify the instrument. It is generated by hashing the contract 10 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 11 | type: string 12 | example: "0e6996402ea456156838652e3bd82c6c0986ef79" 13 | Timestamp: 14 | description: Timestamp in nanoseconds of when the administrator initiated the distribution. 15 | type: number 16 | example: 1594668650000000000 17 | 18 | -------------------------------------------------------------------------------- /dist/swagger/messages/DocumentField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A file containing data. 3 | type: object 4 | properties: 5 | Name: 6 | description: Full name, including file extension, of the file. Length 0-255 bytes. 0 is valid. 7 | type: string 8 | example: "Agreement.pdf" 9 | Type: 10 | description: MIME type of the file. Length 0-255 bytes. 0 is valid. 11 | type: string 12 | example: "application/pdf" 13 | Contents: 14 | description: The contents of the file. 15 | type: string 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/messages/IdentityOracleProofField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A proof of identity based on identity oracles. 3 | type: object 4 | properties: 5 | UserID: 6 | description: The user id (UUID) in the identity oracle system. Used to request the entity data. 7 | type: string 8 | Entity: 9 | description: > 10 | PII is not allowed in entity by GDPR, so only company information can be placed in this entity. 11 | In the future this might be supported for PII with better understanding of GDPR. The identity 12 | being provided. EntityContractAddress is located within this structure. 13 | type: object 14 | $ref: "#/components/schemas/EntityField" 15 | OracleSignature: 16 | description: > 17 | Signature of the serialized entity, public key, and block hash with the identity oracle's 18 | public key. 19 | type: object 20 | $ref: "#/components/schemas/OracleSignatureField" 21 | 22 | -------------------------------------------------------------------------------- /dist/swagger/messages/InitiateThread.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Start a thread from within a conversation or channel. 3 | type: object 4 | properties: 5 | Flag: 6 | description: > 7 | The flag is required to identify messages in the thread so that all members don't have to be 8 | tagged in each message. It is recommended to be a random 20 byte value similar to public key 9 | hashes. The flag will be the Payload of an Envelope protocol message with a Payload Protocol ID 10 | of "F" 11 | type: string 12 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 13 | Seed: 14 | description: > 15 | The seed used to derive keys for the thread. If this value is not specified, then the original 16 | seed value from the parent conversation or channel is used. 17 | type: string 18 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 19 | 20 | -------------------------------------------------------------------------------- /dist/swagger/messages/ManagerField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Manager is used to refer to a role that is responsible for the Management of an Entity. 4 | type: object 5 | properties: 6 | Type: 7 | description: CEO, COO, CFO, etc. Found in 'Roles' in Specification/Resources 8 | type: number 9 | Name: 10 | description: Length 0-255 bytes. 0 is valid. 11 | type: string 12 | example: "Satoshi Nakamoto" 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/messages/Offer.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A message that contains all of the details required for an agreement to be formed. Sent to an 4 | address(es). The Offer should have all, or nearly all, of the details required for the receiving 5 | party to accept the offer. The Offer shall be in the form of a partially formed Bitcoin 6 | transaction with all of the relevent details (offer, consideration, offeror's payment/receipt 7 | details, etc.). The Offer message is different to a Signature Request message in that it is 8 | missing the offeree's payment/receipt details (eg. UTXOs). If the Offer message is well received by 9 | the offeree, then the offeree can add their relevent details (eg. inputs/outputs) and sign the 10 | transaction. If an additional signature is required from the offeror at this point, then the 11 | partially-signed transaction can be sent to the offeror by way of a Signature Request message. 12 | type: object 13 | properties: 14 | Timestamp: 15 | description: Timestamp in nanoseconds for when the message sender created the offer. 16 | type: number 17 | example: 1594668650000000000 18 | Payload: 19 | description: > 20 | Serialized Bitcoin transaction. The transaction needs data added by another party upon 21 | acceptance of offer. 22 | type: string 23 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 24 | 25 | -------------------------------------------------------------------------------- /dist/swagger/messages/OracleSignatureField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A signature from an oracle verifying some data. 3 | type: object 4 | properties: 5 | OracleURL: 6 | description: Base URL of the identity oracle that provided the signature. 7 | type: string 8 | example: "identity.tokenized.com" 9 | BlockHeight: 10 | description: > 11 | The height of the block hash included in the data signed by the oracle. If the value is not 12 | included (zero), then no signature hash is included in the signed data. 13 | type: number 14 | ValidityPeriod: 15 | description: The time frame that the proof is valid. 16 | type: object 17 | $ref: "#/components/schemas/PeriodField" 18 | SignatureAlgorithm: 19 | description: The algorithm used by the oracle signature. 20 | type: number 21 | Signature: 22 | description: Signature of the related data with the oracle's public key. 23 | type: string 24 | 25 | -------------------------------------------------------------------------------- /dist/swagger/messages/OutpointField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Reference to a bitcoin transaction output. 3 | type: object 4 | properties: 5 | TxId: 6 | type: string 7 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 8 | OutputIndex: 9 | description: The index of the output within the referenced transaction. 10 | type: number 11 | 12 | -------------------------------------------------------------------------------- /dist/swagger/messages/OutputMetadata.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Metadata associated with the output. Aka Transaction details. It is used to describe the purpose of 4 | the transaction and add other relevant information. Often encrypted (DH, RSA) to make it private 5 | for one or more parties. DH for b2b where multiple parties can see the description. RSA or the 6 | like for descriptions only visible to one of the transacting parties. Optional 7 | type: object 8 | properties: 9 | OutputDescription: 10 | description: A Description that accompanies the output. A transaction description. 11 | type: string 12 | example: "eg. Invoice 3024, Pay Mike back for camping." 13 | Tags: 14 | description: Predefined values for describing the output. 15 | type: array 16 | items: 17 | type: number 18 | CustomTags: 19 | description: > 20 | Free form text fields for describing the output. Groceries, Moomba Gas Compressor Project, Cash 21 | Register 3, Fitness, Entertainment, Special, VIP Section, North Carolina Store, Waitress: Cindy 22 | Smith, etc. 23 | type: array 24 | items: 25 | type: object 26 | $ref: "#/components/schemas/OutputTagField" 27 | 28 | -------------------------------------------------------------------------------- /dist/swagger/messages/OutputTagField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A tag or category of an output used to categorize and organize outputs from different transactions. 4 | type: object 5 | properties: 6 | Tag: 7 | description: The text of the tag. 8 | type: string 9 | 10 | -------------------------------------------------------------------------------- /dist/swagger/messages/PaymailProofField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A proof of identity based on paymail. 3 | type: object 4 | properties: 5 | UserID: 6 | description: The user id (UUID) in the identity oracle system. Used to request the entity data. 7 | type: string 8 | Handle: 9 | description: > 10 | PII including personally identifiable user names not allowed by GDPR. This is put in for 11 | possible future use without a protocol change. Paymail handle in the form 12 | {alias}@{domain}.{tld} 13 | type: string 14 | example: "john@tokenized.com" 15 | OracleSignature: 16 | description: > 17 | Signature of the serialized entity, public key, and block hash with the identity oracle's 18 | public key. 19 | type: object 20 | $ref: "#/components/schemas/OracleSignatureField" 21 | 22 | -------------------------------------------------------------------------------- /dist/swagger/messages/PendingAcceptRelationship.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A pending accept to a relationship that provides information about a requested participant. 4 | type: object 5 | properties: 6 | ProofOfIdentityType: 7 | description: The type/format of the sender's proof of identity. 8 | type: number 9 | ProofOfIdentity: 10 | description: Sender's proof of identity. 11 | type: string 12 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/messages/PeriodField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A period of time. Begin and end can be optional depending on context. 3 | type: object 4 | properties: 5 | Begin: 6 | description: The start of the period 7 | type: number 8 | example: 1594668650000000000 9 | End: 10 | description: The end of the period 11 | type: number 12 | example: 1594668650000000000 13 | 14 | -------------------------------------------------------------------------------- /dist/swagger/messages/PrivateMessage.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: Generic private message. Sent to another address(es). Encryption is to be used. 3 | type: object 4 | properties: 5 | Timestamp: 6 | description: Timestamp in nanoseconds for when the message sender creates the transaction. 7 | type: number 8 | example: 1594668650000000000 9 | Subject: 10 | description: The subject / topic of the message. 11 | type: string 12 | Regarding: 13 | description: The output of the message that this message is regarding (responding to). 14 | type: object 15 | $ref: "#/components/schemas/OutpointField" 16 | PrivateMessage: 17 | description: Tokenized Ltd announces product launch. 18 | type: object 19 | $ref: "#/components/schemas/DocumentField" 20 | Attachments: 21 | description: Documents attached to the message. 22 | type: array 23 | items: 24 | type: object 25 | $ref: "#/components/schemas/DocumentField" 26 | 27 | -------------------------------------------------------------------------------- /dist/swagger/messages/PublicMessage.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Generic public message or public announcement. Sent to an address(es). Can be used for an official 4 | issuer announcement. 5 | type: object 6 | properties: 7 | Timestamp: 8 | description: Timestamp in nanoseconds for when the message sender creates the transaction. 9 | type: number 10 | example: 1594668650000000000 11 | Subject: 12 | description: The subject / topic of the message. 13 | type: string 14 | Regarding: 15 | description: The output of the message that this message is regarding (responding to). 16 | type: object 17 | $ref: "#/components/schemas/OutpointField" 18 | PublicMessage: 19 | description: Tokenized Ltd. announces product launch. 20 | type: object 21 | $ref: "#/components/schemas/DocumentField" 22 | Attachments: 23 | description: Documents attached to the message. 24 | type: array 25 | items: 26 | type: object 27 | $ref: "#/components/schemas/DocumentField" 28 | 29 | -------------------------------------------------------------------------------- /dist/swagger/messages/RelationshipAmendment.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Amend a relationship. Add/Remove members. Modify permissions. This is encrypted with the current 4 | base encryption secret, but can provide a new base encryption secret that starts after this 5 | message. 6 | type: object 7 | properties: 8 | Seed: 9 | description: The new seed used to derive keys for the relationship after this message. 10 | type: string 11 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 12 | BaseEncryptionSecret: 13 | description: > 14 | The new base encryption secret used to derive encryption secrets for the relationship after 15 | this message. Each time a message is sent, the current seed hash is added to the base 16 | encryption secret and that value is used to encrypt the message. 17 | type: string 18 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 19 | AddMemberIndexes: 20 | description: Indexes to the outputs of the members that are being added to the group. 21 | type: number 22 | DropMemberIndexes: 23 | description: Indexes to the outputs of the members that are being removed from the group. 24 | type: number 25 | 26 | -------------------------------------------------------------------------------- /dist/swagger/messages/RevertedTx.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A message that contains a bitcoin transaction that was accepted by the network or an agent and then 4 | invalidated by a reorg, or zero conf double spend. This serves as on chain evidence of the sending 5 | party's signatures and approval for the given transaction. 6 | type: object 7 | properties: 8 | Timestamp: 9 | description: Timestamp in nanoseconds for when the message sender creates the transaction. 10 | type: number 11 | example: 1594668650000000000 12 | Transaction: 13 | description: Serialized bitcoin transaction that was reverted/invalidated after being accepted. 14 | type: string 15 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/messages/SettlementRequest.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | A message that contains a multi-contract settlement that needs settlement data added by another 4 | contract. Sent to another contract to request data be added. 5 | type: object 6 | properties: 7 | Timestamp: 8 | description: Timestamp in nanoseconds for when the message sender creates the transaction. 9 | type: number 10 | example: 1594668650000000000 11 | TransferTxId: 12 | description: Tx Id of the transfer request transaction that triggered this message. 13 | type: string 14 | example: "9d1ef0b1201c1dec3c1eb1caf758a988205226173e988e7a04afb4ea9977f506" 15 | ContractFees: 16 | description: > 17 | Contract fees (in bitcoin) and addresses(PKHs) where fees should be paid. Added by each 18 | contract as settlement data is added. 19 | type: array 20 | items: 21 | type: object 22 | $ref: "#/components/schemas/TargetAddressField" 23 | Settlement: 24 | description: Serialized settlement OP_RETURN that needs data added by another contract. 25 | type: string 26 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 27 | TransferFees: 28 | description: > 29 | Transfer fees (in bitcoin) and addresses(PKHs) where fees should be paid. Added by each 30 | contract as settlement data is added. 31 | type: array 32 | items: 33 | type: object 34 | $ref: "#/components/schemas/TargetAddressField" 35 | 36 | -------------------------------------------------------------------------------- /dist/swagger/messages/SignatureRequest.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: > 3 | Partially-signed transactions (Tokenized actions, Bitcoin, Multisig, Threshold Signatures, etc.) 4 | can be passed around on-chain to the parties (including Smart Contracts) that still have to sign 5 | the transaction. 6 | type: object 7 | properties: 8 | Timestamp: 9 | description: Timestamp in nanoseconds for when the message sender creates the transaction. 10 | type: number 11 | example: 1594668650000000000 12 | Payload: 13 | description: Full serialized bitcoin tx with multiple inputs from different wallets/users. 14 | type: string 15 | example: "151c232a31383f464d545b626970777e858c939aa1a8afb6" 16 | 17 | -------------------------------------------------------------------------------- /dist/swagger/messages/TargetAddressField.yaml: -------------------------------------------------------------------------------- 1 | 2 | description: A TargetAddress defines a public address and quantity. 3 | type: object 4 | properties: 5 | Address: 6 | description: Public address where the token balance will be changed. 7 | type: string 8 | Quantity: 9 | description: > 10 | Qty of tokens to be frozen, thawed, confiscated or reconciled. For Contract-wide freezes 0 will 11 | be used. 12 | type: number 13 | example: 10000 14 | 15 | -------------------------------------------------------------------------------- /dist/typescript/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /dist/typescript/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /dist/typescript/gulpfile.config.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | var GulpConfig = (function () { 4 | function gulpConfig() { 5 | //Got tired of scrolling through all the comments so removed them 6 | //Don't hurt me AC :-) 7 | this.source = './src/'; 8 | 9 | this.tsOutputPath = './lib'; 10 | this.allJavaScript = [this.source + '/js/**/*.js']; 11 | this.allTypeScript = this.source + '/src/**/*.ts'; 12 | 13 | this.typings = './typings/'; 14 | this.libraryTypeScriptDefinitions = './typings/main/**/*.ts'; 15 | } 16 | return gulpConfig; 17 | })(); 18 | module.exports = GulpConfig; -------------------------------------------------------------------------------- /dist/typescript/gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const tsc = require('gulp-typescript'); 3 | const tslint = require('gulp-tslint'); 4 | const JSON_FILES = ['src/*.json', 'src/**/*.json']; 5 | const Config = require('./gulpfile.config'); 6 | const sourcemaps = require('gulp-sourcemaps'); 7 | 8 | // pull in the project TypeScript config 9 | const tsProject = tsc.createProject('tsconfig.json'); 10 | var config = new Config(); 11 | 12 | gulp.task('scripts', () => { 13 | const tsResult = tsProject.src().pipe(tsProject()); 14 | return tsResult.js.pipe(gulp.dest('dist')); 15 | }); 16 | 17 | gulp.task('watch', gulp.series('scripts', () => { 18 | gulp.watch('src/**/*.ts', gulp.series(['tslint', 'scripts'])); 19 | })); 20 | 21 | gulp.task('instruments', function() { 22 | return gulp.src(JSON_FILES) 23 | .pipe(gulp.dest('dist')); 24 | }); 25 | gulp.task("tslint", () => 26 | gulp.src('src/**/*.ts') 27 | // gulp.src("source.ts") 28 | .pipe(tslint({ 29 | formatter: "verbose" 30 | })) 31 | .pipe(tslint.report()) 32 | ); 33 | gulp.task('compile-ts', function() { 34 | 35 | var tsResult = gulp.src('src/**/*.ts') 36 | .pipe(sourcemaps.init()) 37 | .pipe(tsProject()); 38 | 39 | tsResult.dts.pipe(gulp.dest('dist')); 40 | return tsResult.js 41 | .pipe(sourcemaps.write('.')) 42 | .pipe(gulp.dest('dist')); 43 | }); 44 | 45 | gulp.task('watch', gulp.series(['watch', 'instruments', 'tslint', 'scripts'])); 46 | gulp.task('default', gulp.series(['tslint', 'scripts'])); 47 | -------------------------------------------------------------------------------- /dist/typescript/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | exports.__esModule = true; 6 | __export(require("./dist/actions")); 7 | __export(require("./dist/instruments")); 8 | __export(require("./dist/authorization")); 9 | __export(require("./dist/bytes")); 10 | __export(require("./dist/field_types")); 11 | __export(require("./dist/messages")); 12 | __export(require("./dist/protocol")); 13 | __export(require("./dist/protocol_types")); 14 | __export(require("./dist/rejection_codes")); 15 | __export(require("./dist/resource_data")); 16 | __export(require("./dist/resources")); 17 | -------------------------------------------------------------------------------- /dist/typescript/index.ts: -------------------------------------------------------------------------------- 1 | export * from './src/actions'; 2 | export * from './src/instruments'; 3 | export * from './src/authorization'; 4 | export * from './src/bytes'; 5 | export * from './src/field_types'; 6 | export * from './src/messages'; 7 | export * from './src/protocol'; 8 | export * from './src/protocol_types'; 9 | export * from './src/rejection_codes'; 10 | export * from './src/resource_data'; 11 | export * from './src/resources'; 12 | -------------------------------------------------------------------------------- /dist/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tokenized/tokenized", 3 | "version": "0.0.13", 4 | "description": "Official Tokenized token protocol support for Bitcoin SV", 5 | "author": "Justin Laue ", 6 | "repository": "git@github.com:tokenized/specification.git", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'", 10 | "start": "node ./node_modules/gulp/bin/gulp.js && node dist/test.js", 11 | "debug": "node ./node_modules/gulp/bin/gulp.js && node --inspect dist/test.js", 12 | "debug-brk": "node ./node_modules/gulp/bin/gulp.js && node --inspect-brk dist/test.js", 13 | "watch": "node ./node_modules/gulp/bin/gulp.js watch", 14 | "prepare": "gulp" 15 | }, 16 | "keywords": [ 17 | "tokenized", 18 | "token", 19 | "tokens", 20 | "bitcoin", 21 | "bitcoinsv", 22 | "bitcoin sv", 23 | "bsv" 24 | ], 25 | "license": "Open BSV", 26 | "devDependencies": { 27 | "@types/mocha": "^5.2.6", 28 | "@types/node": "^11.10.4", 29 | "@types/ramda": "^0.26.9", 30 | "chai": "^4.2.0", 31 | "gulp": "^4.0.0", 32 | "gulp-sourcemaps": "^2.6.5", 33 | "gulp-tslint": "^8.1.4", 34 | "gulp-typescript": "^5.0.0", 35 | "mocha": "^6.0.2", 36 | "ts-node": "^8.0.2", 37 | "tslint": "^5.13.0", 38 | "typescript": "^3.3.3333" 39 | }, 40 | "dependencies": { 41 | "@keyring/bsv": "^0.1.4", 42 | "ramda": "^0.26.1", 43 | "sprintf-js": "^1.1.2", 44 | "yaml": "^1.6.0" 45 | } 46 | } -------------------------------------------------------------------------------- /dist/typescript/src/resource-data.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokenized/specification/84dbb49995b63c85fe9bc57b35e415d9d5faca3e/dist/typescript/src/resource-data.ts -------------------------------------------------------------------------------- /dist/typescript/test/bytes.test.ts: -------------------------------------------------------------------------------- 1 | import * as mocha from 'mocha'; 2 | import * as chai from 'chai'; 3 | import { read, write } from '../src/bytes'; 4 | import _ from '@keyring/util'; 5 | const expect = chai.expect; 6 | [mocha] 7 | 8 | describe('read', () => { 9 | it('should read array', () => { 10 | let size = 2; 11 | let buf = new _.Reader(Buffer.from([1, 2, 3, 4, 5, 6])); 12 | const type = '[][3]byte'.slice(2); 13 | let arr = [...Array(size)].map(() => read(buf, type)); 14 | console.log('read arr:', arr); 15 | expect(arr).to.eql([[1,2,3],[4,5,6]]) 16 | }); 17 | }); 18 | 19 | describe('write', () => { 20 | it('should write array', () => { 21 | let size = 2; 22 | let buf = new _.Writer(); 23 | const type = '[][3]byte'.slice(2); 24 | [...Array(size)].map(() => write(buf, [1, 2, 3], type)); 25 | console.log('write buf: ', buf.buf); 26 | expect(buf.buf).to.eql(Buffer.from([1,2,3,1,2,3])); 27 | }); 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /dist/typescript/test/protocol.test.ts: -------------------------------------------------------------------------------- 1 | import * as mocha from 'mocha'; 2 | import * as chai from 'chai'; 3 | import { OpReturnMessage } from '../src/protocol'; 4 | import { PublicKeyHash } from '../src/protocol_types'; 5 | import { InstrumentDefinition } from '../src/actions'; 6 | import { InstrumentTypeMapping, ShareCommon } from '../src/instruments'; 7 | const expect = chai.expect; 8 | [mocha] 9 | 10 | describe('deserialize', () => { 11 | it('should read opreturn', () => { 12 | const sample = '6a0e746573742e746f6b656e697a65644c5700413153484305924924924001000000000000000040420f0000000000380000000000000000000041434d45000000000000000000000000001c0041434d4520436f6d6d6f6e20536861726573202854657374696e6729'; 13 | const msg = OpReturnMessage.Deserialize(Buffer.from(sample, 'hex'), true); 14 | console.log(msg); 15 | const instrument = InstrumentTypeMapping(msg.instrument_type); 16 | instrument.Write(msg.instrument_payload); 17 | console.log(instrument); 18 | 19 | expect(instrument.description).to.eql('ACME Common Shares (Testing)'); 20 | 21 | let restr = OpReturnMessage.Serialize(msg, true).toString('hex'); 22 | 23 | expect(restr).to.eql(sample); 24 | }); 25 | }); 26 | 27 | describe('bitdb', () => { 28 | it('should read opreturn', () => { 29 | const sample = '005432010000435552cc9eda8da0c23cbf1ee0851422e5c0e71eada8ce6246fefd07e602963504bd1d020000f0b9f5050000000001001027000000000000c9c5ad979b1cae15'; 30 | const msg = OpReturnMessage.getMsg(Buffer.from(sample, 'hex')); 31 | console.log(JSON.stringify(msg, null, 2)); 32 | }); 33 | }); 34 | 35 | describe('PublicKeyHash', () => { 36 | it('should decode and encode', () => { 37 | const sample = '17JXjVqzQgZfFZASp3FAY3wcikLp6CAY7h'; 38 | const hash = PublicKeyHash.fromStr(sample); 39 | console.log(JSON.stringify(hash, null, 2)); 40 | expect(hash.format()).to.eql(sample); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /dist/typescript/test/protocol_types.test.ts: -------------------------------------------------------------------------------- 1 | import * as chai from 'chai'; 2 | import { TxId } from '../dist/protocol_types'; 3 | const expect = chai.expect; 4 | 5 | describe('TxId', () => { 6 | it('given a valid TxId, when toString() is called, then the output is a hex string of all 32 bytes.', () => { 7 | // GIVEN 8 | const txIdHex = '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20'; 9 | const txIdBuffer = Buffer.from(txIdHex, 'hex'); 10 | const txId = TxId.fromBytes(txIdBuffer); 11 | 12 | // WHEN 13 | const outputString = txId.toString(); 14 | 15 | // THEN 16 | expect(outputString).to.eql(txIdHex); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/tokenized/specification 2 | 3 | go 1.22 4 | 5 | toolchain go1.22.2 6 | 7 | require ( 8 | github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 9 | github.com/ghodss/yaml v1.0.0 10 | github.com/golang/protobuf v1.5.0 11 | github.com/pkg/errors v0.9.1 12 | github.com/spf13/cobra v0.0.5 13 | github.com/tokenized/bitcoin_interpreter v0.1.1 14 | github.com/tokenized/envelope v1.1.0 15 | github.com/tokenized/logger v0.1.3 16 | github.com/tokenized/pkg v0.7.1-0.20240430132450-c70719707437 17 | github.com/tokenized/txbuilder v1.1.1-0.20230816003850-4414c86d5db4 18 | golang.org/x/crypto v0.22.0 19 | google.golang.org/protobuf v1.34.0 20 | gopkg.in/yaml.v2 v2.3.0 21 | ) 22 | 23 | require ( 24 | github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect 25 | github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect 26 | github.com/bitcoin-sv/go-sdk v0.0.0-20240429162443-77aa5d129a95 // indirect 27 | github.com/btcsuite/btcd v0.24.0 // indirect 28 | github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect 29 | github.com/btcsuite/btcutil v1.0.2 // indirect 30 | github.com/google/uuid v1.3.0 // indirect 31 | github.com/gorilla/websocket v1.5.0 // indirect 32 | github.com/inconshreveable/mousetrap v1.0.0 // indirect 33 | github.com/spf13/pflag v1.0.3 // indirect 34 | github.com/tokenized/channels v0.1.1 // indirect 35 | github.com/tokenized/threads v0.1.2 // indirect 36 | github.com/tyler-smith/go-bip32 v0.0.0-20170922074101-2c9cfd177564 // indirect 37 | golang.org/x/sys v0.19.0 // indirect 38 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect 39 | ) 40 | -------------------------------------------------------------------------------- /internal/cmd/generate/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "path/filepath" 7 | 8 | "github.com/tokenized/specification/internal/golang" 9 | "github.com/tokenized/specification/internal/json" 10 | "github.com/tokenized/specification/internal/markdown" 11 | "github.com/tokenized/specification/internal/platform/parser" 12 | "github.com/tokenized/specification/internal/protobuf" 13 | "github.com/tokenized/specification/internal/python" 14 | "github.com/tokenized/specification/internal/swagger" 15 | "github.com/tokenized/specification/internal/typescript" 16 | ) 17 | 18 | func main() { 19 | dir, err := os.Getwd() 20 | if err != nil { 21 | log.Fatal(err) 22 | } 23 | srcPath := filepath.FromSlash(dir + "/src") 24 | distPath := filepath.FromSlash(dir + "/dist") 25 | 26 | // -------------------------------------------------------------------- 27 | // Prepare Schemas 28 | 29 | actions, err := parser.NewSchema(filepath.FromSlash(srcPath + "/actions/develop")) 30 | if err != nil { 31 | log.Fatal(err) 32 | } 33 | 34 | instruments, err := parser.NewSchema(filepath.FromSlash(srcPath + "/instruments/develop")) 35 | if err != nil { 36 | log.Fatal(err) 37 | } 38 | 39 | messages, err := parser.NewSchema(filepath.FromSlash(srcPath + "/messages/develop")) 40 | if err != nil { 41 | log.Fatal(err) 42 | } 43 | 44 | // -------------------------------------------------------------------- 45 | // Compile Languages 46 | 47 | protobuf.Compile(srcPath, distPath, *actions, *instruments, *messages) 48 | 49 | golang.Compile(srcPath, distPath, *actions, *instruments, *messages) 50 | 51 | json.Compile(srcPath, distPath, *actions, *instruments, *messages) 52 | 53 | markdown.Compile(srcPath, distPath, *actions, *instruments, *messages) 54 | 55 | python.Compile(srcPath, distPath, *actions, *instruments, *messages) 56 | 57 | typescript.Compile(srcPath, distPath, *actions, *instruments, *messages) 58 | 59 | swagger.Compile(srcPath, distPath, *actions, *instruments, *messages) 60 | } 61 | -------------------------------------------------------------------------------- /internal/golang/templates/actions_test.tpl: -------------------------------------------------------------------------------- 1 | package {{ .Package }} 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | 8 | func TestEmptyDeserialize(t *testing.T) { 9 | var ok bool 10 | {{- range .Messages }} 11 | // {{.Name}} identifies a payload as a {{.Name}} message. 12 | action{{.Name}}, err := Deserialize([]byte(Code{{.Name}}), nil) 13 | if err != nil { 14 | t.Fatalf("Failed deserialize for {{.Name}} : %s", err) 15 | } 16 | _, ok = action{{.Name}}.(*{{.Name}}) 17 | if !ok { 18 | t.Fatalf("Failed deserialize type check for {{.Name}}") 19 | } 20 | {{ end }} 21 | } 22 | -------------------------------------------------------------------------------- /internal/golang/templates/binary_marshal.tpl: -------------------------------------------------------------------------------- 1 | package {{ .Package }} 2 | 3 | import ( 4 | "github.com/tokenized/pkg/bitcoin" 5 | 6 | "github.com/golang/protobuf/proto" 7 | "github.com/pkg/errors" 8 | ) 9 | 10 | const ( 11 | binaryVersion = uint8(0) 12 | ) 13 | 14 | {{ range .Messages }} 15 | func (a *{{ .Name }}) MarshalBinary() (data []byte, err error) { 16 | b, err := proto.Marshal(a) 17 | if err != nil { 18 | return nil, errors.Wrap(err, "marshal") 19 | } 20 | 21 | return append([]byte{binaryVersion}, b...), nil 22 | } 23 | 24 | func (a *{{ .Name }}) UnmarshalBinary(data []byte) error { 25 | if len(data) == 0 { 26 | return nil // empty result 27 | } 28 | 29 | if len(data) == 1 && data[0] == bitcoin.OP_FALSE { 30 | return nil // empty result 31 | } 32 | 33 | if len(data) < 2 { 34 | return errors.New("Data too small, missing version or data") 35 | } 36 | 37 | if data[0] != binaryVersion { 38 | return fmt.Errorf("Wrong data version: got %d, want %d", data[0], binaryVersion) 39 | } 40 | 41 | if err := proto.Unmarshal(data[1:], a); err != nil { 42 | return errors.Wrap(err, "protobuf unmarshal") 43 | } 44 | 45 | return nil 46 | } 47 | {{ end }} 48 | 49 | {{ range .FieldTypes }} 50 | func (a *{{ .Name }}Field) MarshalBinary() (data []byte, err error) { 51 | b, err := proto.Marshal(a) 52 | if err != nil { 53 | return nil, errors.Wrap(err, "marshal") 54 | } 55 | 56 | return append([]byte{binaryVersion}, b...), nil 57 | } 58 | 59 | func (a *{{ .Name }}Field) UnmarshalBinary(data []byte) error { 60 | if len(data) == 0 { 61 | return nil // empty result 62 | } 63 | 64 | if len(data) == 1 && data[0] == bitcoin.OP_FALSE { 65 | return nil // empty result 66 | } 67 | 68 | if len(data) < 2 { 69 | return errors.New("Data too small, missing version or data") 70 | } 71 | 72 | if data[0] != binaryVersion { 73 | return fmt.Errorf("Wrong data version: got %d, want %d", data[0], binaryVersion) 74 | } 75 | 76 | if err := proto.Unmarshal(data[1:], a); err != nil { 77 | return errors.Wrap(err, "protobuf unmarshal") 78 | } 79 | 80 | return nil 81 | } 82 | {{ end }} 83 | -------------------------------------------------------------------------------- /internal/golang/templates/copy.tpl: -------------------------------------------------------------------------------- 1 | package {{ .Package }} 2 | 3 | import ( 4 | "bytes" 5 | 6 | proto "github.com/golang/protobuf/proto" 7 | ) 8 | 9 | {{ define "CopyField" -}} 10 | // Field {{ .Name }} - {{ .BaseType }} 11 | {{- if .IsList }} 12 | result.{{ .Name }} = make({{ .GoType }}, len(a.{{ .Name }})) 13 | for i, v := range a.{{ .Name }} { 14 | {{- if eq .BaseType "bin" "varbin" }} 15 | result.{{ .Name }}[i] = make({{ .GoSingularType }}, len(a.{{ .Name }}[i])) 16 | copy(result.{{ .Name }}[i], v) 17 | {{- else if eq .BaseType "fixedchar" "varchar" "uint" "bool" }} 18 | result.{{ .Name }}[i] = v 19 | {{- else }} 20 | result.{{ .Name }}[i] = v.Copy() 21 | {{- end }} 22 | } 23 | {{- else if eq .BaseType "bin" "varbin" }} 24 | result.{{ .Name }} = make({{ .GoType }}, len(a.{{ .Name }})) 25 | copy(result.{{ .Name }}, a.{{ .Name }}) 26 | {{- else if eq .BaseType "fixedchar" "varchar" "uint" "bool" }} 27 | result.{{ .Name }} = a.{{ .Name }} 28 | {{- else }} 29 | result.{{ .Name }} = a.{{ .Name }}.Copy() 30 | {{- end }} 31 | {{ end }} 32 | 33 | {{ range .Messages }} 34 | func (a *{{.Name}}) Copy() *{{.Name}} { 35 | if a == nil { 36 | return nil 37 | } 38 | 39 | result := &{{.Name}}{} 40 | 41 | {{ range .Fields }} 42 | {{- if ne .Type "deprecated" }} 43 | {{ template "CopyField" . -}} 44 | {{- end }} 45 | {{- end }} 46 | 47 | return result 48 | } 49 | {{ end }} 50 | 51 | {{ range .FieldTypes }} 52 | func (a *{{.Name}}Field) Copy() *{{.Name}}Field { 53 | if a == nil { 54 | return nil 55 | } 56 | 57 | result := &{{.Name}}Field{} 58 | 59 | {{ range .Fields }} 60 | {{- if ne .Type "deprecated" }} 61 | {{ template "CopyField" . -}} 62 | {{- end }} 63 | {{- end }} 64 | 65 | return result 66 | } 67 | {{ end }} 68 | -------------------------------------------------------------------------------- /internal/golang/templates/instruments_test.tpl: -------------------------------------------------------------------------------- 1 | package {{ .Package }} 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | 8 | func TestEmptyDeserialize(t *testing.T) { 9 | var ok bool 10 | {{- range .Messages }} 11 | // {{.Name}} identifies a payload as a {{.Name}} message. 12 | instrument{{.Name}}, err := Deserialize([]byte(Code{{.Name}}), nil) 13 | if err != nil { 14 | t.Fatalf("Failed deserialize for {{.Name}} : %s", err) 15 | } 16 | _, ok = instrument{{.Name}}.(*{{.Name}}) 17 | if !ok { 18 | t.Fatalf("Failed deserialize type check for {{.Name}}") 19 | } 20 | {{ end }} 21 | } 22 | -------------------------------------------------------------------------------- /internal/golang/templates/messages_test.tpl: -------------------------------------------------------------------------------- 1 | package {{ .Package }} 2 | 3 | import ( 4 | "bytes" 5 | "encoding/binary" 6 | "testing" 7 | ) 8 | 9 | 10 | func TestEmptyDeserialize(t *testing.T) { 11 | var ok bool 12 | {{- range .Messages }} 13 | // {{.Name}} identifies a payload as a {{.Name}} message. 14 | message{{.Name}}, err := Deserialize(Code{{.Name}}, nil) 15 | if err != nil { 16 | t.Fatalf("Failed deserialize for {{.Name}} : %s", err) 17 | } 18 | _, ok = message{{.Name}}.(*{{.Name}}) 19 | if !ok { 20 | t.Fatalf("Failed deserialize type check for {{.Name}}") 21 | } 22 | {{ end }} 23 | } 24 | -------------------------------------------------------------------------------- /internal/markdown/markdown.go: -------------------------------------------------------------------------------- 1 | package markdown 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | 7 | "github.com/tokenized/specification/internal/platform/parser" 8 | "gopkg.in/yaml.v2" 9 | ) 10 | 11 | func Compile( 12 | srcPath, distPath string, 13 | actions parser.Schema, 14 | instruments parser.Schema, 15 | messages parser.Schema, 16 | ) { 17 | 18 | templateToFile(distPath, "protocol-actions.tpl", "protocol-actions.md", actions) 19 | 20 | templateToFile(distPath, "protocol-instruments.tpl", "protocol-instruments.md", instruments) 21 | 22 | templateToFile(distPath, "protocol-messages.tpl", "protocol-messages.md", messages) 23 | 24 | resources := fetchResources(srcPath) 25 | 26 | templateToFile(distPath, "protocol-resources.tpl", "protocol-resources.md", resources) 27 | } 28 | 29 | func templateToFile(distPath, tplFile, goFile string, data interface{}) { 30 | 31 | tpl := "./internal/markdown/templates/" + tplFile 32 | 33 | path := distPath + "/markdown/" + goFile 34 | 35 | parser.HtmlTemplateToFile(data, tpl, path) 36 | } 37 | 38 | func fetchResources(srcPath string) []parser.Resource { 39 | path := srcPath + "/resources/develop" 40 | 41 | filenames := parser.FetchFiles(path) 42 | 43 | items := []parser.Resource{} 44 | 45 | for _, filename := range filenames { 46 | data, err := ioutil.ReadFile(filename) 47 | if err != nil { 48 | panic(err) 49 | } 50 | 51 | m := parser.Resource{} 52 | if err := yaml.Unmarshal(data, &m); err != nil { 53 | panic(fmt.Errorf("file %v : %s", filename, err)) 54 | } 55 | 56 | items = append(items, m) 57 | } 58 | 59 | return items 60 | } 61 | -------------------------------------------------------------------------------- /internal/markdown/templates/protocol-resources.tpl: -------------------------------------------------------------------------------- 1 | {{$resourceTypes := . -}} 2 | 3 | # Protocol Resources 4 | 5 | - [Introduction](#introduction) 6 | - [Available Resources](#all-resources) 7 | 8 | 9 | ## Introduction 10 | 11 | Resources are used to define lists of values, like the definitions of the possible values for a type field. 12 | 13 | 14 | ## Available Resources 15 | 16 |
17 | {{- range $resourceTypes }} 18 | - [{{.Name}}](#resource-{{kebabcase .Name}}) 19 | {{- end }} 20 |
21 | 22 | 23 | {{- range $resourceTypes}} 24 | 25 | 26 | #### {{.Name}} 27 | 28 | {{.Description}} 29 | 30 | [View Source File](https://github.com/tokenized/specification/blob/master/src/resources/develop/{{.Name}}.yaml) 31 | 32 |
33 | {{- range .Values}} 34 | - {{ if .Name }}{{.Name}}{{ else }}{{.Label}}{{ end }} 35 | {{- end }} 36 |
37 | {{ end }} 38 | -------------------------------------------------------------------------------- /internal/platform/parser/helpers.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | htmlTemplate "html/template" 5 | "os" 6 | "path" 7 | "path/filepath" 8 | "strings" 9 | "text/template" 10 | ) 11 | 12 | // TemplateToFile renders a template to a file 13 | func TemplateToFile(data interface{}, files ...string) { 14 | f, err := os.Create(files[len(files)-1]) 15 | if err != nil { 16 | panic(err) 17 | } 18 | 19 | tmplFuncs := MakeTemplateFuncs() 20 | 21 | tmpl := template.Must(template.New(path.Base(files[len(files)-2])).Funcs(tmplFuncs).ParseFiles(files[:len(files)-1]...)) 22 | 23 | if err := tmpl.Execute(f, data); err != nil { 24 | panic(err) 25 | } 26 | } 27 | 28 | // HtmlTemplateToFile renders an html template to a file 29 | func HtmlTemplateToFile(data interface{}, files ...string) { 30 | f, err := os.Create(files[len(files)-1]) 31 | if err != nil { 32 | panic(err) 33 | } 34 | 35 | tmplFuncs := MakeHtmlTemplateFuncs() 36 | 37 | tmpl := htmlTemplate.Must(htmlTemplate.New(path.Base(files[len(files)-2])).Funcs(tmplFuncs).ParseFiles(files[:len(files)-1]...)) 38 | 39 | if err := tmpl.Execute(f, data); err != nil { 40 | panic(err) 41 | } 42 | } 43 | 44 | // FetchFiles fetches all the file names in a directory 45 | func FetchFiles(dirPath string) []string { 46 | filenames := []string{} 47 | 48 | fn := func(path string, fileInfo os.FileInfo, err error) error { 49 | if err != nil { 50 | return err 51 | } 52 | 53 | if !strings.HasSuffix(path, ".yaml") { 54 | return nil 55 | } 56 | 57 | // Do not go in to sub directories 58 | if filepath.Dir(path) != dirPath { 59 | return nil 60 | } 61 | 62 | filenames = append(filenames, path) 63 | 64 | return nil 65 | } 66 | 67 | if err := filepath.Walk(dirPath, fn); err != nil { 68 | panic(err) 69 | } 70 | 71 | return filenames 72 | } 73 | -------------------------------------------------------------------------------- /internal/protobuf/protobuf.go: -------------------------------------------------------------------------------- 1 | package protobuf 2 | 3 | import ( 4 | "github.com/tokenized/specification/internal/platform/parser" 5 | ) 6 | 7 | func Compile( 8 | srcPath, distPath string, 9 | actions parser.Schema, 10 | instruments parser.Schema, 11 | messages parser.Schema, 12 | ) { 13 | templateToFile(distPath, "schema.tpl", "actions.proto", actions) 14 | 15 | templateToFile(distPath, "schema.tpl", "instruments.proto", instruments) 16 | 17 | templateToFile(distPath, "schema.tpl", "messages.proto", messages) 18 | } 19 | 20 | func templateToFile(distPath, tplFile, protoFile string, data interface{}) { 21 | 22 | tpl := "./internal/protobuf/templates/" + tplFile 23 | 24 | path := distPath + "/protobuf/" + protoFile 25 | 26 | parser.TemplateToFile(data, tpl, path) 27 | } 28 | -------------------------------------------------------------------------------- /internal/protobuf/templates/schema.tpl: -------------------------------------------------------------------------------- 1 | {{$messages := .Messages -}} 2 | {{$fieldTypes := .FieldTypes -}} 3 | 4 | syntax = "proto3"; 5 | 6 | option go_package="github.com/tokenized/specification/dist/golang/{{.Package}}"; 7 | 8 | package {{.Package}}; 9 | {{ range $messages }} 10 | // Message - {{.Label}} ({{.Code}}) 11 | message {{.Name}} { 12 | {{- range $i, $a := .Fields}} 13 | {{- if eq .Type "deprecated" }} 14 | reserved 15 | {{- padding (print "reserved") 48}} {{add $i 1}}; 16 | {{- padding (print $i) 3}} // Deprecated {{ .Name }} 17 | {{- else }} 18 | {{ .ProtobufType }} {{.Name}} 19 | {{- padding (print .Name .ProtobufType) 45}} = {{add $i 1}}; 20 | {{- padding (print $i) 3}} // {{.Type}} 21 | {{- end }} 22 | {{- end }} 23 | } 24 | {{ end }} 25 | {{range $i, $a := $fieldTypes}} 26 | // Field - {{.Label}} 27 | message {{.Name}}Field { 28 | {{- range $i, $a := .Fields}} 29 | {{- if eq .Type "deprecated" }} 30 | reserved 31 | {{- padding (print "reserved") 48}} {{add $i 1}}; 32 | {{- padding (print $i) 3}} // Deprecated {{ .Name }} 33 | {{- else }} 34 | {{ .ProtobufType }} {{.Name}} 35 | {{- padding (print .Name .ProtobufType) 45}} = {{add $i 1}}; 36 | {{- padding (print $i) 3}} // {{.Type}} 37 | {{- end }} 38 | {{- end }} 39 | } 40 | {{ end }} 41 | -------------------------------------------------------------------------------- /internal/python/python.go: -------------------------------------------------------------------------------- 1 | package python 2 | 3 | import ( 4 | "github.com/tokenized/specification/internal/platform/parser" 5 | ) 6 | 7 | func Compile( 8 | srcPath, distPath string, 9 | actions parser.Schema, 10 | instruments parser.Schema, 11 | messages parser.Schema, 12 | ) { 13 | // Actions 14 | parser.TemplateToFile(actions, "internal/python/templates/actions.tpl", 15 | distPath+"/python/"+"actions_generated.py") 16 | } 17 | -------------------------------------------------------------------------------- /internal/python/templates/actions.tpl: -------------------------------------------------------------------------------- 1 | 2 | import actions_pb2 3 | 4 | {{ range .Messages }} 5 | # Code{{.Name}} identifies a payload as a {{.Name}} action message. 6 | Code{{.Name}} = b'{{.Code}}' 7 | {{ end }} 8 | 9 | def getActionObject(actionCode): 10 | {{- range .Messages }} 11 | if actionCode == Code{{.Name}}: 12 | return actions_pb2.{{.Name}}() 13 | {{- end }} 14 | 15 | raise Exception("Unsupported action code: ", str(actionCode)) 16 | 17 | def parseActionObject(actionCode, actionData): 18 | action = getActionObject(actionCode) 19 | action.ParseFromString(actionData) 20 | return action 21 | -------------------------------------------------------------------------------- /internal/swagger/templates/components.tpl: -------------------------------------------------------------------------------- 1 | components: 2 | tokenized: 3 | {{- range .Messages }} 4 | {{ .Name }}: 5 | $ref: ./_components/schemas/tokenized/{{ $.Package }}/{{ .Name }}.yaml 6 | {{- end }} 7 | {{- range .FieldTypes }} 8 | {{ .Name }}Field: 9 | $ref: ./_components/schemas/tokenized/{{ $.Package }}/{{ .Name }}Field.yaml 10 | {{- end }} 11 | -------------------------------------------------------------------------------- /internal/typescript/typescript.go: -------------------------------------------------------------------------------- 1 | package typescript 2 | 3 | import ( 4 | "github.com/tokenized/specification/internal/platform/parser" 5 | ) 6 | 7 | func Compile( 8 | srcPath, distPath string, 9 | actions parser.Schema, 10 | instruments parser.Schema, 11 | messages parser.Schema, 12 | ) { 13 | // TODO 14 | } 15 | -------------------------------------------------------------------------------- /src/actions/develop/actions/C5 - Contract Address Change.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Contract Address Change Action: This txn is signed by the master contract key and changes the active contract address which the contract receives and responds to requests. This is a worst case scenario fallback to only be used when the contract private key is believed to be exposed. 3 | # 4 | 5 | code: C5 6 | name: ContractAddressChange 7 | label: Contract Address Change 8 | description: This txn is signed by the master contract key defined in the contract formation and changes the active contract address which the contract uses to receive and respond to requests. This is a worst case scenario fallback to only be used when the contract private key is believed to be exposed. 9 | 10 | metadata: 11 | inputs: 12 | - name: ContractMaster 13 | label: Contract Master Public Address 14 | comments: "The contract master address." 15 | 16 | outputs: 17 | - name: Contract 18 | label: Contract Public Address 19 | comments: "Currently active, and soon to be deactivated, contract address." 20 | 21 | fields: 22 | - name: NewContractAddress 23 | label: New Contract Address 24 | description: The address to be used by all future requests/responses for the contract. 25 | type: Address 26 | 27 | - name: Timestamp 28 | label: Timestamp 29 | description: "Timestamp in nanoseconds of when the action was created." 30 | type: Timestamp 31 | -------------------------------------------------------------------------------- /src/actions/develop/actions/C6 - Body of Agreement Offer.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Body of Agreement Offer Action: Allows the administration to define the agreement for the contract. 3 | # 4 | 5 | code: C6 6 | name: BodyOfAgreementOffer 7 | label: "Body Of Agreement Offer" 8 | description: "Allows the administration to define the agreement for the contract." 9 | 10 | metadata: 11 | validation: BodyOfAgreementFormation 12 | rejection: Rejection 13 | 14 | inputs: 15 | - name: Administration 16 | label: "Administration's Public Address" 17 | 18 | outputs: 19 | - name: Contract 20 | label: "Contract Public Address" 21 | 22 | fields: 23 | - name: Chapters 24 | label: Chapters 25 | description: "A list of chapters for the agreement." 26 | type: Chapter[] 27 | 28 | - name: Definitions 29 | label: Definitions 30 | description: "Definition of values within the agreement." 31 | type: DefinedTerm[] 32 | -------------------------------------------------------------------------------- /src/actions/develop/actions/C7 - Body of Agreement Formation.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Body of Agreement Formation Action: Provides the current version of the body of agreement for the contract. 3 | # 4 | 5 | code: C7 6 | name: BodyOfAgreementFormation 7 | label: "Body Of Agreement Formation" 8 | description: "Provides the current version of the body of agreement for the contract." 9 | 10 | metadata: 11 | inputs: 12 | - name: Contract 13 | label: "Contract Public Address" 14 | 15 | outputs: 16 | - name: Contract 17 | label: "Contract Public Address" 18 | 19 | fields: 20 | - name: Chapters 21 | label: Chapters 22 | description: "A list of chapters for the agreement." 23 | type: Chapter[] 24 | 25 | - name: Definitions 26 | label: Definitions 27 | description: "Definition of terms within the agreement." 28 | type: DefinedTerm[] 29 | 30 | - name: Revision 31 | label: Revision 32 | description: "A counter for the number of times this agreement has been revised using a modification action." 33 | type: uint 34 | size: 4 35 | example: "0" 36 | notes: "Can't be changed by the administration, operator. Smart contract controls." 37 | 38 | - name: Timestamp 39 | label: Timestamp 40 | description: "Timestamp in nanoseconds of when the smart contract created the action." 41 | type: Timestamp 42 | notes: "Can't be changed by the administration, operator. Smart contract controls." 43 | -------------------------------------------------------------------------------- /src/actions/develop/actions/C8 - Body of Agreement Amendment.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Body of Agreement Amendment Action: Allows the administration to modify the agreement for the contract. 3 | # 4 | 5 | code: C8 6 | name: BodyOfAgreementAmendment 7 | label: "Body Of Agreement Amendment" 8 | description: "Allows the administration to modify the agreement for the contract." 9 | 10 | metadata: 11 | validation: BodyOfAgreementFormation 12 | rejection: Rejection 13 | 14 | inputs: 15 | - name: Administration 16 | label: "Administration's Public Address" 17 | 18 | outputs: 19 | - name: Contract 20 | label: "Contract Public Address" 21 | 22 | fields: 23 | 24 | - name: Revision 25 | label: Revision 26 | description: "The current revision figure to ensure the modification provided is based on the latest version." 27 | type: uint 28 | size: 4 29 | example: 0 30 | notes: "Cannot be Amended" 31 | 32 | - name: Amendments 33 | label: Amendments 34 | type: Amendment[] 35 | description: A collection of modifications to perform on this instrument. 36 | 37 | - name: RefTxID 38 | label: Ref Tx ID 39 | description: "The Bitcoin transaction ID of the associated result action that permitted the modifications. See Governance for more details." 40 | type: TxId 41 | 42 | -------------------------------------------------------------------------------- /src/actions/develop/actions/E3 - Thaw.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Thaw Action: to be used to comply with contractual obligations, legal requirements, or issuer requirements. The target address(es) tokens will be unfrozen to allow them to resume normal exchange and governance activities. 3 | # 4 | 5 | code: E3 6 | name: Thaw 7 | label: Thaw 8 | description: > 9 | The contract responding to an Order action to thaw instruments. 10 | To be used to comply with contractual obligations or legal requirements. 11 | The Alleged Offender's tokens will be unfrozen to allow them to resume normal exchange and governance activities. 12 | 13 | metadata: 14 | inputs: 15 | - name: Contract 16 | label: Contract Public Address 17 | comments: "The contract that is performing this action." 18 | 19 | outputs: 20 | - name: TargetX 21 | label: Target Public Address X 22 | comments: "Can be the Contract Address for a 'Contract-wide' Thaw in response to a Contract-wide Freeze." 23 | 24 | fields: 25 | - name: FreezeTxId 26 | label: Freeze Tx Id 27 | description: "The tx id of the freeze action that is being reversed." 28 | type: TxId 29 | 30 | - name: Timestamp 31 | label: Timestamp 32 | description: "Timestamp in nanoseconds of when the smart contract created the action." 33 | type: Timestamp 34 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 35 | -------------------------------------------------------------------------------- /src/actions/develop/actions/E5 - Deprecated Reconciliation.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Reconciliation Action: to be used at the direction of the administration to fix record keeping errors with bitcoin and token balances. 3 | # 4 | 5 | code: E5 6 | name: DeprecatedReconciliation 7 | label: Deprecated Reconciliation 8 | description: > 9 | This action has been deprecated for Rectified Settlement. 10 | The contract responding to an Order action to reconcile instruments. 11 | To be used at the direction of the administration to fix record keeping errors with bitcoin and token balances. 12 | 13 | metadata: 14 | inputs: 15 | - name: Contract 16 | label: Contract Public Address 17 | comments: "The contract that is performing this action." 18 | 19 | outputs: 20 | - name: TargetX 21 | label: Target Public Address X 22 | comments: 546 minimum. If N bitcoin needs to be sent to the address, then this will be the output that receives the Bitcoin. 23 | 24 | fields: 25 | - name: InstrumentType 26 | label: Instrument Type 27 | description: "Three letter character that specifies the instrument type." 28 | type: fixedchar 29 | size: 3 30 | example: "SHC" 31 | 32 | - name: InstrumentCode 33 | label: Instrument Code 34 | description: A unique code that is used to identify the instrument. It is generated by hashing the contract public key hash and the instrument index. SHA256(contract PKH + instrument index) 35 | type: InstrumentCode 36 | notes: "Cannot be changed by the administration, operator or smart contract." 37 | 38 | - name: Quantities 39 | label: Quantities 40 | description: "The holders effected by the reconciliation and their balance remaining." 41 | type: QuantityIndex[] 42 | listSize: small 43 | 44 | - name: Timestamp 45 | label: Timestamp 46 | description: "Timestamp in nanoseconds of when the smart contract created the action." 47 | type: Timestamp 48 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 49 | -------------------------------------------------------------------------------- /src/actions/develop/actions/G2 - Vote.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Vote Action: A vote is created by the Contract in response to a valid Proposal Action. 3 | # 4 | 5 | code: G2 6 | name: Vote 7 | label: Vote 8 | description: "A vote is created by the Contract in response to a valid Proposal Action." 9 | 10 | metadata: 11 | inputs: 12 | - name: Contract 13 | label: Contract Public Address 14 | comments: "The contract that is performing this action." 15 | 16 | outputs: 17 | - name: Contract 18 | label: Contract Public Address 19 | comments: "Required so that users can monitor transactions to the contract for notifications of this action." 20 | 21 | fields: 22 | - name: Timestamp 23 | label: Timestamp 24 | description: "Timestamp in nanoseconds of when the smart contract created the action." 25 | type: Timestamp 26 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 27 | -------------------------------------------------------------------------------- /src/actions/develop/actions/G3 - Ballot Cast.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Ballot Cast Action: Used by Token Owners to cast their ballot (vote) on proposals. 1 Vote per token unless a vote multiplier is specified in the relevant Instrument Definition action. 3 | # 4 | 5 | code: G3 6 | name: BallotCast 7 | label: Ballot Cast 8 | description: "Used by Token Owners to cast their ballot (vote) on proposals. 1 Vote per token unless a vote multiplier is specified in the relevant Instrument Definition action." 9 | 10 | metadata: 11 | validation: BallotCounted 12 | rejection: Rejection 13 | 14 | inputs: 15 | - name: User 16 | label: "Token Owner's Public Address" 17 | comments: "The user casting the ballot for this contract." 18 | 19 | outputs: 20 | - name: Contract 21 | label: Contract Public Address 22 | comments: "Funds ballot cast response." 23 | 24 | fields: 25 | - name: VoteTxId 26 | label: Vote Tx ID 27 | description: "Tx ID of the Vote the Ballot Cast is being made for." 28 | type: TxId 29 | 30 | - name: Vote 31 | label: Vote 32 | description: "Length 1-255 bytes. 0 is not valid. Max length is the VoteMax value from the Proposal action. Accept, Reject, Abstain, Spoiled, Multiple Choice, or Preference List. 15 options total. Order of preference. 1st position = 1st choice. 2nd position = 2nd choice, etc. A is always Accept and B is always reject in a Y/N votes." 33 | type: varchar 34 | example: "A" 35 | -------------------------------------------------------------------------------- /src/actions/develop/actions/G4 - Ballot Counted.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Ballot Counted Action: The smart contract will respond to a Ballot Cast action with a Ballot Counted action if the Ballot Cast is valid. If the Ballot Cast is not valid, then the smart contract will respond with a Rejection Action. 3 | # 4 | 5 | code: G4 6 | name: BallotCounted 7 | label: Ballot Counted 8 | description: "The smart contract will respond to a Ballot Cast action with a Ballot Counted action if the Ballot Cast is valid. If the Ballot Cast is not valid, then the smart contract will respond with a Rejection Action." 9 | 10 | metadata: 11 | inputs: 12 | - name: Contract 13 | label: Contract Public Address 14 | comments: "The contract that is performing this action." 15 | 16 | outputs: 17 | - name: Contract 18 | label: Contract Public Address 19 | comments: "Required so that users can monitor transactions to the contract for notifications of this action." 20 | 21 | fields: 22 | - name: VoteTxId 23 | label: Vote Tx ID 24 | description: "Tx ID of the Vote the Ballot Cast is being made for." 25 | type: TxId 26 | 27 | - name: Vote 28 | label: Vote 29 | description: "Length 1-255 bytes. 0 is not valid. Max length is the VoteMax value from the Proposal action. Accept, Reject, Abstain, Spoiled, Multiple Choice, or Preference List. 15 options total. Order of preference. 1st position = 1st choice. 2nd position = 2nd choice, etc. A is always Accept and B is always reject in a Y/N votes." 30 | type: varchar 31 | example: "A" 32 | 33 | - name: Quantity 34 | label: Quantity 35 | description: "Number of votes counted for this ballot. Factors in vote multipliers if there are any allowed, otherwise it is just quantity of tokens held." 36 | type: uint 37 | size: 8 38 | 39 | - name: Timestamp 40 | label: Timestamp 41 | description: "Timestamp in nanoseconds of when the smart contract created the action." 42 | type: Timestamp 43 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 44 | -------------------------------------------------------------------------------- /src/actions/develop/actions/I3 - Instrument Modification.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Instrument Modification Action: Token Dilutions, Call Backs/Revocations, Burning, Trade Restrictions, etc. 3 | # 4 | 5 | code: I3 6 | name: InstrumentModification 7 | label: Instrument Modification 8 | description: "Token Dilutions, Call Backs/Revocations, burning etc." 9 | 10 | metadata: 11 | validation: InstrumentCreation 12 | rejection: Rejection 13 | 14 | inputs: 15 | - name: Administration 16 | label: "Administration's Public Address" 17 | comments: "This action can only come from the administration." 18 | 19 | outputs: 20 | - name: Contract 21 | label: Contract Public Address 22 | comments: "The contract that this instrument currently belongs to. Must include enough for the responding action." 23 | 24 | fields: 25 | - name: InstrumentType 26 | label: Instrument Type 27 | description: "Three letter character that specifies the instrument type." 28 | type: fixedchar 29 | size: 3 30 | example: "SHC" 31 | 32 | - name: InstrumentCode 33 | label: Instrument Code 34 | description: A unique code that is used to identify the instrument. It is generated by hashing the contract public key hash and the instrument index. SHA256(contract PKH + instrument index) 35 | type: InstrumentCode 36 | notes: "Cannot be changed by the administration, operator or smart contract." 37 | 38 | - name: InstrumentRevision 39 | label: Instrument Revision 40 | description: "The current revision figure to ensure the modification provided is based on the latest version." 41 | type: uint 42 | size: 4 43 | example: 0 44 | notes: "Cannot be Amended" 45 | 46 | - name: Amendments 47 | label: Amendments 48 | type: Amendment[] 49 | description: A collection of modifications to perform on this instrument. 50 | 51 | - name: RefTxID 52 | label: Ref Tx ID 53 | description: "The Bitcoin transaction ID of the associated result action that permitted the modifications. See Governance for more details." 54 | type: TxId 55 | -------------------------------------------------------------------------------- /src/actions/develop/actions/R1 - Establishment.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Establishment Action: Establishes an on-chain register. 3 | # 4 | 5 | code: R1 6 | name: Establishment 7 | label: Establishment 8 | description: "Establishes an on-chain register." 9 | 10 | metadata: 11 | inputs: 12 | - name: Register 13 | label: "Register Public Address" 14 | comments: "The address of the associated register." 15 | 16 | outputs: 17 | - name: Register 18 | label: "Register Public Address" 19 | comments: "Required so that users can monitor transactions to the register for notifications of this action." 20 | 21 | fields: 22 | - name: Message 23 | label: Message 24 | description: "A custom message to include with this action." 25 | type: varchar 26 | varSize: medium 27 | example: "North America Whitelist" 28 | -------------------------------------------------------------------------------- /src/actions/develop/actions/R2 - Addition.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Addition Action: Adds an entry to the Register. 3 | # 4 | 5 | code: R2 6 | name: Addition 7 | label: Addition 8 | description: "Adds an entry to the Register." 9 | 10 | metadata: 11 | inputs: 12 | - name: Register 13 | label: "Register Public Address" 14 | comments: "The address of the associated register." 15 | 16 | outputs: 17 | - name: Register 18 | label: "Register Public Address" 19 | comments: "Required so that users can monitor transactions to the register for notifications of this action." 20 | 21 | fields: 22 | - name: Message 23 | label: Message 24 | description: "A custom message to include with this action." 25 | type: varchar 26 | varSize: medium 27 | example: "username" 28 | -------------------------------------------------------------------------------- /src/actions/develop/actions/R3 - Alteration.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Alteration Action: A register entry/record can be altered. 3 | # 4 | 5 | code: R3 6 | name: Alteration 7 | label: Alteration 8 | description: "A register entry/record can be altered." 9 | 10 | metadata: 11 | inputs: 12 | - name: Register 13 | label: "Register Public Address" 14 | comments: "The address of the associated register." 15 | 16 | outputs: 17 | - name: Register 18 | label: "Register Public Address" 19 | comments: "Required so that users can monitor transactions to the register for notifications of this action." 20 | 21 | fields: 22 | - name: EntryTxID 23 | label: Entry Tx ID 24 | description: "Transaction ID of the register entry to be altered." 25 | type: TxId 26 | 27 | - name: Message 28 | label: Message 29 | description: "A custom message to include with this action." 30 | type: varchar 31 | varSize: medium 32 | example: "Changed Country of Residence" 33 | -------------------------------------------------------------------------------- /src/actions/develop/actions/R4 - Removal.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Removal Action: Removes an entry/record from the Register. 3 | # 4 | 5 | code: R4 6 | name: Removal 7 | label: Removal 8 | description: "Removes an entry/record from the Register." 9 | 10 | metadata: 11 | inputs: 12 | - name: Register 13 | label: "Register Public Address" 14 | comments: "The address of the associated register." 15 | 16 | outputs: 17 | - name: Register 18 | label: "Register Public Address" 19 | comments: "Required so that users can monitor transactions to the register for notifications of this action." 20 | 21 | fields: 22 | - name: EntryTxID 23 | label: Entry Tx ID 24 | description: "Transaction ID of the register entry to be altered." 25 | type: TxId 26 | 27 | - name: Message 28 | label: Message 29 | description: "A custom message to include with this action." 30 | type: varchar 31 | varSize: medium 32 | example: "Removed due to violation of company policy." 33 | -------------------------------------------------------------------------------- /src/actions/develop/actions/T2 - Settlement.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Settlement Action: Settles the transfer request of bitcoins and tokens from transfer (T1) actions. 3 | # 4 | 5 | code: T2 6 | name: Settlement 7 | label: Settlement 8 | description: "Settles the transfer request of bitcoins and tokens from transfer (T1) actions." 9 | 10 | metadata: 11 | inputs: 12 | - name: InstrumentXContract 13 | label: Contract Public Address (Instrument X) 14 | comments: Contract (Instrument X) in response to a transfer action with Instrument X being sent to another address(es). 15 | 16 | outputs: 17 | - name: InstrumentXSettlementAddressX 18 | label: "Instrument 1 Settlement Address X" 19 | comments: Address X that is being settled for Instrument 1. 20 | 21 | fields: 22 | - name: Instruments 23 | label: Instruments 24 | description: "The Instruments settled by the transfer action." 25 | type: InstrumentSettlement[] 26 | 27 | - name: Timestamp 28 | label: Timestamp 29 | description: "Timestamp in nanoseconds of when the smart contract created the action." 30 | type: Timestamp 31 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 32 | -------------------------------------------------------------------------------- /src/actions/develop/actions/T3 - Rectification Settlement.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Rectification Settlement Action: Settles a transfer (T1) request that was originally accepted, but 3 | # the transfer transaction had inputs that spent UTXOs that were also spent by other transactions, 4 | # and the conflicting UTXO spends confirmed, which prevented the original settlement (T2) 5 | # transaction from confirming in a block. Since the smart contract agent is the single source of 6 | # truth, the settlement is "finalized" as soon as it is created, so if it doesn't confirm in a block 7 | # then the ledger is not up to date. This action repairs the ledger. The conflicted settlement 8 | # action contains the original transfer showing the authorizations for the transfer and the original 9 | # settlement data. 10 | # 11 | 12 | code: T3 13 | name: RectificationSettlement 14 | label: Rectification Settlement 15 | description: > 16 | Settles the transfer request of tokens from transfer (T1) actions in the case when a transaction 17 | conflicting with the T1 transaction prevents the T1 and T2 from being confirmed in a block. 18 | 19 | metadata: 20 | inputs: 21 | - name: Contract 22 | label: Contract's Public Address 23 | 24 | outputs: 25 | - name: SettlementAddresses 26 | label: Settlement Addresses 27 | comments: Outputs for each address that is involved in the transfer. 28 | 29 | fields: 30 | - name: Transfer 31 | label: Transfer 32 | description: > 33 | The transfer (T1) transaction that had a conflict that kept it from confirming in a block. 34 | type: ReferenceTransaction 35 | 36 | - name: Instruments 37 | label: Instruments 38 | description: "The Instruments settled by the transfer action." 39 | type: InstrumentSettlement[] 40 | 41 | - name: Timestamp 42 | label: Timestamp 43 | description: "Timestamp in nanoseconds of when the smart contract created the action." 44 | type: Timestamp 45 | notes: "Cannot be changed by the administration, operator. Smart contract controls." 46 | -------------------------------------------------------------------------------- /src/actions/develop/types/AdminIdentityCertificate.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: AdminIdentityCertificate 3 | label: Administrator Identity Certificate 4 | description: > 5 | A certificate provided by an identity oracle to verify the administrator address is associated 6 | with the issuer entity identification information. Also if a contract operator is provided then 7 | it verifies that the contract operator address is associated with the specified contract 8 | operator identity information. For a child contract that references a parent entity contract 9 | the certificate verifies that the administrator address is associated with that entity contract. 10 | 11 | fields: 12 | - name: EntityContract 13 | label: Entity Contract 14 | description: "The entity contract address of the service on chain that defines the identity oracle." 15 | type: Address 16 | 17 | - name: Signature 18 | label: Signature 19 | type: Signature 20 | description: > 21 | The signature provided by the oracle specified. The first input must correspond to the 22 | administration entity and, if a contract operator is included, the second input must 23 | correspond to the contract operator entity." 24 | 25 | - name: BlockHeight 26 | label: Block height 27 | description: The block height of the block hash used in the oracle signature. 28 | type: uint 29 | size: 4 30 | 31 | - name: Expiration 32 | label: Expiration 33 | description: > 34 | Oracles have the option to specify an expiration after which a new certificate should be 35 | provided. 36 | type: Timestamp 37 | -------------------------------------------------------------------------------- /src/actions/develop/types/Administrator.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Administrator 3 | label: Administrator 4 | description: "Administrator is used to refer to a Administration role in an Entity." 5 | 6 | fields: 7 | - name: Type 8 | label: Administrator Type 9 | description: "Chairman, Director, Managing Partner, etc.. Found in 'Roles' in Specification/Resources" 10 | type: Role 11 | example: "7" 12 | 13 | - name: Name 14 | label: Administrator Name 15 | description: "Length 0-255 bytes. 0 is valid." 16 | type: varchar 17 | example: "Satoshi Nakamoto" 18 | -------------------------------------------------------------------------------- /src/actions/develop/types/Chapter.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Chapter 3 | label: Chapter 4 | description: > 5 | A chapter is the top level structure of an agreement. It contains articles. 6 | 7 | fields: 8 | - name: Title 9 | label: Title 10 | description: "The title of the chapter." 11 | type: varchar 12 | varSize: tiny 13 | 14 | - name: Preamble 15 | label: Preamble 16 | type: varchar 17 | varSize: small 18 | description: "The introduction to the chapter." 19 | 20 | - name: Articles 21 | label: Articles 22 | description: "A list of articles for the chapter." 23 | type: Clause[] 24 | -------------------------------------------------------------------------------- /src/actions/develop/types/Clause.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Clause 3 | label: Clause 4 | description: > 5 | A clause is the standard piece of an agreement, contained in each of the sub-levels of the 6 | agreement. Articles, Sections, Subsections, Paragraphs, and Subparagraphs. 7 | 8 | fields: 9 | - name: Title 10 | label: Title 11 | description: "The title of the clause." 12 | type: varchar 13 | varSize: tiny 14 | 15 | - name: Body 16 | label: Body 17 | description: "The body of the clause." 18 | type: varchar 19 | varSize: small 20 | 21 | - name: Children 22 | label: Children 23 | description: "A list of clauses under this clause." 24 | type: Clause[] 25 | -------------------------------------------------------------------------------- /src/actions/develop/types/DefinedTerm.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: DefinedTerm 3 | label: Defined Term 4 | description: > 5 | A definition define a term specified throughout an agreement. 6 | 7 | fields: 8 | - name: Term 9 | label: Term 10 | description: > 11 | The name of the term being defined. Linked to from within the agreement with curly braces {} 12 | around the name. 13 | type: varchar 14 | varSize: tiny 15 | 16 | - name: Definition 17 | label: Definition 18 | type: varchar 19 | varSize: small 20 | description: "The definition of the name." 21 | -------------------------------------------------------------------------------- /src/actions/develop/types/Document.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Document 3 | label: Document 4 | description: "A file containing data." 5 | 6 | fields: 7 | - name: Name 8 | label: Document Name 9 | description: "Full name, including file extension, of the file. Length 0-255 bytes. 0 is valid." 10 | type: varchar 11 | example: "Agreement.pdf" 12 | 13 | - name: Type 14 | label: MIME Type 15 | description: "MIME type of the file. Length 0-255 bytes. 0 is valid. " 16 | type: varchar 17 | example: "application/pdf" 18 | 19 | - name: Contents 20 | label: File Contents 21 | description: The contents of the file. 22 | type: varbin 23 | varSize: medium 24 | -------------------------------------------------------------------------------- /src/actions/develop/types/Fee.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Fee 3 | label: Fee 4 | description: A fee paid for a service. Only bitcoin currently supported as the instrument. 5 | 6 | fields: 7 | - name: Address 8 | label: Address 9 | description: "The address to receive the fee." 10 | type: Address 11 | required: true 12 | 13 | - name: Quantity 14 | label: Quantity 15 | description: "The quantity of tokens of the specified instrument to be paid." 16 | type: uint 17 | size: 8 18 | example: 100 19 | 20 | - name: UseCurrentInstrument 21 | label: Use Current Instrument 22 | description: > 23 | When true this means the fee quantity is paid in the current instrument's tokens. 24 | For example, for transfer fees the transfer fee is paid by including extra sender quantity of the instrument being transfered. 25 | When using the current instrument this should not be specified via the InstrumentCode field below as the instrument code value is not known for certain until the instrument is created and this field can be specified at instrument definition. 26 | type: bool 27 | example: true 28 | 29 | - name: Contract 30 | label: Contract 31 | description: > 32 | This feature is not supported by the reference implementation yet but the field is included for backwards compatibility so when support is added the quantity will not be mistaken for a bitcoin quantity by older clients. 33 | The contract containing the instrument's tokens that should be used for the fee. 34 | type: Address 35 | 36 | - name: InstrumentCode 37 | label: Instrument Code 38 | description: > 39 | This feature is not supported by the reference implementation yet but the field is included for backwards compatibility so when support is added the quantity will not be mistaken for a bitcoin quantity by older clients. 40 | The instrument code identifying the instrument's tokens that should be used for the fee. 41 | type: InstrumentCode 42 | -------------------------------------------------------------------------------- /src/actions/develop/types/InstrumentSettlement.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: InstrumentSettlement 3 | label: Instrument Settlement 4 | description: "InstrumentSettlement is the data required to settle an instrument transfer." 5 | 6 | fields: 7 | - name: ContractIndex 8 | label: Contract Index 9 | description: "Index of input containing the contract's address for this offset" 10 | type: uint 11 | size: 2 12 | 13 | - name: InstrumentType 14 | label: Instrument Type 15 | description: "Three letter character that specifies the instrument type. Example: COU" 16 | type: fixedchar 17 | size: 3 18 | example: "SHC" 19 | 20 | - name: InstrumentCode 21 | label: Instrument Code 22 | description: A unique code that is used to identify the instrument. It is generated by hashing the contract public key hash and the instrument index. SHA256(contract PKH + instrument index) 23 | type: InstrumentCode 24 | notes: "Cannot be changed by the administration, operator or smart contract." 25 | 26 | - name: Settlements 27 | label: Settlements[] 28 | description: "Each element contains the resulting token balance of Instrument X for the output Address, which is referred to by the index." 29 | type: QuantityIndex[] 30 | listSize: medium 31 | -------------------------------------------------------------------------------- /src/actions/develop/types/InstrumentTransfer.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: InstrumentTransfer 3 | label: Instrument Transfer 4 | description: "InstrumentTransfer is the data required to transfer an instrument." 5 | 6 | fields: 7 | - name: ContractIndex 8 | label: Contract Index 9 | description: "Index of output containing the contract's address for this offset" 10 | type: uint 11 | size: 2 12 | 13 | - name: InstrumentType 14 | label: Instrument Type 15 | description: "Three letter character that specifies the instrument type. Example: COU" 16 | type: fixedchar 17 | size: 3 18 | example: "SHC" 19 | 20 | - name: InstrumentCode 21 | label: Instrument Code 22 | description: A unique code that is used to identify the instrument. It is generated by hashing the contract public key hash and the instrument index. SHA256(contract PKH + instrument index) 23 | type: InstrumentCode 24 | notes: "Cannot be changed by the administration, operator or smart contract." 25 | 26 | - name: InstrumentSenders 27 | label: Instrument Senders 28 | description: "Each element has the value of tokens to be spent from the input address, which is referred to by the index." 29 | type: QuantityIndex[] 30 | listSize: small 31 | 32 | - name: InstrumentReceivers 33 | label: Instrument Receivers 34 | description: "Each element has the value of tokens to be received, the address, and an oracle signature if required." 35 | type: InstrumentReceiver[] 36 | listSize: small 37 | 38 | - name: RefundAddress 39 | label: Refund Address 40 | description: "The address to receive the refund of the instrument transfer fee if the transfer is rejected." 41 | type: Address 42 | -------------------------------------------------------------------------------- /src/actions/develop/types/Manager.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Manager 3 | label: Manager 4 | description: "Manager is used to refer to a role that is responsible for the Management of an Entity." 5 | 6 | fields: 7 | - name: Type 8 | label: Manager Type 9 | description: "CEO, COO, CFO, etc. Found in 'Roles' in Specification/Resources" 10 | type: Role 11 | example: "5" 12 | 13 | - name: Name 14 | label: Manager Name 15 | description: "Length 0-255 bytes. 0 is valid." 16 | type: varchar 17 | example: "Satoshi Nakamoto" 18 | -------------------------------------------------------------------------------- /src/actions/develop/types/Oracle.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Oracle 3 | label: Oracle 4 | description: "A Oracle defines the details of a public Oracle." 5 | 6 | fields: 7 | - name: Entity 8 | label: Oracle Entity 9 | description: "Deprecated for service contract address. Identifying information about the oracle." 10 | type: deprecated 11 | 12 | - name: URL 13 | label: Oracle URL 14 | description: "Deprecated for service contract address. Length 0-255 bytes. 0 is valid. If applicable: URL for REST/RPC Endpoint" 15 | type: deprecated 16 | example: "http://oracle.tokenized.com/api/3650d9/version2010" 17 | 18 | - name: PublicKey 19 | label: Oracle Public Key 20 | description: "Deprecated for service contract address. Length 0-255 bytes. 0 is not valid. Oracle Public Key (eg. Bitcoin Public key), used to confirm digital signed proofs for transfers. Can also be the same public address that controls a Tokenized Oracle." 21 | type: deprecated 22 | 23 | - name: OracleTypes 24 | label: Oracle Types 25 | description: "The type of the oracle. 0 = Identity, 1 = Authority, 2 = Event. More than one value can be included to specify the oracle has more than one type." 26 | type: uint[] 27 | size: 1 28 | options: 29 | - 0 30 | - 1 31 | - 2 32 | 33 | - name: EntityContract 34 | label: Entity Contract 35 | description: "The entity contract address of the service on chain that defines the oracle." 36 | type: Address 37 | -------------------------------------------------------------------------------- /src/actions/develop/types/QuantityIndex.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: QuantityIndex 3 | label: Quantity Index 4 | description: "A QuantityIndex contains a quantity, and an index. The quantity could be used to describe a number of tokens, or a value. The index is used to refer to an input or output index position." 5 | 6 | fields: 7 | - name: Index 8 | label: Index 9 | description: "The index of the input/output (depending on context) sending/receiving the tokens." 10 | type: uint 11 | size: 2 12 | example: 0 13 | 14 | - name: Quantity 15 | label: Quantity 16 | description: "Number of tokens being sent" 17 | type: uint 18 | size: 8 19 | example: 100 20 | -------------------------------------------------------------------------------- /src/actions/develop/types/ReferenceTransaction.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: ReferenceTransaction 3 | label: Reference Transaction 4 | description: "A bitcoin transaction and the outputs that it spends." 5 | 6 | fields: 7 | - name: Transaction 8 | label: Transaction 9 | description: "A bitcoin transaction serialized in the bitcoin P2P format." 10 | type: varbin 11 | size: large 12 | example: 0 13 | 14 | - name: Outputs 15 | label: Outputs 16 | description: > 17 | The bitcoin outputs corresponding to the inputs for the transaction. Serialized in bitcoin P2P 18 | format. There must be the same count as there are inputs in the contained transaction and they 19 | must be in the same order." 20 | type: varbin[] 21 | varSize: large 22 | listSize: medium 23 | -------------------------------------------------------------------------------- /src/actions/develop/types/Service.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Service 3 | label: Service 4 | description: > 5 | A definition of a service provided by an identity oracle to verify the administrator address is associated 6 | with the issuer entity identification information. Also if a contract operator is provided then 7 | it verifies that the contract operator address is associated with the specified contract 8 | operator identity information. For a child contract that references a parent entity contract 9 | the certificate verifies that the administrator address is associated with that entity contract. 10 | 11 | fields: 12 | - name: Type 13 | label: Type 14 | description: | 15 | Describes the type of service. 16 | 0 - Identity Oracle 17 | 1 - Authority Oracle 18 | 2 - Event Oracle 19 | 3 - Contract Operator 20 | type: uint 21 | size: 1 22 | options: 23 | - 0 24 | - 1 25 | - 2 26 | - 3 27 | example: 0 28 | 29 | - name: URL 30 | label: URL 31 | description: > 32 | The base URL of the service. For each service type there are predefined methods for 33 | determining the specific endpoints. 34 | type: varchar 35 | 36 | - name: PublicKey 37 | label: Public Key 38 | description: The public key used to verify and authorize the service. 39 | type: PublicKey 40 | -------------------------------------------------------------------------------- /src/actions/develop/types/TargetAddress.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: TargetAddress 3 | label: Target Address 4 | description: "A TargetAddress defines a public address and quantity." 5 | 6 | fields: 7 | - name: Address 8 | label: Address 9 | description: "Public address where the token balance will be changed." 10 | type: Address 11 | 12 | - name: Quantity 13 | label: Quantity 14 | description: "Qty of tokens to be frozen, thawed, confiscated or reconciled. For Contract-wide freezes 0 will be used." 15 | type: uint 16 | size: 8 17 | example: "10000" 18 | -------------------------------------------------------------------------------- /src/instruments/develop/currency/CCY - Currency.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # CCY - Currency 3 | # 4 | 5 | code: CCY 6 | name: Currency 7 | label: Currency 8 | description: Currency, fiat money, cash. Issued by a monetary authority (eg. Reserve Bank of Australia, ECB, Bank of England). Currency is free of counterparty risk except for the risks associated with the management of the currency by the monetary authority and its recognition as acceptable legal tender by the market and associated government(s). Custody of currency must be backed by a 1:1 ratio, or a full reserve. A currency instrument type should be considered the digital equivalent of physical cash. 9 | 10 | metadata: 11 | kind: Currency 12 | examples: 13 | - Australian dollar 14 | - Canadian dollar 15 | 16 | fields: 17 | - name: CurrencyCode 18 | label: Currency Code 19 | type: CurrencyType 20 | example: AUD 21 | description: International Organization for Standardization code for Currency. (Specification/Resources) 22 | span: full 23 | required: true 24 | 25 | - name: MonetaryAuthority 26 | label: Monetary Authority 27 | type: varchar 28 | example: Reserve Bank of Australia 29 | span: full 30 | 31 | - name: Description 32 | label: Description 33 | type: deprecated 34 | varSize: small 35 | example: Australian dollar 36 | span: full 37 | description: "Deprecated because the currency instrument should be distinguished by its meta data and contract." 38 | 39 | - name: Precision 40 | label: Precision 41 | description: Required field to specify the decimal precision of a currency. It will normally be the "precision" value associated with the CurrencyCode. It is the number of decimal places between the number of tokens and the common unit of measure. For example, in AUD, the common unit is the dollar, but a token would only be worth a penny. So the precision should be 2 for the two decimal places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. 42 | type: uint 43 | size: 8 44 | example: 100 45 | span: full 46 | required: true 47 | -------------------------------------------------------------------------------- /src/instruments/develop/schema.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Codec Schema 3 | # 4 | 5 | # Codec Name 6 | name: Tokenized Instrument Types 7 | 8 | # Unique Identifier 9 | package: instruments 10 | 11 | # Codec Version 12 | version: 1 13 | 14 | # Register Supported Messages 15 | messages: 16 | - "identity/MBR - Membership" 17 | - "currency/CCY - Currency" 18 | - "security/SHC - Common Share" 19 | - "security/BFR - Bond Fixed Rate" 20 | - "utility/COU - Coupon" 21 | - "utility/LOY - Loyalty Points" 22 | - "utility/TIC - Admission Ticket" 23 | - "utility/CHP - Casino Chip" 24 | - "utility/ISL - Information Service License" 25 | - "utility/CRN - Credit Note" 26 | - "utility/RPT - Reward Point" 27 | 28 | # Register Resources 29 | resources: 30 | - "../../resources/develop/Currencies" 31 | 32 | # Register Field Types 33 | fieldTypes: 34 | - "types/AgeRestriction" 35 | - "types/CurrencyValue" 36 | - "types/FixedCurrencyValue" 37 | - "types/Rate" 38 | 39 | # Define Field Aliases 40 | fieldAliases: 41 | - name: CurrencyType 42 | type: fixedchar 43 | size: 3 44 | description: > 45 | International Organization for Standardization code for Currency. 3 character code. 46 | example: AUD 47 | resource: Currencies 48 | 49 | - name: Timestamp 50 | type: uint 51 | size: 8 52 | description: > 53 | Represents a time, encoded as a 64 bit unsigned integer representing the number of nanoseconds 54 | since the Unix epoch. 55 | example: 1594668650000000000 56 | 57 | - name: TimestampSeconds 58 | type: uint 59 | size: 8 60 | description: > 61 | Represents a time encoded as a 64 bit unsigned integer representing the number of seconds 62 | since the Unix epoch. 63 | example: 1594668654 64 | 65 | - name: Seconds 66 | type: uint 67 | size: 8 68 | description: > 69 | Represents a time delta encoded as a 64 bit unsigned integer representing the number of 70 | seconds since a previous timestamp. 71 | example: 1500 72 | -------------------------------------------------------------------------------- /src/instruments/develop/security/SHC - Common Share.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # SHC - Security 3 | # 4 | 5 | code: SHC 6 | name: ShareCommon 7 | label: Share - Common 8 | description: Common stock represents ownership interests in companies. 9 | 10 | metadata: 11 | kind: Security 12 | category: Equity Security 13 | examples: 14 | - Tesla Shareholders Agreement 15 | - Bitmain Shareholder Agreement 16 | - Antpool Investment Agreement 17 | 18 | fields: 19 | - name: Ticker 20 | label: Ticker Symbol 21 | type: fixedchar 22 | description: Ticker symbol assigned by exchanges to represent the instrument. 23 | size: 5 24 | example: AAPL 25 | displayOrder: 4 26 | 27 | - name: ISIN 28 | label: ISIN (optional) 29 | type: fixedchar 30 | size: 12 31 | description: International Securities Identification Number 32 | example: US0004026250 33 | span: full 34 | displayOrder: 2 35 | 36 | - name: Description 37 | label: Description 38 | type: varchar 39 | varSize: small 40 | example: Class C 41 | span: full 42 | displayOrder: 1 43 | required: true 44 | 45 | - name: TransfersPermitted 46 | label: Transfers Permitted 47 | description: "Set to true if transfers are permitted between two parties, otherwise set to false to prevent peer-to-peer transfers." 48 | type: bool 49 | -------------------------------------------------------------------------------- /src/instruments/develop/types/AgeRestriction.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: AgeRestriction 3 | label: Age Restriction 4 | description: "Age restriction is used to specify required ages for instrument ownership." 5 | 6 | fields: 7 | 8 | - name: Lower 9 | label: Lower Age Limit 10 | description: "The lowest age valid to own instrument. Zero for no restriction." 11 | type: uint 12 | size: 1 13 | 14 | - name: Upper 15 | label: Upper Age Limit 16 | description: "The highest age valid to own instrument. Zero for no restriction." 17 | type: uint 18 | size: 1 19 | -------------------------------------------------------------------------------- /src/instruments/develop/types/CurrencyValue.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: CurrencyValue 3 | label: Currency Value 4 | description: A value specified in terms of a currency. 5 | 6 | fields: 7 | 8 | - name: Value 9 | label: Value 10 | description: > 11 | The value of each token denominated in precision specified in Precision field. 12 | type: uint 13 | size: 8 14 | required: true 15 | example: 100 16 | 17 | - name: CurrencyCode 18 | label: Currency Code 19 | description: > 20 | International Organization for Standardization code for Currency. Currency for coupon. From 21 | resources/currency. 22 | type: CurrencyType 23 | required: true 24 | example: AUD 25 | 26 | - name: Precision 27 | label: Precision 28 | description: > 29 | Specify the decimal precision of the value. It will normally be the "precision" value 30 | associated with the Currency. It is the number of decimal places between the number of 31 | tokens and the common unit of measure. For example, in AUD, the common unit is the dollar, 32 | but a token would only be worth a penny. So the precision should be 2 for the two decimal 33 | places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. Zero is assumed 34 | if no value is specified. 35 | type: uint 36 | size: 1 37 | example: 2 38 | -------------------------------------------------------------------------------- /src/instruments/develop/types/FixedCurrencyValue.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: FixedCurrencyValue 3 | label: Fixed Currency Value 4 | description: > 5 | A fixed value specified in terms of a currency. 6 | The "Value" must be 1. 7 | Theis value is fixed after instrument creation and can't be modified with instrument modifications. 8 | 9 | fields: 10 | 11 | - name: Value 12 | label: Value 13 | description: > 14 | The value of each token denominated in precision specified in Precision field. 15 | type: uint 16 | size: 8 17 | required: true 18 | example: 1 19 | options: 20 | - 1 21 | 22 | - name: CurrencyCode 23 | label: Currency Code 24 | description: > 25 | International Organization for Standardization code for Currency. Currency for coupon. From 26 | resources/currency. 27 | type: CurrencyType 28 | required: true 29 | example: AUD 30 | 31 | - name: Precision 32 | label: Precision 33 | description: > 34 | Specify the decimal precision of the value. It will normally be the "precision" value 35 | associated with the Currency. It is the number of decimal places between the number of 36 | tokens and the common unit of measure. For example, in AUD, the common unit is the dollar, 37 | but a token would only be worth a penny. So the precision should be 2 for the two decimal 38 | places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. Zero is assumed 39 | if no value is specified. 40 | type: uint 41 | size: 1 42 | example: 2 43 | -------------------------------------------------------------------------------- /src/instruments/develop/types/Rate.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Rate 3 | label: Rate 4 | description: A rate value specified in terms of a precision. 5 | 6 | fields: 7 | 8 | - name: Precision 9 | label: Precision 10 | description: > 11 | Required field to specify the decimal precision of the value. It will normally be the 12 | "precision" value associated with the Currency. It is the number of decimal places between 13 | the number of tokens and the common unit of measure. For example, in AUD, the common unit is 14 | the dollar, but a token would only be worth a penny. So the precision should be 2 for the 15 | two decimal places in a dollar amount "$1.00". In this scenario 100 tokens are worth $1. 16 | type: uint 17 | size: 1 18 | example: 2 19 | 20 | - name: Value 21 | label: Value 22 | type: uint 23 | size: 8 24 | example: Denominated in precision specified in Precision field. 25 | span: right 26 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/CHP - Casino Chip.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # CHP - Casino Chip 3 | # 4 | 5 | code: CHP 6 | name: CasinoChip 7 | label: Casino Chip 8 | description: Casino Chip 9 | 10 | metadata: 11 | kind: Utility 12 | 13 | fields: 14 | - name: CurrencyCode 15 | label: Currency Code 16 | description: Deprecated for FaceValue 17 | type: deprecated 18 | 19 | - name: UseType 20 | label: Use Type 21 | description: "Real Money (R), Free Play (F)" 22 | type: fixedchar 23 | size: 1 24 | example: "R" 25 | options: 26 | - 'R' 27 | - 'F' 28 | required: true 29 | 30 | - name: AgeRestriction 31 | label: Age Restriction 32 | type: AgeRestriction 33 | description: "Age restriction is used to specify required ages for instrument ownership." 34 | 35 | - name: ValidFrom 36 | label: Valid From 37 | type: deprecated 38 | 39 | - name: ExpirationTimestamp 40 | label: Expiration Timestamp 41 | type: Timestamp 42 | 43 | - name: Precision 44 | label: Precision 45 | description: Deprecated for FaceValue 46 | type: deprecated 47 | 48 | - name: TransfersPermitted 49 | label: Transfers Permitted 50 | description: > 51 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 52 | peer-to-peer transfers. 53 | type: bool 54 | 55 | - name: CasinoName 56 | label: Casino Name 57 | description: The name of the casino, or host, of the chip. 58 | type: varchar 59 | varSize: tiny 60 | required: true 61 | 62 | - name: FaceValue 63 | label: Face Value 64 | description: Face value of each coupon specified in a currency. 65 | type: CurrencyValue 66 | required: true 67 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/COU - Coupon.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # COU - Coupon 3 | # 4 | 5 | code: COU 6 | name: DiscountCoupon 7 | label: Discount Coupon 8 | description: A voucher entitling the holder to a discount on a particular product or service. 9 | 10 | metadata: 11 | kind: Utility 12 | category: Coupons 13 | examples: 14 | - Sale Price Discount 15 | - Kickstarter Campaign 16 | - Free Beer at BSV Meetup 17 | 18 | fields: 19 | - name: RedeemingEntity 20 | label: Redeeming Entity 21 | description: The entity responsible for redemption of this coupon. 22 | type: varchar 23 | example: Woolworths - Robina Town Centre 24 | 25 | - name: ValidFromTimestamp 26 | label: Valid From Timestamp 27 | type: Timestamp 28 | 29 | - name: ExpirationTimestamp 30 | label: Expiration Timestamp 31 | type: Timestamp 32 | 33 | - name: Value 34 | label: Value 35 | type: deprecated 36 | description: Deprecated for FaceValue. 37 | 38 | - name: Currency 39 | label: Currency 40 | type: deprecated 41 | description: Deprecated for FaceValue. 42 | 43 | - name: CouponName 44 | label: Coupon Name 45 | type: varchar 46 | varSize: tiny 47 | example: Gift Card 48 | required: true 49 | 50 | - name: Precision 51 | label: Precision 52 | type: deprecated 53 | description: Deprecated for FaceValue. 54 | 55 | - name: TransfersPermitted 56 | label: Transfers Permitted 57 | description: > 58 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 59 | peer-to-peer transfers. 60 | type: bool 61 | 62 | - name: FaceValue 63 | label: Face Value 64 | description: Face value of each coupon specified in a currency. 65 | type: CurrencyValue 66 | 67 | - name: RedemptionVenue 68 | label: Redemption Venue 69 | type: varchar 70 | varSize: tiny 71 | 72 | - name: Details 73 | label: Details 74 | type: varchar 75 | varSize: small 76 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/CRN - Credit Note.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # CRN - Credit Note 3 | # 4 | 5 | code: CRN 6 | name: CreditNote 7 | label: Credit Note 8 | description: A credit for a specified value in currency. 9 | 10 | metadata: 11 | kind: Utility 12 | examples: 13 | - Australian dollar 14 | - Canadian dollar 15 | 16 | fields: 17 | - name: Name 18 | label: Name 19 | type: deprecated 20 | varSize: tiny 21 | 22 | - name: FaceValue 23 | label: Face Value 24 | description: > 25 | Face value of each token specified in a currency. 26 | The "Value" must be 1. 27 | Theis value is fixed after instrument creation and can't be modified with instrument modifications. 28 | type: FixedCurrencyValue 29 | 30 | - name: ExpirationTimestamp 31 | label: Expiration Timestamp 32 | type: Timestamp 33 | 34 | - name: TransfersPermitted 35 | label: Transfers Permitted 36 | description: > 37 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 38 | peer-to-peer transfers. 39 | type: bool 40 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/ISL - Information Service License.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # ISL - Information Service License 3 | # 4 | 5 | code: ISL 6 | name: InformationServiceLicense 7 | label: Information Service License 8 | description: Information Service License 9 | 10 | metadata: 11 | kind: Utility 12 | category: License 13 | examples: 14 | - 15 | 16 | fields: 17 | - name: AgeRestriction 18 | label: Age Restriction 19 | type: AgeRestriction 20 | description: "Age restriction is used to specify required ages for instrument ownership." 21 | 22 | - name: ExpirationTimestamp 23 | label: Expiration Timestamp 24 | type: Timestamp 25 | 26 | - name: ServiceName 27 | label: Service Name 28 | type: varchar 29 | varSize: tiny 30 | example: 31 | required: true 32 | 33 | - name: TransfersPermitted 34 | label: Transfers Permitted 35 | description: > 36 | Set to true if transfers are permitted between two parties, otherwise set to false to 37 | prevent peer-to-peer transfers. 38 | type: bool 39 | 40 | - name: URL 41 | label: URL 42 | type: varchar 43 | varSize: small 44 | required: false 45 | description: "URL linking to any related documents or media" 46 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/LOY - Loyalty Points.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # LOY - Loyalty Points 3 | # Deprecated - This has been deprecated for RPT - Reward Points. 4 | # 5 | 6 | code: LOY 7 | name: DeprecatedLoyaltyPoints 8 | label: Deprecated Loyalty Points 9 | description: Deprecated - This has been deprecated for RPT - Reward Points. A Loyalty Point 10 | 11 | metadata: 12 | kind: Utility 13 | examples: 14 | - Burger Prince Dollars 15 | - Air Kilometers 16 | - Frequent Shopper Points 17 | 18 | fields: 19 | - name: AgeRestriction 20 | label: Age Restriction 21 | type: AgeRestriction 22 | description: "Age restriction is used to specify required ages for instrument ownership." 23 | 24 | - name: ProgramName 25 | label: Program Name 26 | type: varchar 27 | example: Qantas Frequent Flyer Points 28 | required: true 29 | 30 | - name: ValidFrom 31 | label: Valid From 32 | type: deprecated 33 | 34 | - name: ExpirationTimestamp 35 | label: Expiration Timestamp 36 | type: Timestamp 37 | 38 | - name: Details 39 | label: Details 40 | type: varchar 41 | varSize: small 42 | 43 | - name: TransfersPermitted 44 | label: Transfers Permitted 45 | description: > 46 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 47 | peer-to-peer transfers. 48 | type: bool 49 | -------------------------------------------------------------------------------- /src/instruments/develop/utility/RPT - Reward Point.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # RPT - Reward Point 3 | # 4 | 5 | code: RPT 6 | name: RewardPoint 7 | label: Reward Point 8 | description: A Reward Point 9 | 10 | metadata: 11 | kind: Utility 12 | examples: 13 | - Burger Prince Dollars 14 | - Air Kilometers 15 | - Frequent Shopper Points 16 | 17 | fields: 18 | - name: AgeRestriction 19 | label: Age Restriction 20 | type: AgeRestriction 21 | description: "Age restriction is used to specify required ages for instrument ownership." 22 | 23 | - name: ProgramName 24 | label: Program Name 25 | type: varchar 26 | example: Qantas Frequent Flyer Points 27 | required: true 28 | 29 | - name: ValidFrom 30 | label: Valid From 31 | type: deprecated 32 | 33 | - name: ExpirationTimestamp 34 | label: Expiration Timestamp 35 | type: Timestamp 36 | 37 | - name: Details 38 | label: Details 39 | type: varchar 40 | varSize: small 41 | 42 | - name: TransfersPermitted 43 | label: Transfers Permitted 44 | description: > 45 | Set to true if transfers are permitted between two parties, otherwise set to false to prevent 46 | peer-to-peer transfers. 47 | type: bool 48 | -------------------------------------------------------------------------------- /src/messages/develop/commercial/1002 - Signature Request.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Signature Request: Partially-signed transactions (Tokenized actions, Bitcoin, Multisig, Threshold Signatures, etc.) can be passed around on-chain to the parties (including Smart Contracts) that still have to sign the transaction. 3 | # 4 | 5 | code: 1002 6 | name: SignatureRequest 7 | label: Signature Request 8 | description: "Partially-signed transactions (Tokenized actions, Bitcoin, Multisig, Threshold Signatures, etc.) can be passed around on-chain to the parties (including Smart Contracts) that still have to sign the transaction." 9 | 10 | fields: 11 | - name: Timestamp 12 | label: Timestamp 13 | description: "Timestamp in nanoseconds for when the message sender creates the transaction." 14 | type: Timestamp 15 | 16 | - name: Payload 17 | label: Payload 18 | description: "Full serialized bitcoin tx with multiple inputs from different wallets/users." 19 | type: varbin 20 | varSize: medium 21 | -------------------------------------------------------------------------------- /src/messages/develop/commercial/1003 - Settlement Request.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Settlement Request Message: A message that contains a multi-contract settlement that needs settlement data added by another contract. Sent to another contract to request data be added. 3 | # 4 | 5 | code: 1003 6 | name: SettlementRequest 7 | label: Settlement Request 8 | description: "A message that contains a multi-contract settlement that needs settlement data added by another contract. Sent to another contract to request data be added." 9 | 10 | fields: 11 | - name: Timestamp 12 | label: Timestamp 13 | description: "Timestamp in nanoseconds for when the message sender creates the transaction." 14 | type: Timestamp 15 | 16 | - name: TransferTxId 17 | label: Transfer Tx Id 18 | description: "Tx Id of the transfer request transaction that triggered this message." 19 | type: TxId 20 | 21 | - name: ContractFees 22 | label: Contract Fees 23 | description: "Contract fees (in bitcoin) and addresses(PKHs) where fees should be paid. Added by each contract as settlement data is added." 24 | type: TargetAddress[] 25 | listSize: small 26 | 27 | - name: Settlement 28 | label: Settlement 29 | description: "Serialized settlement OP_RETURN that needs data added by another contract." 30 | type: varbin 31 | varSize: medium 32 | 33 | - name: TransferFees 34 | label: Transfer Fees 35 | description: "Transfer fees (in bitcoin) and addresses(PKHs) where fees should be paid. Added by each contract as settlement data is added." 36 | type: TargetAddress[] 37 | listSize: small 38 | -------------------------------------------------------------------------------- /src/messages/develop/commercial/1004 - Output Metadata.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Output Metadata: "A description that accompanies the output. It is used to describe the purpose of the transaction and any associated useful details. Often encrypted (DH, RSA) to make it private for one or more parties. DH for b2b where multiple parties can see the description. RSA or the like for descriptions only visible to one of the transacting parties. Optional" 3 | # 4 | 5 | code: 1004 6 | name: OutputMetadata 7 | label: Output Metadata 8 | description: "Metadata associated with the output. Aka Transaction details. It is used to describe the purpose of the transaction and add other relevant information. Often encrypted (DH, RSA) to make it private for one or more parties. DH for b2b where multiple parties can see the description. RSA or the like for descriptions only visible to one of the transacting parties. Optional" 9 | 10 | fields: 11 | - name: OutputDescription 12 | label: Output Description 13 | description: "A Description that accompanies the output. A transaction description." 14 | type: varchar 15 | varSize: medium 16 | example: "eg. Invoice 3024, Pay Mike back for camping." 17 | notes: " Can be NULL" 18 | 19 | - name: Tags 20 | label: Tags 21 | description: "Predefined values for describing the output." 22 | type: Tag[] 23 | 24 | - name: CustomTags 25 | label: Custom Tags 26 | description: "Free form text fields for describing the output. Groceries, Moomba Gas Compressor Project, Cash Register 3, Fitness, Entertainment, Special, VIP Section, North Carolina Store, Waitress: Cindy Smith, etc." 27 | type: OutputTag[] 28 | -------------------------------------------------------------------------------- /src/messages/develop/commercial/1005 - Distribution.yaml: -------------------------------------------------------------------------------- 1 | 2 | code: 1005 3 | name: Distribution 4 | label: Distribution 5 | description: > 6 | An administrator is making a distribution/payout. Used to publicly declare these payments and 7 | allow holders to be notified of them via the smart contract agent. 8 | 9 | metadata: 10 | outputs: 11 | - name: InstrumentContract 12 | label: Contract Public Address for Instrument X 13 | comments: 14 | 15 | fields: 16 | - name: InstrumentCode 17 | label: Instrument Code 18 | description: > 19 | A unique code that is used to identify the instrument. It is generated by hashing the contract 20 | public key hash and the instrument index. SHA256(contract PKH + instrument index) 21 | type: InstrumentCode 22 | notes: "Cannot be changed by the administration, operator or smart contract." 23 | required: true 24 | 25 | - name: Timestamp 26 | label: Timestamp 27 | description: "Timestamp in nanoseconds of when the administrator initiated the distribution." 28 | type: Timestamp 29 | -------------------------------------------------------------------------------- /src/messages/develop/general/0002 - Public Message.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Public Message: Generic public message or public announcement. Sent to an address(es). Can be used for an official issuer announcement. 3 | # 4 | 5 | code: 0002 6 | name: PublicMessage 7 | label: Public Message 8 | description: "Generic public message or public announcement. Sent to an address(es). Can be used for an official issuer announcement." 9 | 10 | fields: 11 | - name: Timestamp 12 | label: Timestamp 13 | description: "Timestamp in nanoseconds for when the message sender creates the transaction." 14 | type: Timestamp 15 | 16 | - name: Subject 17 | label: Subject 18 | description: The subject / topic of the message. 19 | type: varchar 20 | varSize: small 21 | 22 | - name: Regarding 23 | label: Regarding 24 | description: The output of the message that this message is regarding (responding to). 25 | type: Outpoint 26 | 27 | - name: PublicMessage 28 | label: Public Message 29 | description: "Tokenized Ltd. announces product launch." 30 | type: Document 31 | 32 | - name: Attachments 33 | label: Attachments 34 | description: Documents attached to the message. 35 | type: Document[] 36 | listSize: medium 37 | -------------------------------------------------------------------------------- /src/messages/develop/general/0003 - Private Message.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Private Message: Generic private message. Sent to another address(es). Encryption is to be used. 3 | # 4 | 5 | code: 0003 6 | name: PrivateMessage 7 | label: Private Message 8 | description: "Generic private message. Sent to another address(es). Encryption is to be used." 9 | 10 | fields: 11 | - name: Timestamp 12 | label: Timestamp 13 | description: "Timestamp in nanoseconds for when the message sender creates the transaction." 14 | type: Timestamp 15 | 16 | - name: Subject 17 | label: Subject 18 | description: The subject / topic of the message. 19 | type: varchar 20 | varSize: small 21 | 22 | - name: Regarding 23 | label: Regarding 24 | description: The output of the message that this message is regarding (responding to). 25 | type: Outpoint 26 | 27 | - name: PrivateMessage 28 | label: Private Message 29 | description: "Tokenized Ltd announces product launch." 30 | type: Document 31 | 32 | - name: Attachments 33 | label: Attachments 34 | description: Documents attached to the message. 35 | type: Document[] 36 | listSize: medium 37 | -------------------------------------------------------------------------------- /src/messages/develop/general/0004 - Reverted Tx.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Reverted Tx: A message that contains a bitcoin transaction that was accepted by the network or an agent and then invalidated by a reorg, or zero conf double spend. This serves as on chain evidence of the sending party's signatures and approval for the given transaction. 3 | # 4 | 5 | code: 0004 6 | name: RevertedTx 7 | label: Reverted Tx 8 | description: "A message that contains a bitcoin transaction that was accepted by the network or an agent and then invalidated by a reorg, or zero conf double spend. This serves as on chain evidence of the sending party's signatures and approval for the given transaction." 9 | 10 | fields: 11 | - name: Timestamp 12 | label: Timestamp 13 | description: "Timestamp in nanoseconds for when the message sender creates the transaction." 14 | type: Timestamp 15 | 16 | - name: Transaction 17 | label: Transaction 18 | description: "Serialized bitcoin transaction that was reverted/invalidated after being accepted." 19 | type: varbin 20 | varSize: medium 21 | -------------------------------------------------------------------------------- /src/messages/develop/relationships/2002 - Pending Accept Relationship.yaml: -------------------------------------------------------------------------------- 1 | code: 2002 2 | name: PendingAcceptRelationship 3 | label: Pending Accept Relationship 4 | description: "A pending accept to a relationship that provides information about a requested participant." 5 | 6 | fields: 7 | - name: ProofOfIdentityType 8 | label: Proof of Identity Type 9 | description: "The type/format of the sender's proof of identity." 10 | type: ProofOfIdentityType 11 | 12 | - name: ProofOfIdentity 13 | label: Proof of Identity 14 | description: "Sender's proof of identity." 15 | type: varbin 16 | size: small 17 | -------------------------------------------------------------------------------- /src/messages/develop/relationships/2003 - Accept Relationship.yaml: -------------------------------------------------------------------------------- 1 | code: 2003 2 | name: AcceptRelationship 3 | label: Accept Relationship 4 | description: "Accept a relationship." 5 | 6 | fields: 7 | - name: ProofOfIdentityType 8 | label: Proof of Identity Type 9 | description: "The type/format of the sender's proof of identity." 10 | type: ProofOfIdentityType 11 | 12 | - name: ProofOfIdentity 13 | label: Proof of Identity 14 | description: "Sender's proof of identity." 15 | type: varbin 16 | size: small 17 | -------------------------------------------------------------------------------- /src/messages/develop/relationships/2004 - Relationship Amendment.yaml: -------------------------------------------------------------------------------- 1 | code: 2004 2 | name: RelationshipAmendment 3 | label: Relationship Amendment 4 | description: "Amend a relationship. Add/Remove members. Modify permissions. This is encrypted with the current base encryption secret, but can provide a new base encryption secret that starts after this message." 5 | 6 | fields: 7 | - name: Seed 8 | label: Seed 9 | description: "The new seed used to derive keys for the relationship after this message." 10 | type: varbin 11 | 12 | - name: BaseEncryptionSecret 13 | label: Base Encryption Secret 14 | description: "The new base encryption secret used to derive encryption secrets for the relationship after this message. Each time a message is sent, the current seed hash is added to the base encryption secret and that value is used to encrypt the message." 15 | type: varbin 16 | 17 | - name: AddMemberIndexes 18 | label: Add Member Indexes 19 | description: "Indexes to the outputs of the members that are being added to the group." 20 | type: uint 21 | size: 4 22 | 23 | - name: DropMemberIndexes 24 | label: Drop Member Indexes 25 | description: "Indexes to the outputs of the members that are being removed from the group." 26 | type: uint 27 | size: 4 28 | -------------------------------------------------------------------------------- /src/messages/develop/relationships/2005 - Initiate Thread.yaml: -------------------------------------------------------------------------------- 1 | code: 2005 2 | name: InitiateThread 3 | label: Initiate Thread 4 | description: "Start a thread from within a conversation or channel." 5 | 6 | fields: 7 | - name: Flag 8 | label: Flag 9 | description: "The flag is required to identify messages in the thread so that all members don't have to be tagged in each message. It is recommended to be a random 20 byte value similar to public key hashes. The flag will be the Payload of an Envelope protocol message with a Payload Protocol ID of \"F\"" 10 | type: varbin 11 | 12 | - name: Seed 13 | label: Seed 14 | description: "The seed used to derive keys for the thread. If this value is not specified, then the original seed value from the parent conversation or channel is used." 15 | type: varbin 16 | -------------------------------------------------------------------------------- /src/messages/develop/types/Administrator.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Administrator 3 | label: Administrator 4 | description: "Administrator is used to refer to a Administration role in an Entity." 5 | 6 | fields: 7 | - name: Type 8 | label: Administrator Type 9 | description: "Chairman, Director, Managing Partner, etc.. Found in 'Roles' in Specification/Resources" 10 | type: Role 11 | example: "7" 12 | 13 | - name: Name 14 | label: Administrator Name 15 | description: "Length 0-255 bytes. 0 is valid." 16 | type: varchar 17 | example: "Satoshi Nakamoto" 18 | -------------------------------------------------------------------------------- /src/messages/develop/types/ChannelParty.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: ChannelParty 3 | label: Channel Party 4 | description: "Information about an entity in a channel." 5 | 6 | fields: 7 | - name: AdministrativeAddress 8 | label: Administrative Address 9 | description: "The address representing the locking script that is required to perform entity administrative level operations on a channel. Such as add/remove a member, accept/reject proposals, and requesting/receiving payments. This is recommended to be an m of n multi-signature address." 10 | type: Address 11 | 12 | - name: OutputIndex 13 | label: Output Index 14 | description: "Specifies the output containing the locking script for the party. It should also be included in the M1 ReceiverIndexes. That output must respond with a proof of identity that identifies the company involved." 15 | type: uint 16 | size: 4 17 | -------------------------------------------------------------------------------- /src/messages/develop/types/Document.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Document 3 | label: Document 4 | description: "A file containing data." 5 | 6 | fields: 7 | - name: Name 8 | label: Document Name 9 | description: "Full name, including file extension, of the file. Length 0-255 bytes. 0 is valid." 10 | type: varchar 11 | example: "Agreement.pdf" 12 | 13 | - name: Type 14 | label: MIME Type 15 | description: "MIME type of the file. Length 0-255 bytes. 0 is valid. " 16 | type: varchar 17 | example: "application/pdf" 18 | 19 | - name: Contents 20 | label: File Contents 21 | description: The contents of the file. 22 | type: varbin 23 | varSize: medium 24 | -------------------------------------------------------------------------------- /src/messages/develop/types/IdentityOracleProof.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: IdentityOracleProof 3 | label: Identity Oracle Proof 4 | description: "A proof of identity based on identity oracles." 5 | 6 | fields: 7 | - name: UserID 8 | label: User ID 9 | description: "The user id (UUID) in the identity oracle system. Used to request the entity data." 10 | type: varbin 11 | 12 | - name: Entity 13 | label: Entity 14 | description: "PII is not allowed in entity by GDPR, so only company information can be placed in this entity. In the future this might be supported for PII with better understanding of GDPR. The identity being provided. EntityContractAddress is located within this structure." 15 | type: Entity 16 | 17 | - name: OracleSignature 18 | label: OracleSignature 19 | description: "Signature of the serialized entity, public key, and block hash with the identity oracle's public key." 20 | type: OracleSignature 21 | -------------------------------------------------------------------------------- /src/messages/develop/types/Manager.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Manager 3 | label: Manager 4 | description: "Manager is used to refer to a role that is responsible for the Management of an Entity." 5 | 6 | fields: 7 | - name: Type 8 | label: Manager Type 9 | description: "CEO, COO, CFO, etc. Found in 'Roles' in Specification/Resources" 10 | type: Role 11 | example: "5" 12 | 13 | - name: Name 14 | label: Manager Name 15 | description: "Length 0-255 bytes. 0 is valid." 16 | type: varchar 17 | example: "Satoshi Nakamoto" 18 | -------------------------------------------------------------------------------- /src/messages/develop/types/OracleSignature.yaml: -------------------------------------------------------------------------------- 1 | name: OracleSignature 2 | label: Oracle Signature 3 | description: "A signature from an oracle verifying some data." 4 | 5 | fields: 6 | - name: OracleURL 7 | label: Oracle URL 8 | description: "Base URL of the identity oracle that provided the signature." 9 | type: varchar 10 | example: "identity.tokenized.com" 11 | 12 | - name: BlockHeight 13 | label: Block Height 14 | description: "The height of the block hash included in the data signed by the oracle. If the value is not included (zero), then no signature hash is included in the signed data." 15 | type: uint 16 | size: 4 17 | 18 | - name: ValidityPeriod 19 | label: Validity Period 20 | description: "The time frame that the proof is valid." 21 | type: Period 22 | 23 | - name: SignatureAlgorithm 24 | label: Signature Algorithm 25 | description: "The algorithm used by the oracle signature." 26 | type: uint 27 | size: 1 28 | 29 | - name: Signature 30 | label: Signature 31 | description: "Signature of the related data with the oracle's public key." 32 | type: varbin 33 | -------------------------------------------------------------------------------- /src/messages/develop/types/Outpoint.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Outpoint provides a reference to a specific output of a bitcoin transaction. 3 | # 4 | 5 | code: 0002 6 | name: Outpoint 7 | label: Outpoint 8 | description: "Reference to a bitcoin transaction output." 9 | 10 | fields: 11 | - name: TxId 12 | label: TxId 13 | type: TxId 14 | 15 | - name: OutputIndex 16 | label: Output Index 17 | description: The index of the output within the referenced transaction. 18 | type: uint 19 | size: 4 20 | -------------------------------------------------------------------------------- /src/messages/develop/types/OutputTag.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: OutputTag 3 | label: Output Tag 4 | description: "A tag or category of an output used to categorize and organize outputs from different transactions." 5 | 6 | fields: 7 | - name: Tag 8 | label: Tag 9 | description: "The text of the tag." 10 | type: varchar 11 | -------------------------------------------------------------------------------- /src/messages/develop/types/PaymailProof.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: PaymailProof 3 | label: Paymail Proof 4 | description: "A proof of identity based on paymail." 5 | 6 | fields: 7 | - name: UserID 8 | label: User ID 9 | description: "The user id (UUID) in the identity oracle system. Used to request the entity data." 10 | type: varbin 11 | 12 | - name: Handle 13 | label: Handle 14 | description: "PII including personally identifiable user names not allowed by GDPR. This is put in for possible future use without a protocol change. Paymail handle in the form {alias}@{domain}.{tld}" 15 | type: varchar 16 | example: "john@tokenized.com" 17 | 18 | - name: OracleSignature 19 | label: OracleSignature 20 | description: "Signature of the serialized entity, public key, and block hash with the identity oracle's public key." 21 | type: OracleSignature 22 | -------------------------------------------------------------------------------- /src/messages/develop/types/Period.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Period 3 | label: Period 4 | description: "A period of time. Begin and end can be optional depending on context." 5 | 6 | fields: 7 | - name: Begin 8 | label: Begin 9 | description: "The start of the period" 10 | type: Timestamp 11 | 12 | - name: End 13 | label: End 14 | description: "The end of the period" 15 | type: Timestamp 16 | -------------------------------------------------------------------------------- /src/messages/develop/types/TargetAddress.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: TargetAddress 3 | label: Target Address 4 | description: "A TargetAddress defines a public address and quantity." 5 | 6 | fields: 7 | - name: Address 8 | label: Address 9 | description: "Public address where the token balance will be changed." 10 | type: Address 11 | 12 | - name: Quantity 13 | label: Quantity 14 | description: "Qty of tokens to be frozen, thawed, confiscated or reconciled. For Contract-wide freezes 0 will be used." 15 | type: uint 16 | size: 8 17 | example: "10000" 18 | -------------------------------------------------------------------------------- /src/resources/develop/Roles.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Roles 3 | description: > 4 | Roles that entities play in relation to their interactions with other entities. 5 | These roles have widely-accepted tasks, rights and duties. 6 | codeType: 7 | type: uint 8 | 9 | values: 10 | - code: 1 11 | name: Accountant 12 | 13 | - code: 2 14 | name: Advisor 15 | 16 | - code: 3 17 | name: Agent 18 | 19 | - code: 4 20 | name: Beneficiary 21 | 22 | - code: 5 23 | name: CEO 24 | 25 | - code: 6 26 | name: CFO 27 | 28 | - code: 7 29 | name: Chair 30 | 31 | - code: 8 32 | name: COO 33 | 34 | - code: 9 35 | name: CTO 36 | 37 | - code: 10 38 | name: Custodian 39 | 40 | - code: 11 41 | name: Director 42 | 43 | - code: 12 44 | name: Executive 45 | 46 | - code: 13 47 | name: Lawyer 48 | 49 | - code: 14 50 | name: Legal Guardian 51 | 52 | - code: 15 53 | name: Limited Partner 54 | 55 | - code: 16 56 | name: Manager 57 | 58 | - code: 17 59 | name: Managing Partner 60 | 61 | - code: 18 62 | name: Member 63 | description: Shareholder 64 | 65 | - code: 19 66 | name: Partner 67 | 68 | - code: 20 69 | name: Principal 70 | 71 | - code: 21 72 | name: Proprietor 73 | 74 | - code: 22 75 | name: Protector 76 | 77 | - code: 23 78 | name: Secretary 79 | 80 | - code: 24 81 | name: Settlor 82 | 83 | - code: 25 84 | name: Significant Member 85 | description: Major Shareholder 86 | 87 | - code: 26 88 | name: Smart Contract Operator 89 | 90 | - code: 27 91 | name: Trader 92 | 93 | - code: 28 94 | name: Trustee 95 | 96 | - code: 29 97 | name: Unit Holder 98 | -------------------------------------------------------------------------------- /src/resources/develop/Tags.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: Tags 3 | description: > 4 | Predefined tags for output metadata. 5 | Multiple values can be assigned to an output to describe a tx output. 6 | codeType: 7 | type: uint 8 | 9 | metadata: 10 | type: Tag 11 | 12 | values: 13 | - code: 1 14 | name: Housing 15 | 16 | - code: 2 17 | name: Utilities 18 | 19 | - code: 3 20 | name: Food 21 | 22 | - code: 4 23 | name: Medical 24 | 25 | - code: 5 26 | name: Financial Services 27 | 28 | - code: 6 29 | name: Entertainment 30 | 31 | - code: 7 32 | name: Sales 33 | 34 | - code: 8 35 | name: Automotive 36 | 37 | - code: 9 38 | name: Transportation 39 | 40 | - code: 10 41 | name: Fitness 42 | 43 | - code: 20 44 | name: Electricity 45 | 46 | - code: 21 47 | name: Water 48 | 49 | - code: 22 50 | name: Internet 51 | 52 | - code: 23 53 | name: Medicine 54 | 55 | - code: 24 56 | name: Service 57 | 58 | - code: 25 59 | name: Repair 60 | 61 | - code: 26 62 | name: Supplies 63 | 64 | - code: 27 65 | name: Parts 66 | 67 | - code: 28 68 | name: Labor 69 | 70 | - code: 29 71 | name: Tip 72 | 73 | - code: 30 74 | name: Media 75 | 76 | - code: 40 77 | name: Music 78 | 79 | - code: 41 80 | name: Video 81 | 82 | - code: 42 83 | name: Photo 84 | 85 | - code: 43 86 | name: Audio 87 | 88 | - code: 100 89 | name: Alcohol 90 | 91 | - code: 101 92 | name: Tobacco 93 | 94 | - code: 120 95 | name: Discounted 96 | 97 | - code: 121 98 | name: Promotional 99 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/VotingSystems.yaml: -------------------------------------------------------------------------------- 1 | 2 | VotingSystems: 3 | - Name: Unanimous Resolution 4 | VoteType: A 5 | TallyLogic: 0 6 | ThresholdPercentage: 100 7 | VoteMultiplierPermitted: false 8 | HolderProposalFee: 1000000 9 | 10 | - Name: Ordinary Resolution 11 | VoteType: R 12 | TallyLogic: 0 13 | ThresholdPercentage: 50 14 | VoteMultiplierPermitted: true 15 | HolderProposalFee: 1000000 16 | 17 | - Name: Special Resolution 18 | VoteType: R 19 | TallyLogic: 0 20 | ThresholdPercentage: 75 21 | VoteMultiplierPermitted: false 22 | HolderProposalFee: 1000000 23 | 24 | - Name: General Board Resolution 25 | VoteType: R 26 | TallyLogic: 0 27 | ThresholdPercentage: 50 28 | VoteMultiplierPermitted: false 29 | HolderProposalFee: 1000000 30 | 31 | - Name: Special Board Resolution 32 | VoteType: A 33 | TallyLogic: 0 34 | ThresholdPercentage: 67 35 | VoteMultiplierPermitted: false 36 | HolderProposalFee: 1000000 37 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Casino Chip.yaml: -------------------------------------------------------------------------------- 1 | # Casino Chip 2 | Name: CasinoChip 3 | InstrumentType: CHP 4 | 5 | Permissions: 6 | - Name: Administrative Vote Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: false 9 | HolderProposal: false 10 | AdministrativeMatter: true 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [TradeRestrictions] 17 | - [EnforcementOrdersPermitted] 18 | - [VotingRights] 19 | - [VoteMultiplier] 20 | - [AdministrationProposal] 21 | - [HolderProposal] 22 | - [InstrumentModificationGovernance] 23 | 24 | - Name: Administrator Direct 25 | Permitted: true 26 | AdministrationProposal: false 27 | HolderProposal: false 28 | AdministrativeMatter: false 29 | VotingSystemsAllowed: 30 | Fields: 31 | - [AuthorizedTokenQty] 32 | - [InstrumentPayload, FaceValue] 33 | - [InstrumentPayload, UseType] 34 | - [InstrumentPayload, AgeRestriction] 35 | - [InstrumentPayload, ValidFrom] 36 | - [InstrumentPayload, ExpirationTimestamp] 37 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Common Share.yaml: -------------------------------------------------------------------------------- 1 | # Common Share Instrument 2 | Name: CommonShare 3 | InstrumentType: SHC 4 | 5 | Permissions: 6 | - Name: Administrator/Holder Special Resolution 7 | Permitted: false 8 | AdministrationProposal: true 9 | HolderProposal: true 10 | AdministrativeMatter: false 11 | VotingSystemsAllowed: 12 | - Special Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [VotingRights] 17 | - [VoteMultiplier] 18 | - [AdministrationProposal] 19 | - [HolderProposal] 20 | - [AuthorizedTokenQty] 21 | - [InstrumentPayload, Ticker] 22 | - [InstrumentPayload, ISIN] 23 | - [InstrumentPayload, Description] 24 | 25 | - Name: Administrator Special Resolution 26 | Permitted: false 27 | AdministrationProposal: true 28 | HolderProposal: false 29 | AdministrativeMatter: false 30 | VotingSystemsAllowed: 31 | - Special Resolution 32 | Fields: 33 | - [TradeRestrictions] 34 | - [EnforcementOrdersPermitted] 35 | - [InstrumentModificationGovernance] 36 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Coupon.yaml: -------------------------------------------------------------------------------- 1 | # Coupon 2 | Name: Coupon 3 | InstrumentType: COU 4 | 5 | Permissions: 6 | - Name: Administrative Vote Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: false 9 | HolderProposal: false 10 | AdministrativeMatter: true 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [TradeRestrictions] 17 | - [EnforcementOrdersPermitted] 18 | - [VotingRights] 19 | - [VoteMultiplier] 20 | - [AdministrationProposal] 21 | - [HolderProposal] 22 | - [InstrumentModificationGovernance] 23 | 24 | - Name: Administrator Direct 25 | Permitted: true 26 | AdministrationProposal: false 27 | HolderProposal: false 28 | AdministrativeMatter: false 29 | VotingSystemsAllowed: 30 | Fields: 31 | - [AuthorizedTokenQty] 32 | - [InstrumentPayload, RedeemingEntity] 33 | - [InstrumentPayload, ExpirationTimestamp] 34 | - [InstrumentPayload, FaceValue] 35 | - [InstrumentPayload, Details] 36 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Currency.yaml: -------------------------------------------------------------------------------- 1 | # Currency 2 | Name: Currency 3 | InstrumentType: CCY 4 | 5 | Permissions: 6 | - Name: Administrative Vote Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: false 9 | HolderProposal: false 10 | AdministrativeMatter: true 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [TradeRestrictions] 16 | - [EnforcementOrdersPermitted] 17 | - [VotingRights] 18 | - [VoteMultiplier] 19 | - [AdministrationProposal] 20 | - [HolderProposal] 21 | - [InstrumentModificationGovernance] 22 | 23 | - Name: Administrator Direct 24 | Permitted: true 25 | AdministrationProposal: false 26 | HolderProposal: false 27 | AdministrativeMatter: false 28 | VotingSystemsAllowed: 29 | Fields: 30 | - [AuthorizedTokenQty] 31 | 32 | - Name: Administrator/Administrative Vote Special Board Resolution 33 | Permitted: false 34 | AdministrationProposal: true 35 | HolderProposal: false 36 | AdministrativeMatter: true 37 | VotingSystemsAllowed: 38 | - Special Board Resolution 39 | Fields: 40 | - [InstrumentPayload, CurrencyCode] 41 | - [InstrumentPayload, MonetaryAuthority] 42 | - [InstrumentPayload, Description] 43 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Loyalty Points.yaml: -------------------------------------------------------------------------------- 1 | # Loyalty Points 2 | Name: LoyaltyPoints 3 | InstrumentType: LOY 4 | 5 | Permissions: 6 | - Name: Administrative Vote Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: false 9 | HolderProposal: false 10 | AdministrativeMatter: true 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [TradeRestrictions] 17 | - [EnforcementOrdersPermitted] 18 | - [VotingRights] 19 | - [VoteMultiplier] 20 | - [AdministrationProposal] 21 | - [HolderProposal] 22 | - [InstrumentModificationGovernance] 23 | - [InstrumentPayload, AgeRestriction] 24 | - [InstrumentPayload, ProgramName] 25 | 26 | - Name: Administrator Direct 27 | Permitted: true 28 | AdministrationProposal: false 29 | HolderProposal: false 30 | AdministrativeMatter: false 31 | VotingSystemsAllowed: 32 | Fields: 33 | - [AuthorizedTokenQty] 34 | - [InstrumentPayload, ExpirationTimestamp] 35 | - [InstrumentPayload, Details] 36 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Membership.yaml: -------------------------------------------------------------------------------- 1 | # Membership Instrument (eg. Administrator/Director/Partner) 2 | Name: Membership 3 | InstrumentType: MBR 4 | 5 | Permissions: 6 | - Name: Administrator/Holder Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: true 9 | HolderProposal: true 10 | AdministrativeMatter: false 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [VotingRights] 17 | - [VoteMultiplier] 18 | - [AdministrationProposal] 19 | - [HolderProposal] 20 | - [AuthorizedTokenQty] 21 | - [InstrumentPayload, AgeRestriction] 22 | - [InstrumentPayload, ValidFrom] 23 | 24 | - Name: Administrator Special Board Resolution 25 | Permitted: false 26 | AdministrationProposal: true 27 | HolderProposal: false 28 | AdministrativeMatter: false 29 | VotingSystemsAllowed: 30 | - Special Board Resolution 31 | Fields: 32 | - [TradeRestrictions] 33 | - [EnforcementOrdersPermitted] 34 | - [InstrumentModificationGovernance] 35 | - [InstrumentPayload, ExpirationTimestamp] 36 | - [InstrumentPayload, ID] 37 | - [InstrumentPayload, MembershipClass] 38 | - [InstrumentPayload, RoleType] 39 | - [InstrumentPayload, MembershipType] 40 | 41 | 42 | - Name: Administrative Vote General Board Resolution 43 | Permitted: false 44 | AdministrationProposal: false 45 | HolderProposal: false 46 | AdministrativeMatter: true 47 | VotingSystemsAllowed: 48 | - General Board Resolution 49 | Fields: 50 | - [InstrumentPayload, Description] 51 | -------------------------------------------------------------------------------- /src/templates/develop/private_company/instruments/Ticket (Admission).yaml: -------------------------------------------------------------------------------- 1 | # Ticket (Admission) 2 | Name: Ticket 3 | InstrumentType: TIC 4 | 5 | Permissions: 6 | - Name: Administrative Vote Special Board Resolution 7 | Permitted: false 8 | AdministrationProposal: false 9 | HolderProposal: false 10 | AdministrativeMatter: true 11 | VotingSystemsAllowed: 12 | - Special Board Resolution 13 | Fields: 14 | - [InstrumentPermissions] 15 | - [InstrumentPayload, TransfersPermitted] 16 | - [TradeRestrictions] 17 | - [EnforcementOrdersPermitted] 18 | - [VotingRights] 19 | - [VoteMultiplier] 20 | - [AdministrationProposal] 21 | - [HolderProposal] 22 | - [InstrumentModificationGovernance] 23 | 24 | - Name: Administrator Direct 25 | Permitted: true 26 | AdministrationProposal: false 27 | HolderProposal: false 28 | AdministrativeMatter: false 29 | VotingSystemsAllowed: 30 | Fields: 31 | - [AuthorizedTokenQty] 32 | - [InstrumentPayload, AgeRestriction] 33 | - [InstrumentPayload, Venue] 34 | - [InstrumentPayload, Area] 35 | - [InstrumentPayload, Section] 36 | - [InstrumentPayload, Row] 37 | - [InstrumentPayload, Seat] 38 | - [InstrumentPayload, EventStartTimestamp] 39 | - [InstrumentPayload, EventEndTimestamp] 40 | - [InstrumentPayload, Details] 41 | --------------------------------------------------------------------------------