diff --git a/docs/build/html/_sources/tutorial.txt b/docs/build/html/_sources/tutorial.txt index 5096fc490c..98e33e4b5a 100644 --- a/docs/build/html/_sources/tutorial.txt +++ b/docs/build/html/_sources/tutorial.txt @@ -245,46 +245,41 @@ run two contracts one time each: Cash and CommercialPaper. override fun verify(tx: TransactionForVerification) { // Group by everything except owner: any modification to the CP at all is considered changing it fundamentally. - val groups = tx.groupStates() { it.withoutOwner() } + val groups = tx.groupStates() { it: State -> it.withoutOwner() } val command = tx.commands.requireSingleCommand() .. sourcecode:: java @Override public void verify(@NotNull TransactionForVerification tx) { - List> groups = tx.groupStates(State.class, State::withoutOwner); + List> groups = tx.groupStates(State.class, State::withoutOwner); AuthenticatedObject cmd = requireSingleCommand(tx.getCommands(), Commands.class); -We start by using the ``groupStates`` method, which takes a type and a function (in functional programming a function -that takes another function as an argument is called a *higher order function*). State grouping is a way of handling -*fungibility* in a contract, which is explained next. The second line does what the code suggests: it searches for +We start by using the ``groupStates`` method, which takes a type and a function. State grouping is a way of ensuring +your contract can handle multiple unrelated states of the same type in the same transaction, which is needed for +splitting/merging of assets, atomic swaps and so on. The second line does what the code suggests: it searches for a command object that inherits from the ``CommercialPaper.Commands`` supertype, and either returns it, or throws an exception if there's zero or more than one such command. -Understanding fungibility -------------------------- +Using state groups +------------------ -We say states are *fungible* if they are treated identically to each other by the recipient, despite the fact that they -aren't quite identical. Dollar bills are fungible because even though one may be worn/a bit dirty and another may -be crisp and new, they are still both worth exactly $1. Likewise, ten $1 bills are almost exactly equivalent to -one $10 bill. On the other hand, $10 and £10 are not fungible: if you tried to pay for something that cost £20 with -$10+£10 notes your trade would not be accepted. +The simplest way to write a smart contract would be to say that each transaction can have a single input state and a +single output state of the kind govered by that contract. This would be easy for the developer, but would prevent many +important use cases. -So whilst our ledger could represent every monetary amount with a collection of states worth one penny, this would become -extremely unwieldy. It's better to allow states to represent varying amounts and then define rules for merging them -and splitting them. Similarly, we could also have considered modelling cash as a single contract that records the -ownership of all holders of a given currency from a given issuer. Whilst this is possible, and is effectively how -some other platforms work, this prototype favours a design that doesn't necessarily require state to be shared between -multiple actors if they don't have a direct relationship with each other (as would implicitly be required if we had a -single state representing multiple people's ownership). Keeping the states separated also has scalability benefits, as -different parts of the global transaction graph can be updated in parallel. +The next easiest way to write a contract would be to iterate over each input state and expect it to have an output +state. Now you can build a single transaction that, for instance, moves two different cash states in different currencies +simultaneously. But it gets complicated when you want to issue or exit one state at the same time as moving another. + +Things get harder still once you want to split and merge states. We say states are *fungible* if they are +treated identically to each other by the recipient, despite the fact that they aren't quite identical. Dollar bills are +fungible because even though one may be worn/a bit dirty and another may be crisp and new, they are still both worth +exactly $1. Likewise, ten $1 bills are almost exactly equivalent to one $10 bill. On the other hand, $10 and £10 are not +fungible: if you tried to pay for something that cost £20 with $10+£10 notes your trade would not be accepted. To make all this easier the contract API provides a notion of groups. A group is a set of input states and output states -that should be checked for validity independently. It solves the following problem: because every contract sees every -input and output state in a transaction, it would easy to accidentally write a contract that disallows useful -combinations of states. For example, our cash contract might end up lazily assuming there's only one currency involved -in a transaction, whereas in reality we would like the ability to model a currency trade in which two parties contribute -inputs of different currencies, and both parties get outputs of the opposite currency. +that should be checked for validity together. Consider the following simplified currency trade transaction: @@ -304,11 +299,65 @@ given type (as the transaction may include other types of state, such as states multi-sig state) and then it takes a function that maps a state to a grouping key. All states that share the same key are grouped together. In the case of the cash example above, the grouping key would be the currency. -In our commercial paper contract, we don't want CP to be fungible: merging and splitting is (in our example) not allowed. -So we just use a copy of the state minus the owner field as the grouping key. As a result, a single transaction can -trade many different pieces of commercial paper in a single atomic step. +In other kinds of contract, we don't want CP to be fungible: merging and splitting is (in our example) not allowed. +So we just use a copy of the state minus the owner field as the grouping key. + +Here are some code examples: + +.. container:: codeset + + .. sourcecode:: kotlin + + // Type of groups is List>> + val groups = tx.groupStates() { it: Cash.State -> Pair(it.deposit, it.amount.currency) } + for ((inputs, outputs, key) in groups) { + // Either inputs or outputs could be empty. + val (deposit, currency) = key + + ... + } + + .. sourcecode:: java + + List>> groups = tx.groupStates(Cash.State.class, s -> Pair(s.deposit, s.amount.currency)) + for (InOutGroup> group : groups) { + List inputs = group.getInputs(); + List outputs = group.getOutputs(); + Pair key = group.getKey(); + + ... + } + +The ``groupStates`` call uses the provided function to calculate a "grouping key". All states that have the same +grouping key are placed in the same group. A grouping key can be anything that implements equals/hashCode, but it's +always an aggregate of the fields that shouldn't change between input and output. In the above example we picked the +fields we wanted and packed them into a ``Pair``. It returns a list of ``InOutGroup``s, which is just a holder for the +inputs, outputs and the key that was used to define the group. In the Kotlin version we unpack these using destructuring +to get convenient access to the inputs, the outputs, the deposit data and the currency. The Java version is more +verbose, but equivalent. + +The rules can then be applied to the inputs and outputs as if it were a single transaction. A group may have zero +inputs or zero outputs: this can occur when issuing assets onto the ledger, or removing them. + +In this example, we do it differently and use the state class itself as the aggregator. We just +blank out fields that are allowed to change, making the grouping key be "everything that isn't that": + +.. container:: codeset + + .. sourcecode:: kotlin + + val groups = tx.groupStates() { it: State -> it.withoutOwner() } + + .. sourcecode:: java + + List> groups = tx.groupStates(State.class, State::withoutOwner); + +For large states with many fields that must remain constant and only one or two that are really mutable, it's often +easier to do things this way than to specifically name each field that must stay the same. The ``withoutOwner`` function +here simply returns a copy of the object but with the ``owner`` field set to ``NullPublicKey``, which is just a public key +of all zeros. It's invalid and useless, but that's OK, because all we're doing is preventing the field from mattering +in equals and hashCode. -A group may have zero inputs or zero outputs: this can occur when issuing assets onto the ledger, or removing them. Checking the requirements ------------------------- diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 07279864d8..f7f1713229 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -216,7 +216,7 @@ prove or disprove the following hypothesis:

  • States
  • Commands
  • The verify function
  • -
  • Understanding fungibility
  • +
  • Using state groups
  • Checking the requirements
  • How to test your contract
  • Adding a generation API to your contract
  • diff --git a/docs/build/html/robots.txt b/docs/build/html/robots.txt new file mode 100644 index 0000000000..1f53798bb4 --- /dev/null +++ b/docs/build/html/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 3123147af9..ad6cf9b921 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:47,filenames:["building-the-docs","codestyle","data-model","getting-set-up","index","inthebox","irs","messaging","node-administration","oracles","protocol-state-machines","running-the-demos","tutorial","visualiser"],objects:{},objnames:{},objtypes:{},terms:{"0_xx":3,"1mb":10,"8u45":3,"_before_":10,"_do_":10,"_in":8,"_is_":10,"_mbeans_":8,"abstract":10,"boolean":12,"break":[9,12],"byte":[1,2,5,10],"case":[2,7,9,10,12],"catch":[1,3,10],"class":[1,6,9,10],"default":[1,3,5,10,12],"export":[8,10],"final":[6,7,10,12],"float":[5,6],"function":[1,2,5,6,9,10,11],"import":[1,2,3,7,10,12],"instanceof":12,"int":[1,12],"long":[1,7,10,12],"new":[1,2,3,4,5,6,7,8,10,11,12],"null":[9,12],"public":[1,2,5,7,8,9,10,12],"return":[1,6,7,8,9,10,12],"short":[7,12],"static":[2,9,10,12],"switch":[5,10,12],"throw":[1,9,10,12],"transient":10,"true":[2,7,9,12,13],"try":[1,2,10,11,12,13],"var":12,"void":12,abil:[2,7,12],abl:[7,9],about:[1,2],abov:[6,7,10,12],accept:[1,2,7,10,12],acceptablepric:10,access:[2,7,8,9,10],accid:10,accident:12,accordingli:7,account:2,accrual:6,accur:9,achiev:7,acknowledg:10,across:[2,10],act:[7,9,10],action:12,activ:[6,11],actor:[1,10,12],actual:[6,7,9,10,12],adapt:[1,9,10],add:[1,7,8,10,12],addarg:12,addcommand:10,addinputst:[10,12],addit:12,addition:[9,10],addmessagehandl:7,addoutputst:[10,12],address:[2,7,10,12],adjust:[1,6],administr:5,advanc:[6,11],affect:9,affection:12,afraid:1,after:[2,5,6,9,10,12,13],again:[2,6,7,9,10,11,12],against:[6,10,12],agent:8,agre:[3,6,10],agreement:[2,6],ahead:10,aim:1,algorithm:[2,5,12,13],alic:[12,13],aliceaddr:7,alicegetsback:[12,13],alicenod:7,aliv:10,all:[0,1,2,3,6,7,8,9,10,11,12],allow:[5,6,9,10,12],allpossiblerecipi:7,almost:[10,12],along:[5,7,9,10,12],alreadi:[1,9,10,12],alright:10,also:[1,2,3,5,6,7,8,10,11,12],alt:12,alter:[10,12],altern:[0,1,8,11],although:[2,5,6,7,12],alwai:[1,2,8,10,12],amounnt:10,amount:[5,6,10,12],amqp:5,ani:[1,2,6,7,8,9,10,12],annot:[1,10,12],anoth:[5,8,9,10,11,12],answer:[1,9],anticip:1,anyon:12,anyth:[2,7,9,10,12],anywher:[7,9,12],apach:[5,7],api:[1,5,8,9,10,11],app:8,appear:12,append:8,appendix:4,appli:[1,6],applic:[2,9],applyfix:6,approach:2,appropri:7,approv:10,arbitrari:[1,2,9,10,12],arbitrarili:5,architectur:9,area:7,aren:[10,12],arg:[12,13],arguabl:9,argument:[1,2,7,10,12],around:[2,7,9,10,12,13],arrai:[2,5,10],arrang:10,arriv:[9,10],arrow:6,artemi:5,articl:[2,7,9,10],artifact:12,ask:[1,10,12],aspect:10,assembl:2,assemblesharedtx:10,asset:[5,10],assetforsal:10,assetmismatchexcept:10,assettosel:10,assettypenam:10,assign:9,assist:[10,12,13],associ:[2,7,12],assum:[9,10,12],assumpt:10,atom:[9,10,11,12],attach:2,attempt:[2,3,4,7,10],attent:10,attest:9,attribut:1,audit:[2,10],authenticatedobject:12,author:[1,2,7,10],authoris:10,auto:[1,12],autom:12,automat:[0,7,10,12],avail:[0,6,7,8,9,12],avoid:[1,10],awai:[10,11],awar:[1,10],awkward:[1,10],axi:6,back:[9,10,12],backend:7,background:[1,2,7],backtick:12,backward:10,bad:[1,10,12],balanc:12,band:[9,10],bandwidth:1,bank:6,bankrupt:12,bankruptci:[2,9],base:[2,6],basi:[6,8],basic:[1,2,5],bear:[10,12],beauti:13,becaus:[1,3,7,8,9,10,12],becom:[1,6,10,12],been:[2,6,9,10,11,12],befor:[2,5,6,9,10,12],begin:[2,11,12],behav:12,behaviour:[5,8],behind:[10,12],below:[6,10],benefit:[10,12],best:1,bet:9,beta:3,better:[1,4,5,12,13],between:[1,6,7,9,10,11,12],beyond:[2,12],big:[1,10,12],bigdecim:9,bilater:[5,6],bill:12,binari:9,bind:[2,9],bit:[10,12,13],bitbucket:3,bitcoinj:10,blah:1,blank:[1,12],block:[1,2,4,7,9,10,12],blockchain:10,bloom:1,bloomfilt:1,blow:11,blue:[6,13],bob:12,bobaddr:7,bobnod:7,bond:12,bookkeep:[5,12],boost:5,borrow:13,both:[2,5,6,7,9,10,12],bottom:10,bound:[9,10],box:5,breadth:10,briefli:[7,13],broadcast:7,broke:1,broker:5,brows:5,bug:[1,5],bui:[5,10],build:[3,5,8,10,12],builder:12,built:[10,12],bullet:1,bunch:[11,12],bundl:2,busi:[2,5,7,9,10,12],buyer:[],buyersessionid:10,bytearrai:7,bytecod:[2,10,12],cach:7,calcul:[6,10,12],calendar:[6,9],calibr:2,call:[1,2,5,6,7,8,10,12],callback:[1,7,10],caller:12,came:10,can:[0,1,2,3,5,6,7,8,9,10,11,12,13],cannot:[2,9,12],capabl:12,capit:1,capitan:0,care:[1,7,9,10],carefulli:5,cash:[5,6,9,10,11,12,13],cashkt:12,cashsigningpubkei:10,cashstat:10,caus:12,center:12,certain:[1,5,12],cev:3,chain:[2,9,10,12],chanc:[1,10],chang:[0,1,2,6,7,9,10,12,13],channel:10,charact:1,charg:9,check:[1,3,5,9,10],checkabl:9,checkdepend:10,checksufficientsignatur:10,child:10,children:10,childrenfor:10,choic:1,choos:[3,12],circl:13,claim:[2,5,12],clean:10,clear:10,clearer:[7,10],click:[3,13],client:[8,9],clock:9,clone:1,close:9,closur:1,cloud:8,cmd:12,codebas:[1,12],colleagu:1,collect:[1,8,12],collector:[1,8,10],column:8,com:[0,3],combin:[4,12],come:[5,10],command:[2,3,6,8,9,10,11],commanddata:9,commerci:[5,9,10,11],commercial_pap:12,commercialpap:[5,12,13],commercialpapertest:[12,13],commit:10,common:[6,10,12],commonleg:6,commonli:12,commun:3,compani:9,companion:[10,12],compar:[2,7],compil:[11,12],complet:[2,7,10,11,12],complex:[1,2,12],complic:10,compon:7,compos:[10,12],compris:6,comput:[6,9,10],concept:[2,9,10,12],conceptu:10,concern:[10,12],conclus:9,concurrenthashmap:1,condit:[9,10],config:8,configur:[3,8,10],confirm:7,conflict:[2,4],confus:10,connect:[5,8,12],consensu:[7,9],consid:[1,2,6,9,12],consist:[2,5,6,10],constant:[1,12],constantli:9,constraint:9,construct:[1,7,10,12],constructor:[9,12],consult:9,consum:2,consumpt:9,contact:10,contain:[2,6,7,8,9,10,11,12],content:[1,2,3,7,8,9,11,12],context:[1,8,9],continu:6,contract:2,contractst:[12,13],contractstateref:12,contrast:[2,9,10],contribut:12,control:[1,2,3,8,10,12],conveni:[1,12],convent:[6,10],convert:[6,12],convinc:10,copi:[1,7,10,12],copyonwritearraylist:1,copyright:1,core:[7,12],correct:12,correctli:[2,9,12],correspond:12,correspondingli:1,cost:[9,12],could:[1,9,10,11,12],count:6,counter:[1,10],counterparti:6,countri:9,coupl:[9,10],cours:[8,9,12],cover:[2,9,10,12],cp_program_id:12,creat:[1,2],createdummyir:6,createmessag:7,creation:[4,6,12],creator:9,crisp:12,crop:2,curl:8,currenc:[5,6,12],current:[1,2,5,6,7,9,10,11,12,13],currentwallet:10,curv:[5,6],custom:[8,11],cycl:1,dai:[6,8,9,12,13],dashboard:8,data:1,databas:[5,10],dataset:6,date:[6,8,9,11,12],deal:[1,9,11],debug:10,decd098666b9657314870e192ced0c3519c2c9d395507a238338f8d003929de9:8,decd:8,decentralis:9,decid:[9,12],declar:[1,7,12],dedic:1,defin:[1,2,5,7,8,9,10,12,13],definit:[10,12],delai:[6,9],delet:[1,10,12],deliv:7,deliveri:[7,10,11,12],demo:5,demonstr:11,denomin:5,dens:1,depend:[1,3,9,10,12],dependencytxid:10,deposit:5,depth:12,deregist:7,deriv:[6,10,12],describ:[1,4,10,12],descript:1,design:[1,2,4,5,9,12],desir:[10,12],desktop:8,despit:[10,12],destin:7,destroi:[2,12],destroypaperatredempt:[12,13],detail:[1,2,5],detect:1,determin:6,develop:[1,2,5,7,10,11],diagram:[6,13],diamond:13,didn:[10,11,12],differ:[1,2,5,6,9,10,12],difficult:[7,10],digit:[2,9,10,12],digitalsignatur:[9,10],direct:[1,12],directli:[1,8],directori:[0,3,11,12],directthreadexecutor:1,dirti:12,disallow:12,discuss:7,disk:10,disobei:9,disprov:4,disput:[6,12],distinguish:12,distribut:[2,5,9,10],distrust:10,dlg:10,doc:[0,1,12],docker:8,docsit:0,document:[1,2,5,6,12],doe:[1,2,5,6,7,8,9,10,12],doesn:[1,2,7,8,9,10,11,12],dokka:0,dollar:[12,13],domain:[12,13],don:[1,2,3,5,7,10,12],done:[0,2,10,11,12],dot:6,doubl:[11,12],doubt:[1,5],down:[1,9,12],download:3,downsid:1,drag:13,drive:2,driven:11,drm:9,dsl:[12,13],due:[1,5,6,9,10,12],dummi:12,dummy_pubkey_1:12,duplic:12,durat:[9,12],dure:[1,6],dynam:12,each:[1,2,5,6,7,9,10,12],earli:[1,12,13],earliest:6,eas:7,easi:[1,5,9,12],easier:[1,10,12],easili:[1,9,10,11],econom:6,edit:3,editor:3,effect:[6,12],either:[1,5,6,9,10,12],element:2,ellipt:5,els:12,emb:12,embed:[2,5,8,9],emit:12,empti:12,enabl:12,encapsul:1,encod:9,encount:5,end:[5,6,9,10,12],endpoint:8,enforc:[1,12],engin:12,english:[1,12],enorm:10,enough:[1,7,10,12],ensur:[2,7,10,12],enter:12,entir:[2,6,7,9,12],entireti:6,entiti:[2,9,12],entri:[2,6,10,12],enumer:6,environ:[1,9,10],envisag:12,equal:[10,12],equival:[1,6,12],especi:13,essenti:[8,9,11,12],establish:11,etc:[6,9,10,12],euribor:[8,9],evalu:[6,9],even:[5,7,9,10,12],event:[1,2,6,9,10],eventu:11,ever:1,everi:[2,9,10,12],everybodi:9,everyon:9,everyth:[7,12],evid:9,evolv:12,exact:[9,12],exactli:[2,7,12],examin:[1,2,9,12],exampl:[0,1,2,6,7,9,10,12,13],excel:9,except:[1,10,12],excess:1,exchang:[6,10,12],execut:[2,9,12],executor:[1,7],exercis:12,exist:[1,2,4,6,12],expect:[1,5,7,10,12],expectedtypenam:10,expectfailureoftx:12,expens:1,experiment:10,explain:[1,7,10,12],explan:1,explicit:[1,9,10],explicitli:[1,2,12],explor:[1,3,4,5,8,12],exploratori:7,expos:[1,7,8,9,10],exposur:6,express:[2,5,6,9,10,12],extend:[1,5,12],extens:12,extern:[5,10],extract:[2,8,9,10,12],extrem:[9,12],face:[5,12,13],facevalu:12,fact:[1,2,6,9,10,12],factor:[2,6],fail:[7,12],failur:[10,12],fairli:[1,10],fake:[5,12],fals:[1,7,9,10,12],familiar:[2,12],far:[7,10,11,12],fashion:1,fast:7,fault:10,favour:12,featur:[1,10,12,13],feed:9,feel:12,fetch:[7,8,9],few:[1,5,7,8,9,10,11,12],fiber:10,field:[1,6,9,10,12,13],file:[0,1,2,7,8,10,11,12],fill:[1,10,12],filter:1,filterisinst:12,finalis:[6,10],financ:10,financi:[2,4,10],find:[0,2,8,10,11],finish:[7,10],firm:12,first:[3,4,6,7,8,9,10,11,12],firstli:12,fit:[1,2],fix:[1,2,5,6],fixedleg:6,fixedlegpaymentschedul:6,fixedratepaymentev:6,fixof:9,flag:[8,11],flexibl:2,floatingleg:6,floatinglegpaymentschedul:6,floatingratepaymentev:6,flow:[1,6,12],fly:10,fold:1,folder:0,follow:[0,1,3,4,7,8,9,10,12,13],font:1,foo:[1,7],foobrokenexcept:1,fooutil:12,forc:8,fordai:9,forget:[10,12],form:[10,12],formal:[7,12],format:[0,1,2,8],forth:10,forward:[7,9,10],found:[3,8,9,10],four:12,frame:[1,10],framework:5,free:[2,9,10],freeform:12,freeli:9,frequenc:6,frequent:10,fresh:[9,12],freshkei:10,freshli:12,from:[0,1,2,3,5,6,7,8,9,10,11,12,13],front:12,full:[1,7,10,12],fulli:[1,7,10,12],fullysign:10,fun:[9,10,12],fundament:[4,12],fungibl:5,funni:10,further:[5,6,11],futur:[2,4,9,10,12,13],gain:5,game:10,garbag:[1,8,10],gather:12,gcd:2,generateirsandfixsom:6,generateissu:12,generatemov:12,generateredeem:12,generatespend:[10,12],genuin:1,get:[1,2],getbloomfilters:1,getclass:12,getcommand:12,getfacevalu:12,getfix:6,getinput:12,getissu:12,getlegalcontractrefer:12,getmaturityd:12,getoutput:12,getown:12,getprogramref:12,getprotocoltrack:10,getsign:12,getter:12,gettim:12,getvalu:12,git:3,github:0,give:[2,12],given:[2,7,9,10,12],givenpric:10,global:[2,9,12],glue:10,gnu:0,goal:[1,4,5,10],goe:11,gone:[10,12],good:[1,10,12,13],got:[8,10],gradl:[3,5,11],gradlew:3,grammar:1,graph:[2,5,8,10,12,13],graphit:8,green:3,group:[2,7,12,13],groupstat:12,guava:[1,5],gui:10,hack:2,had:12,hand:[10,11,12],handl:[1,2,7,10,12],handler:[7,10],happen:[1,9,10,12],happi:11,hard:[1,10],hase:6,hash:[2,5,8,9,10,12],hashcod:12,hassl:10,have:[1,2,5,6,7,9,10,11,12],haven:12,heap:10,heart:12,heavili:2,hedg:6,heirarchi:1,held:12,hell:10,hello:10,help:[1,7,10],helper:[6,7,12],henc:6,her:[12,13],here:[1,5,7,8,9,10,12,13],hierarch:10,hierarchi:10,high:[9,10],higher:[1,3,12],highlight:12,histori:10,hit:3,hold:[2,7],holder:[1,12],holidai:[6,9],home:3,hood:10,hotspot:1,how:[1,2,5,9,10,11],howev:[6,7,9,10,12],html:[0,1],http:[0,3,8,9,11,12],hub:10,human:[9,10],hundr:10,hurt:10,hypothesi:4,idea:[1,2,3,5,10,12],ideal:[10,12],ident:[2,9,10,11,12],identifi:[2,5,6,7,8,9,10],identityless:2,identityservic:10,ignor:12,illeg:9,illegalargumentexcept:[1,9,10,12],illegalstateexcept:[1,12],illustr:1,imagin:[1,10,12],immedi:12,immut:[1,2,6,9,12],imper:1,implement:[1,2,5,6],impli:10,implicitli:[6,12],impos:[9,10,12],imposs:9,improv:[2,12,13],inbackground:7,includ:2,incorpor:9,increas:[1,7],independ:[9,12],index:[2,6,12],indic:[6,7,10,12],individu:[7,12],industri:[4,5,8],infer:12,infix:12,influenc:8,info:10,inform:[1,2,10,12],infrastructur:[2,8],inherit:[1,7,12],init:9,initi:[7,10,12],inmemorymessagingtest:7,inoutgroup:12,input:[2,9,10,12,13],insert:[1,7,8,9],insid:[2,7,10,11,12],instal:[0,3],instanc:[1,2],instant:[1,9,10,12],instanti:[2,10],instead:[1,2,5,12],institut:5,institutionrefer:12,instruct:[8,11,12],instrument:6,insufficientbalanceexcept:12,integ:12,integr:[1,5,9,10,13],intellig:1,intend:[1,2,5,8,9,10],intent:[9,12,13],intention:1,interact:[1,2,9,10],interest:5,interestrateswap:5,interfac:5,intern:[5,7,12],internalis:1,interop:[5,12],interpret:[1,2,12],intersect:12,introduc:[1,9,12],introduct:5,intuit:1,invalid:[9,10,12],invari:12,investig:10,invoc:7,invok:[1,2,7,8,10,12],involv:[7,9,10,12],iou:5,ipsa:9,irsexport:6,irstest:6,irsutil:6,isaft:12,isempti:12,isinst:10,isn:[1,10,12],issu:[5,7,9,12,13],issuanc:[10,12,13],issuer:12,item:[3,12],iter:[10,12],itself:[2,6,7,8,9,10,12],jar:[0,2,8],jarinputstream:2,java:[1,5,7,8,10,12],javaclass:10,javacommercialpap:12,javadoc:1,jdk1:3,jdk:[3,10,12],jetbrain:[3,5],jira:5,jmx2graphit:8,jmx:8,jmxtran:8,join:[7,12],joint:12,jolokia:8,json:8,judgement:1,jump:11,junit:[5,12],just:[1,2,3,7,8,10,11,12],justifi:4,jvm:[2,5,8,10],kafka:7,kdoc:1,keep:[2,10,12,13],kei:[1,2,5,7,9,10,11,12],kept:10,key_mismatch_at_issu:12,keymanagementservic:10,keypair:[10,12],keyword:[1,12],kick:10,kind:[2,5,7,9,10,12],know:[5,9,10,11],knowledg:9,known:[2,6],kotin:12,kotlin:[1,3],kryo:[5,7,10],label:[10,12,13],labori:12,land:6,languag:[1,2,3,4,5,12,13],larg:[9,10],larger:[1,2],latenc:9,later:[1,2,5,7,9,10,12],latest:[1,3],latter:[1,12],layer:[5,7,10],layout:13,lazili:12,lead:[1,12],leak:10,learn:[4,10,11,12],least:[9,12],leav:[1,10],ledger:[2,4,6,8,9,10,12,13],left:[7,10],leg:[5,6],legal:[2,9,12],legalcontractrefer:12,legallyidentifi:[9,10],legallyidentifiablenod:10,less:[10,12,13],let:[1,2,8,9,10,11,12],letter:1,level:[1,3,6,7,9,10,12],lib:0,liber:1,libor:[6,8,9],librari:[1,5,8,9,10,12],lifecycl:[],lifetim:6,like:[1,2,3,6,7,8,9,10,12],likewis:12,limit:[2,4,12],line:[0,1,3,8,10,11,12],link:[1,2,9,10,12],linux:[8,11],list:[0,2,7,9,10,11,12],listen:[1,5],listenablefutur:10,liter:2,littl:[1,12],live:6,load:[11,12],loan:[6,9],local:[0,2,3,8,9,10],locald:9,localhost:8,locat:[9,11,12],lock:[1,12],log:[10,11],logger:10,logic:[2,5,7,10,12],logo:3,longer:[6,9,10],look:[1,6,7,8,9,10,12],loop:[1,6,12],loquitur:9,loss:9,lot:[1,6],low:10,lower:[1,9],lurch:10,mac:8,machin:[2,9],maco:11,made:[1,4,6,10],mai:[1,2,5,7,8,9,10,12],mail:11,main:[10,12,13],maintain:2,maintan:9,mainten:7,make:[0,1,6,7,9,10,12],makenod:7,maker:5,malici:10,manag:8,mani:[1,2,5,7,9,10,12],manner:10,manual:7,map:[1,4,6,9,10,12],mappabl:12,mark:[1,10,12],markdown:1,marker:[10,12],market:4,match:[2,7,9,10,12],matur:[6,8,9,12],maturityd:12,maximis:2,maybestx:10,maybetraderequest:10,mbean:8,mean:[1,2,7,9,10],measur:[6,12],mechan:12,meet:12,mega_corp:12,mega_corp_kei:12,mega_corp_pubkei:13,megacorp:[12,13],member:6,memori:[],menlo:1,mention:10,menu:3,mere:[6,12],merg:[5,12],mess:10,messag:[1,2,5],messagehandlerregistr:7,messagerecipi:7,messagerecipientgroup:7,messagingservic:[7,10],method:[1,8],metric:8,middl:[1,7,10],might:[1,6,10,12],mind:[1,9,10,12],mine:2,minim:10,minimum:[2,6],minu:12,minut:[5,9],misc:7,miss:[1,10,12],missingsig:10,mission:8,mix:[1,10,12],mock:7,mode:[5,7],model:1,modif:12,modifi:[3,6,10,12],modul:[7,12],moment:7,monei:[9,12],monetari:12,monitor:1,month:[6,10],more:[1,2,5,6,7,8,9,10,11,12],moreexecutor:1,most:[6,7,8,9,10,12],mostli:12,move:[10,12,13],movement:[10,12],much:[1,2,5,10,12],multi:[1,10,12],multipl:[2,7,12],multipli:6,must:[2,7,8,9,10,12],mutabl:[1,2,12],mutual:10,myfil:8,mykeypair:10,nail:1,name:[1,7,8,9,10,11,12],namespac:10,narrow:1,nativ:10,natur:12,naval:[2,9],navistar:9,necessari:[1,11],necessarili:12,need:[0,1,2,4,6,7,8,10,12],neither:[10,12],nest:10,net:[6,12,13],network:5,neutral:5,never:[1,9,12],newli:10,newown:12,next:[1,3,6,10,12],nio:1,noddi:8,node:[2,5],nodea:11,nodeb:11,nodeinterestr:9,nodeservic:9,non:[1,2,10],none:10,normal:[6,10,12],not_matured_at_redempt:12,notat:10,note:[0,1,2,3,6,10,12],noth:[1,2,12],notic:[1,12],notif:7,notifi:7,notion:[2,5,6,12],notnul:12,now:[3,7,9,10,11,12,13],nugget:12,nullpublickei:12,number:[1,6,7,9,10,11,12],obj:12,object:[1,2,5,6,7,8,9,10,12,13],oblig:6,observ:[6,9,10],observatori:[2,9],obsolet:5,obtain:[1,13],obviou:[1,9],obvious:[6,12],occasion:[],occur:[9,10,12],occurr:9,odd:[10,12],off:[7,10,12,13],offer:10,offlin:7,offset:6,often:[1,2,6,9,10,12],oftenor:9,onc:[0,1,5,6,7,9,10,12],onli:[1,2,5,6,7,8,9,10,11,12,13],onto:[1,10,12,13],opaqu:[5,7],opaquebyt:12,open:[2,3,9,10,11,13],openjdk:3,oper:[6,7,8,9,10,12],opposit:12,optim:1,option:[0,6,7,9,10,12],oracl:[2,3,5,6,8],ordain:6,order:[0,5,6,7,10,12,13],ordinari:[2,5,10,12],org:[0,3,12],orient:[],origin:12,otc:5,other:[1,2,5,6,7,9,10,11,12],othersid:10,otherwis:[10,12],our:[1,2,10,12],ourselv:[10,12],oursignatur:10,out:[1,2,3,5,8,9,10,12],outag:7,outcom:10,outlin:10,outpoint:2,output:[2,9,10,12,13],outsid:[2,7,9,10,12],outstat:12,over:[1,2,6,7,8,9,10,12],overal:7,overflow:1,overload:10,overrid:[10,12],overview:4,own:[1,7,8,9,10,12,13],ownablest:10,owned_bi:12,owner:[10,12],ownership:[10,12],owningkei:[10,12],p2p:[5,10],packet:2,page:[9,12],pai:[9,10,12,13],paid:6,pair:[2,10],paper:[5,10,11],paper_1:[12,13],parallel:[7,10,12],paramet:[10,12],parameteris:2,parent:10,pars:9,part:[1,2,9,10,12],parti:[5,6,9],partial:[10,12],partialtx:10,particip:[2,12],particular:[1,8,10],pass:[7,10,12,13],past:[9,11,12],patch:1,path:[1,8,12],pattern:[1,2,12],payer:6,payment:[6,9,10,11,12,13],pdf:9,peer:[5,7,9,10],penni:12,peopl:[1,2,5,12],perform:[1,6,9,10,11,12],perhap:12,period:6,perman:[5,12],persist:[5,7,10],perspect:[10,12],phrase:9,physic:9,pick:[7,10],piec:[2,7,10,12],ping:7,pip:0,pki:2,place:[0,1,2,5,6,7,9,10,12],plai:[10,11],plan:7,platform:[2,4,5,6,7,9,10,11,12],pleas:[1,2,11,12],plugin:[3,8],point:[1,2,8,9,10,11,12],pointer:10,pointless:1,pong:7,pool:10,poor:2,pop:[3,7],popular:5,posess:10,posit:[1,10],possibl:[2,4,7,9,10,12],potenti:[5,10,12],pound:12,power:[2,4],practic:[2,12],pre:[0,2,6,10,12],preced:12,precis:[5,9],precondit:1,prefer:[1,2],prefix:10,preliminari:7,prepar:12,present:[4,6,9,12],press:12,pretend:8,pretti:[10,12],prevent:12,previous:[6,9],price:[2,9,10],primari:[5,9],primit:12,print:11,priv:10,privaci:[1,2,10,12],privat:[2,10,12],probabl:[3,9,12],problem:[9,10,12],proce:10,procedur:10,process:[6,7,8,12],process_:8,produc:[0,12,13],product:[1,4,5,12],profit:[12,13],program:[1,2,5,7,8,10,11,12],programref:12,progress:6,progresstrack:10,project:[3,11],proof:[2,4],propag:[4,8,12],properli:10,properti:[8,10,12],propos:10,prose:9,protect:10,protocol:[2,5,8,9],protocollog:10,protocolstatemachin:10,protocoltrack:10,prototyp:[1,2],prove:[2,4,12],provid:[0,1,2,6,7,8,9,10,12],pseudo:9,ptx:10,publickei:[10,12],publicli:[],pull:3,pump:7,punish:9,purchas:[10,11],pure:[2,9],purpos:[5,10,12],put:[1,10,12],python:0,qualiti:4,quantiti:[2,5,12],quasar:10,queri:[6,9],question:[1,9],queue:[1,5,7,10],quick:9,quickli:[7,12],quit:[1,9,10,12],r3prototyp:0,r3repositori:3,random63bitvalu:10,random:[2,10],rang:9,rapid:[1,5],rate:[1,5],ratefixprotocol:9,rather:[1,2,10,12],rational:2,raw:[8,10],reach:[6,9],reachabl:10,read:[1,4,5,8,9,10,12],readabl:[5,10],reader:12,readi:12,real:[1,5,7,9,12],realis:10,realism:7,realiti:[6,12],realli:[1,10,12],reason:[1,6,10,12],reassign:12,recal:6,receiv:[2,6,7,9,10,12,13],receiveandcheckproposedtransact:10,receiveandvalidatetraderequest:10,recipi:[7,12],recognis:[2,9,12],recommend:[1,7],record:[7,12],recov:7,recreat:10,red:[3,6],redeem:[5,12,13],redempt:[12,13],redemptiontim:[12,13],reduc:1,redund:1,ref:[10,12],refer:[2,5,6,9,10,12],refin:5,reflect:12,refus:3,regardless:10,regener:6,regist:[1,7,8,10],registr:7,regular:[5,8,10,12],reissuanc:12,reject:12,rel:[2,7],relabelablestep:10,relat:[6,12],relationship:12,releas:13,relev:2,reli:2,reliabl:7,relianc:2,relic:8,religi:1,remain:[12,13],rememb:[1,10,12],remind:10,remov:[7,10,12],render:[1,10,13],repeat:[1,6,7,10],replac:[6,8,12],replic:2,report:7,repositori:1,repres:[1,2,6,7,9,10,12],represent:6,request:[7,9,10],requir:[1,5,6,8,9,10],requiresinglecommand:12,requirethat:12,resel:9,reserv:10,reset:6,resolut:[2,4,10],resolv:10,resolvetransactionsprotocol:10,resourc:10,respect:[1,10,12],respons:[7,9,10],rest:[2,7,8,10],restart:[3,10,11],restor:10,restructuredtext:0,result:[1,2,6,9,10,12],resultfutur:10,resum:10,resurrect:10,retri:[7,10],retriev:6,reus:[2,10],reusabl:9,reveal:[10,12],revers:10,review:1,revis:6,rewrit:10,right:[1,3,7,8,10],rigid:2,rigidli:1,risk:10,roll:[6,10],rollov:12,root:[11,12,13],roughli:9,rout:10,router:7,rule:[1,9,10,12],run:[1,2,3,5,8,10],runbuy:10,runnetwork:7,runsel:10,runtim:[1,10],safe:[1,2,10,12],safeti:1,sai:[1,12],sale:[11,12],same:[1,2,5,6,7,9,10,12,13],sandbox:[2,5,12],saniti:10,satisfi:12,save:[1,12],scala:[5,12],scalabl:[1,2,12],scale:6,scene:[10,12],schedul:[6,8],scope:[2,12],scrape:8,screen:[1,3],script:[0,2,11,12],scroll:11,scrub:10,seamless:5,search:[3,10,12],second:[6,10,11,12],secondari:10,secp256r1:5,section:12,secur:[2,7,10],securehash:12,see:[0,1,5,6,7,9,10,11,12],seed:10,seen:[1,6,9,10,12,13],select:[3,12],self:5,sell:[5,10,12],seller:[],sellerownerkei:10,sellersig:10,sellertradeinfo:10,semi:[2,9],send:[1,2,7,8,9,10,12],sendandrec:10,sendsignatur:10,sens:[6,9,10,12],sent:[7,10,12],separ:[8,9,10,12],sequenc:7,sequenti:[7,10],seri:10,serial:[5,7,12],serialis:[1,5,7,10,12],serializablewithkryo:12,serializeablewithkryo:12,server:[8,9],servic:8,servicehub:10,session:[7,10],sessionid:10,set:2,setof:10,setter:12,settim:10,settl:[7,9],settlement:10,sever:[2,10,12],sha256:12,sha256sum:8,sha:[2,8],share:[2,4,6,9,10,12],shasum:8,she:12,shell:11,shortcut:5,shorthand:12,shot:7,should:[1,2,3,5,7,10,11,12],shoulder:1,shouldn:10,show:[2,3,5,11,12,13],shown:[10,12],shutdown:10,side:[9,10],sig:12,sign:[2,5,6,7,9,10,12],signatur:[2,5,7,9,10,12],signatureexcept:10,signaturesfromsel:10,signedtransact:[10,12],signer:[9,12],significantli:6,signoff:9,signwith:[10,12],signwithecdsa:10,signwithourkei:10,silver:1,similar:[1,2,7,9,12],similarli:12,simpl:[1,5,6,7,8,10,12,13],simpler:5,simplest:10,simpli:[1,7,10,12],simplifi:[1,2,5,7,12],simultan:[7,10,12],singl:[1,2,8,9,10,12,13],singlemessagerecipi:[7,10],singleton:[10,12],sit:7,site:1,situat:1,size:[1,6,10,12],skip:10,slight:12,slightli:12,slow:1,small:[2,5,9,10,11,12,13],smart:[5,9],smm:10,smooth:12,snide:0,snippet:[10,12],softwar:[5,10],sold:[10,12,13],solv:[9,10,12],solvenc:9,some:[1,2,5,7,8,9,10,11,12,13],somed:12,someon:[7,12],someprofit:[12,13],someth:[1,3,6,11,12],sometim:[2,7,8,9,10,12],somewhat:[2,10],somewher:[12,13],sort:[9,10],sound:[10,12,13],sourc:[6,9,10],space:[1,9,12],sparingli:1,special:2,specialis:10,specif:[2,7,8,9,10,12,13],specifi:[0,5,7,9,10,12],speed:10,spend:[2,10,12],sphinx:0,sphinx_rtd_them:0,split:[5,12],spread:[7,10],spreadsheet:9,squar:13,src:[12,13],stack:10,stage:[1,10,12],stai:2,standalon:[5,9],standard:[1,4,5,8,10,12],standardis:[2,12],start:[1,2,6,8,10,11],startup:11,state:[2,5,6,9],stateandref:[10,12],stateless:2,statemachinemanag:10,statement:[1,9,10,12],stateref:2,statesoftyp:10,statist:8,status:2,step:[9,10,12],still:[2,10,12],stock:[2,9],stop:[1,7,10],storag:2,store:[10,12],stori:1,straightforward:[10,12],stream:10,stress:1,strictli:6,string:[7,9,10,12],strong:5,structur:[1,2,3,5,9,10,12],studi:12,stuff:10,stx:10,sub:10,subclass:10,subgroup:2,submenu:3,submiss:9,submit:[1,7,10],subprotocol:10,subscrib:7,subtask:10,subtl:1,success:11,successor:5,sudo:0,suffic:9,suffici:[4,7,9],suffix:12,suggest:[7,12],suitabl:7,sum:12,sumcashbi:[10,12],sumcashornul:12,summaris:2,sun:1,superclass:10,superior:1,supertyp:12,support:[1,5,6,7,9,10,11,12],suppos:[10,12],sure:12,surfac:10,surround:[1,12],surviv:10,suspend:[],swap:5,swapsignatureswithsel:10,symbol:3,synchronis:[1,2,9],syntax:[5,12],syscal:11,system:[2,5,8,9,10,12],tab:[1,3],tag:1,tailor:4,take:[1,5,6,10,12,13],tamper:10,target:[0,1,2,5,8],targetrecipi:7,task:[2,10],technic:[],techniqu:[1,9,12],tell:[0,7,10],tempor:9,temporari:2,temporarili:10,tempt:12,temptat:10,ten:12,tenor:[6,8,9],term:[2,12],termin:[6,8,10,11],terminolog:2,test:[3,5,10,11],test_tx_tim:12,testutil:12,testwithinmemorynetwork:7,text:[1,3,8],than:[1,2,4,8,10,12,13],thei:[1,2,5,6,7,8,9,10,11,12],theirsessionid:10,them:[1,2,5,6,7,8,10,11,12],themselv:[7,9,10,12],theori:9,therefor:[5,10,12],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],thing:[1,2,5,9,10,11,12],think:[1,3,10,12],third:[11,12],those:[7,8,9,10,12],though:[7,8,10,12],thought:[2,5],threadsaf:1,three:[11,12],threshold:12,through:[2,6,8,10,12],throwifsignaturesaremiss:10,thrown:12,thu:[1,8,9,12],tighten:12,tightli:10,time:[1,2,5,6,8,9,10,12,13],timelin:12,timestamp:[1,2,5,9,10,12],timestampauthoritysig:10,timestampcommand:9,timestampercli:12,timestamperservic:9,timestampingauthor:10,timestampingprotocol:10,todo:[10,12],togeth:[2,10,12],told:1,toledgertransact:10,toler:9,too:[1,10,12,13],took:10,tool:[5,8],top:[1,10,12],topic:[7,10],topriv:10,toset:10,tosignedtransact:[10,12],tostr:[1,10,12],total:12,trace:10,track:[],tracker:[5,10],trade1:11,trade:[5,6,9],trade_top:10,tradeoff:[1,9],trader:[],traderequest:10,tradit:12,traffic:10,transact:[2,4,8,9,10,12,13],transactionbuild:[10,12],transactionforverif:12,transactiongroup:12,transactiongroupdsl:13,transactiongroupfor:13,transactiongroupfortest:12,transfer:12,transit:[4,12],treat:12,tree:10,tri:12,tricki:10,trigger:9,trivial:[1,11],trust:10,truth:10,tsa:[2,10],tsasig:10,ture:2,turn:[10,12],tutori:[4,5,9,10,12],twice:5,two:[1,5,6],twopartytradeprotocol:10,txbit:10,txhash:[2,10,12],txt:8,type:[1,2,6,9,10,12],typenam:10,typetobui:10,typic:[7,8,10,12],ubuntu:11,unacceptablepriceexcept:10,under:[0,10,12],underli:[6,10],underscor:12,understand:8,unexecut:12,unexpect:10,unfinish:10,unfortun:[10,12],unguess:10,uniqu:[2,9,10],unit:[3,5,7,10,12,13],unix:8,unknow:9,unless:[1,9,10,12],unlik:12,unnecessari:12,unpack:10,unread:10,unrecognis:12,unserialis:10,unset:6,unspent:2,unstart:10,unsupportedoperationexcept:12,until:[6,7,10],untrustworthydata:10,unus:7,unusu:12,unwieldi:12,updat:[2,3,7,10,12],upgrad:[3,4],upload:[],upon:[6,10,12],url:3,usabl:5,usag:[1,9,10,12],user:[0,1,2,5,7,9,10,11],usr:0,util:[5,7,12],utxo:2,vagu:1,val:[7,9,10,12,13],valid:[2,6,9,10,12],valu:[5,6,9,12,13],valuabl:9,valuat:6,vanilla:[5,6],vari:[],variabl:[6,10,12],variant:12,variou:[1,2,5,8,10,12],vendor:[5,8],verbos:12,veri:[1,2,5,9,11,13],verif:[2,5],verifi:[2,5,9,10],verifytransact:10,versa:[6,10],version:[3,5,6,7,10,12],versu:10,vertic:1,via:[0,1,2,6,8,9,10,11],vice:[6,10],view:[1,6],virtual:[2,4],visibl:2,visualis:[],vital:10,wai:[1,2,5,8,9,10,12],wait:[3,7,10,11],wallet:[2,10,12],walletservic:10,want:[1,3,7,8,9,10,12],weak:9,web:[8,9],websit:12,weekend:6,well:[0,1,2,5,6,8,9,10,12],went:1,were:[1,9,10,12],what:[1,2],whatev:[1,10],when:[1,6,7,8,9,10,12],whenev:1,where:[1,2,6,7,8,9,10],wherea:[6,12],wherev:8,whether:[7,9,10],which:[0,1,2,5,6,7,8,9,10,11,12],whilst:[2,9,10,12],who:[1,5,7,10,12],whole:12,whom:7,whose:8,why:[1,2,5,12],wide:[1,7,12],widescreen:1,widespread:1,width:1,wiki:[2,12],wikipedia:12,window:[2,10,11,13],wirecommand:12,wiretransact:[9,10],wish:[7,9,10,12],within:[0,2,8,11],withkei:10,withnewown:10,without:1,withoutown:12,won:[7,9,10,12],word:1,work:[1,2,3,4,5,6,7,8,9,10,11,12],worker:1,world:[2,9,10,12],worn:12,worri:[1,5,10],worth:[1,12],worthless:9,would:[1,5,6,7,8,9,10,12],wouldn:[9,12],wrap:[1,8,10,12],wrapper:10,write:[1,5,8],written:[0,2,5,6,12],wrong:[1,10,11],wtx:[9,10],www:[0,3],year:6,yet:[1,2,6,10,12],yield:[2,10],you:[0,1,2,3,5,7,8,9,10,11,12,13],your:1,your_usernam:3,zero:[2,12],zip:[2,8]},titles:["Building the documentation","Code style guide","Data model","Getting set up","Welcome to the R3 prototyping repository!","What’s included?","The Interest Rate Swap Contract","Networking and messaging","Node administration","Writing oracle services","Protocol state machines","Running the demos","Writing a contract","Using the visualiser"],titleterms:{"class":12,"function":12,about:3,administr:8,api:12,approach:9,assert:[1,9],asset:12,attach:8,base:12,basic:9,bitcoin:2,build:0,buyer:10,check:12,code:1,command:12,comment:1,commerci:12,comparison:2,complain:3,continu:9,contract:[5,6,12],creat:6,data:[2,9],demo:11,descript:2,detail:6,document:0,download:8,error:1,ethereum:2,fix:8,framework:9,fungibl:12,gener:[1,12],get:3,guid:1,how:12,implement:[7,9,10],includ:5,instanc:6,intellij:3,interest:[6,8],interfac:7,introduct:[9,10],known:9,kotlin:5,lack:3,lifecycl:6,machin:10,manag:10,map:7,memori:7,messag:7,method:10,model:2,monitor:8,network:7,node:8,non:12,occasion:9,oracl:9,orient:12,paper:12,parti:10,progress:10,protocol:10,prototyp:4,publicli:9,rate:[6,8],repositori:4,requir:[0,12],run:11,sdk:3,seller:10,servic:[7,9],set:3,smart:12,start:12,state:[10,12],style:1,suspend:10,swap:6,technic:6,test:12,theori:10,thread:1,track:10,trade:10,trader:11,two:[9,10],understand:12,upload:8,vari:9,verifi:12,visualis:13,welcom:4,what:5,without:3,write:[9,12],your:[8,12]}}) \ No newline at end of file +Search.setIndex({envversion:47,filenames:["building-the-docs","codestyle","data-model","getting-set-up","index","inthebox","irs","messaging","node-administration","oracles","protocol-state-machines","running-the-demos","tutorial","visualiser"],objects:{},objnames:{},objtypes:{},terms:{"0_xx":3,"1mb":10,"8u45":3,"_before_":10,"_do_":10,"_in":8,"_is_":10,"_mbeans_":8,"abstract":10,"boolean":12,"break":[9,12],"byte":[1,2,5,10],"case":[2,7,9,10,12],"catch":[1,3,10],"class":[1,6,9,10],"default":[1,3,5,10,12],"export":[8,10],"final":[6,7,10,12],"float":[5,6],"function":[1,2,5,6,9,10,11],"import":[1,2,3,7,10,12],"instanceof":12,"int":[1,12],"long":[1,7,10,12],"new":[1,2,3,4,5,6,7,8,10,11,12],"null":[9,12],"public":[1,2,5,7,8,9,10,12],"return":[1,6,7,8,9,10,12],"short":[7,12],"static":[2,9,10,12],"switch":[5,10,12],"throw":[1,9,10,12],"transient":10,"true":[2,7,9,12,13],"try":[1,2,10,11,12,13],"var":12,"void":12,abil:[2,7],abl:[7,9],about:[1,2],abov:[6,7,10,12],accept:[1,2,7,10,12],acceptablepric:10,access:[2,7,8,9,10,12],accid:10,accident:[],accordingli:7,account:2,accrual:6,accur:9,achiev:7,acknowledg:10,across:[2,10],act:[7,9,10],action:12,activ:[6,11],actor:[1,10],actual:[6,7,9,10,12],adapt:[1,9,10],add:[1,7,8,10,12],addarg:12,addcommand:10,addinputst:[10,12],addit:12,addition:[9,10],addmessagehandl:7,addoutputst:[10,12],address:[2,7,10,12],adjust:[1,6],administr:5,advanc:[6,11],affect:9,affection:12,afraid:1,after:[2,5,6,9,10,12,13],again:[2,6,7,9,10,11,12],against:[6,10,12],agent:8,aggreg:12,agre:[3,6,10],agreement:[2,6],ahead:10,aim:1,algorithm:[2,5,12,13],alic:[12,13],aliceaddr:7,alicegetsback:[12,13],alicenod:7,aliv:10,all:[0,1,2,3,6,7,8,9,10,11,12],allow:[5,6,9,10,12],allpossiblerecipi:7,almost:[10,12],along:[5,7,9,10,12],alreadi:[1,9,10,12],alright:10,also:[1,2,3,5,6,7,8,10,11,12],alt:12,alter:[10,12],altern:[0,1,8,11],although:[2,5,6,7,12],alwai:[1,2,8,10,12],amounnt:10,amount:[5,6,10,12],amqp:5,ani:[1,2,6,7,8,9,10,12],annot:[1,10,12],anoth:[5,8,9,10,11,12],answer:[1,9],anticip:1,anyon:12,anyth:[2,7,9,10,12],anywher:[7,9,12],apach:[5,7],api:[1,5,8,9,10,11],app:8,appear:12,append:8,appendix:4,appli:[1,6,12],applic:[2,9],applyfix:6,approach:2,appropri:7,approv:10,arbitrari:[1,2,9,10,12],arbitrarili:5,architectur:9,area:7,aren:[10,12],arg:[12,13],arguabl:9,argument:[1,2,7,10,12],around:[2,7,9,10,12,13],arrai:[2,5,10],arrang:10,arriv:[9,10],arrow:6,artemi:5,articl:[2,7,9,10],artifact:12,ask:[1,10,12],aspect:10,assembl:2,assemblesharedtx:10,asset:[5,10],assetforsal:10,assetmismatchexcept:10,assettosel:10,assettypenam:10,assign:9,assist:[10,12,13],associ:[2,7,12],assum:[9,10,12],assumpt:10,atom:[9,10,11,12],attach:2,attempt:[2,3,4,7,10],attent:10,attest:9,attribut:1,audit:[2,10],authenticatedobject:12,author:[1,2,7,10],authoris:10,auto:[1,12],autom:12,automat:[0,7,10,12],avail:[0,6,7,8,9,12],avoid:[1,10],awai:[10,11],awar:[1,10],awkward:[1,10],axi:6,back:[9,10,12],backend:7,background:[1,2,7],backtick:12,backward:10,bad:[1,10,12],balanc:12,band:[9,10],bandwidth:1,bank:6,bankrupt:12,bankruptci:[2,9],base:[2,6],basi:[6,8],basic:[1,2,5],bear:[10,12],beauti:13,becaus:[1,3,7,8,9,10,12],becom:[1,6,10],been:[2,6,9,10,11,12],befor:[2,5,6,9,10,12],begin:[2,11,12],behav:12,behaviour:[5,8],behind:[10,12],below:[6,10],benefit:[10,12],best:1,bet:9,beta:3,better:[1,4,5,12,13],between:[1,6,7,9,10,11,12],beyond:[2,12],big:[1,10,12],bigdecim:9,bilater:[5,6],bill:12,binari:9,bind:[2,9],bit:[10,12,13],bitbucket:3,bitcoinj:10,blah:1,blank:[1,12],block:[1,2,4,7,9,10,12],blockchain:10,bloom:1,bloomfilt:1,blow:11,blue:[6,13],bob:12,bobaddr:7,bobnod:7,bond:12,bookkeep:[5,12],boost:5,borrow:13,both:[2,5,6,7,9,10,12],bottom:10,bound:[9,10],box:5,breadth:10,briefli:[7,13],broadcast:7,broke:1,broker:5,brows:5,bug:[1,5],bui:[5,10],build:[3,5,8,10],builder:12,built:[10,12],bullet:1,bunch:[11,12],bundl:2,busi:[2,5,7,9,10,12],buyer:[],buyersessionid:10,bytearrai:7,bytecod:[2,10,12],cach:7,calcul:[6,10,12],calendar:[6,9],calibr:2,call:[1,2,5,6,7,8,10,12],callback:[1,7,10],caller:12,came:10,can:[0,1,2,3,5,6,7,8,9,10,11,12,13],cannot:[2,9,12],capabl:12,capit:1,capitan:0,care:[1,7,9,10],carefulli:5,cash:[5,6,9,10,11,12,13],cashkt:12,cashsigningpubkei:10,cashstat:10,caus:12,center:12,certain:[1,5,12],cev:3,chain:[2,9,10,12],chanc:[1,10],chang:[0,1,2,6,7,9,10,12,13],channel:10,charact:1,charg:9,check:[1,3,5,9,10],checkabl:9,checkdepend:10,checksufficientsignatur:10,child:10,children:10,childrenfor:10,choic:1,choos:[3,12],circl:13,claim:[2,5,12],clean:10,clear:10,clearer:[7,10],click:[3,13],client:[8,9],clock:9,clone:1,close:9,closur:1,cloud:8,cmd:12,codebas:[1,12],colleagu:1,collect:[1,8],collector:[1,8,10],column:8,com:[0,3],combin:[4,12],come:[5,10],command:[2,3,6,8,9,10,11],commanddata:9,commerci:[5,9,10,11],commercial_pap:12,commercialpap:[5,12,13],commercialpapertest:[12,13],commit:10,common:[6,10,12],commonleg:6,commonli:12,commun:3,compani:9,companion:[10,12],compar:[2,7],compil:[11,12],complet:[2,7,10,11,12],complex:[1,2,12],complic:[10,12],compon:7,compos:[10,12],compris:6,comput:[6,9,10],concept:[2,9,10,12],conceptu:10,concern:[10,12],conclus:9,concurrenthashmap:1,condit:[9,10],config:8,configur:[3,8,10],confirm:7,conflict:[2,4],confus:10,connect:[5,8,12],consensu:[7,9],consid:[1,2,6,9,12],consist:[2,5,6,10],constant:[1,12],constantli:9,constraint:9,construct:[1,7,10,12],constructor:[9,12],consult:9,consum:2,consumpt:9,contact:10,contain:[2,6,7,8,9,10,11,12],content:[1,2,3,7,8,9,11,12],context:[1,8,9],continu:6,contract:2,contractst:[12,13],contractstateref:12,contrast:[2,9,10],contribut:[],control:[1,2,3,8,10,12],conveni:[1,12],convent:[6,10],convert:[6,12],convinc:10,copi:[1,7,10,12],copyonwritearraylist:1,copyright:1,core:[7,12],correct:12,correctli:[2,9,12],correspond:12,correspondingli:1,cost:[9,12],could:[1,9,10,11,12],count:6,counter:[1,10],counterparti:6,countri:9,coupl:[9,10],cours:[8,9,12],cover:[2,9,10,12],cp_program_id:12,creat:[1,2],createdummyir:6,createmessag:7,creation:[4,6,12],creator:9,crisp:12,crop:2,curl:8,currenc:[5,6,12],current:[1,2,5,6,7,9,10,11,12,13],currentwallet:10,curv:[5,6],custom:[8,11],cycl:1,dai:[6,8,9,12,13],dashboard:8,data:1,databas:[5,10],dataset:6,date:[6,8,9,11,12],deal:[1,9,11],debug:10,decd098666b9657314870e192ced0c3519c2c9d395507a238338f8d003929de9:8,decd:8,decentralis:9,decid:[9,12],declar:[1,7,12],dedic:1,defin:[1,2,5,7,8,9,10,12,13],definit:[10,12],delai:[6,9],delet:[1,10,12],deliv:7,deliveri:[7,10,11,12],demo:5,demonstr:11,denomin:5,dens:1,depend:[1,3,9,10,12],dependencytxid:10,deposit:[5,12],depth:12,deregist:7,deriv:[6,10,12],describ:[1,4,10,12],descript:1,design:[1,2,4,5,9,12],desir:[10,12],desktop:8,despit:[10,12],destin:7,destroi:[2,12],destroypaperatredempt:[12,13],destructur:12,detail:[1,2,5],detect:1,determin:6,develop:[1,2,5,7,10,11,12],diagram:[6,13],diamond:13,didn:[10,11,12],differ:[1,2,5,6,9,10,12],difficult:[7,10],digit:[2,9,10,12],digitalsignatur:[9,10],direct:1,directli:[1,8],directori:[0,3,11,12],directthreadexecutor:1,dirti:12,disallow:[],discuss:7,disk:10,disobei:9,disprov:4,disput:[6,12],distinguish:12,distribut:[2,5,9,10],distrust:10,dlg:10,doc:[0,1,12],docker:8,docsit:0,document:[1,2,5,6],doe:[1,2,5,6,7,8,9,10,12],doesn:[1,2,7,8,9,10,11,12],dokka:0,dollar:[12,13],domain:[12,13],don:[1,2,3,5,7,10,12],done:[0,2,10,11,12],dot:6,doubl:[11,12],doubt:[1,5],down:[1,9,12],download:3,downsid:1,drag:13,drive:2,driven:11,drm:9,dsl:[12,13],due:[1,5,6,9,10,12],dummi:12,dummy_pubkey_1:12,duplic:12,durat:[9,12],dure:[1,6],dynam:12,each:[1,2,5,6,7,9,10,12],earli:[1,12,13],earliest:6,eas:7,easi:[1,5,9,12],easier:[1,10,12],easiest:12,easili:[1,9,10,11],econom:6,edit:3,editor:3,effect:6,either:[1,5,6,9,10,12],element:2,ellipt:5,els:12,emb:12,embed:[2,5,8,9],emit:12,empti:12,enabl:12,encapsul:1,encod:9,encount:5,end:[5,6,9,10],endpoint:8,enforc:[1,12],engin:12,english:[1,12],enorm:10,enough:[1,7,10,12],ensur:[2,7,10,12],enter:12,entir:[2,6,7,9,12],entireti:6,entiti:[2,9,12],entri:[2,6,10,12],enumer:6,environ:[1,9,10],envisag:12,equal:[10,12],equival:[1,6,12],especi:13,essenti:[8,9,11,12],establish:11,etc:[6,9,10,12],euribor:[8,9],evalu:[6,9],even:[5,7,9,10,12],event:[1,2,6,9,10],eventu:11,ever:1,everi:[2,9,10,12],everybodi:9,everyon:9,everyth:[7,12],evid:9,evolv:12,exact:[9,12],exactli:[2,7,12],examin:[1,2,9,12],exampl:[0,1,2,6,7,9,10,12,13],excel:9,except:[1,10,12],excess:1,exchang:[6,10,12],execut:[2,9,12],executor:[1,7],exercis:12,exist:[1,2,4,6,12],exit:12,expect:[1,5,7,10,12],expectedtypenam:10,expectfailureoftx:12,expens:1,experiment:10,explain:[1,7,10],explan:1,explicit:[1,9,10],explicitli:[1,2,12],explor:[1,3,4,5,8,12],exploratori:7,expos:[1,7,8,9,10],exposur:6,express:[2,5,6,9,10,12],extend:[1,5,12],extens:12,extern:[5,10],extract:[2,8,9,10,12],extrem:[9,12],face:[5,12,13],facevalu:12,fact:[1,2,6,9,10,12],factor:[2,6],fail:[7,12],failur:[10,12],fairli:[1,10],fake:[5,12],fals:[1,7,9,10,12],familiar:[2,12],far:[7,10,11,12],fashion:1,fast:7,fault:10,favour:[],featur:[1,10,12,13],feed:9,feel:12,fetch:[7,8,9],few:[1,5,7,8,9,10,11,12],fiber:10,field:[1,6,9,10,12,13],file:[0,1,2,7,8,10,11,12],fill:[1,10,12],filter:1,filterisinst:12,finalis:[6,10],financ:10,financi:[2,4,10],find:[0,2,8,10,11],finish:[7,10],firm:12,first:[3,4,6,7,8,9,10,11,12],firstli:12,fit:[1,2],fix:[1,2,5,6],fixedleg:6,fixedlegpaymentschedul:6,fixedratepaymentev:6,fixof:9,flag:[8,11],flexibl:2,floatingleg:6,floatinglegpaymentschedul:6,floatingratepaymentev:6,flow:[1,6,12],fly:10,fold:1,folder:0,follow:[0,1,3,4,7,8,9,10,12,13],font:1,foo:[1,7],foobrokenexcept:1,fooutil:12,forc:8,fordai:9,forget:[10,12],form:[10,12],formal:[7,12],format:[0,1,2,8],forth:10,forward:[7,9,10],found:[3,8,9,10],four:12,frame:[1,10],framework:5,free:[2,9,10],freeform:12,freeli:9,frequenc:6,frequent:10,fresh:[9,12],freshkei:10,freshli:12,from:[0,1,2,3,5,6,7,8,9,10,11,12,13],front:12,full:[1,7,10,12],fulli:[1,7,10,12],fullysign:10,fun:[9,10,12],fundament:[4,12],fungibl:5,funni:10,further:[5,6,11],futur:[2,4,9,10,12,13],gain:5,game:10,garbag:[1,8,10],gather:12,gcd:2,generateirsandfixsom:6,generateissu:12,generatemov:12,generateredeem:12,generatespend:[10,12],genuin:1,get:[1,2],getbloomfilters:1,getclass:12,getcommand:12,getfacevalu:12,getfix:6,getinput:12,getissu:12,getkei:12,getlegalcontractrefer:12,getmaturityd:12,getoutput:12,getown:12,getprogramref:12,getprotocoltrack:10,getsign:12,getter:12,gettim:12,getvalu:12,git:3,github:0,give:[2,12],given:[2,7,9,10,12],givenpric:10,global:[2,9],glue:10,gnu:0,goal:[1,4,5,10],goe:11,gone:[10,12],good:[1,10,12,13],got:[8,10],gover:12,gradl:[3,5,11],gradlew:3,grammar:1,graph:[2,5,8,10,12,13],graphit:8,green:3,group:[2,4,7,13],groupstat:12,guava:[1,5],gui:10,hack:2,had:12,hand:[10,11,12],handl:[1,2,7,10,12],handler:[7,10],happen:[1,9,10,12],happi:11,hard:[1,10],harder:12,hase:6,hash:[2,5,8,9,10,12],hashcod:12,hassl:10,have:[1,2,5,6,7,9,10,11,12],haven:12,heap:10,heart:12,heavili:2,hedg:6,heirarchi:1,held:12,hell:10,hello:10,help:[1,7,10],helper:[6,7,12],henc:6,her:[12,13],here:[1,5,7,8,9,10,12,13],hierarch:10,hierarchi:10,high:[9,10],higher:[1,3,12],highlight:12,histori:10,hit:3,hold:[2,7],holder:[1,12],holidai:[6,9],home:3,hood:10,hotspot:1,how:[1,2,5,9,10,11],howev:[6,7,9,10,12],html:[0,1],http:[0,3,8,9,11,12],hub:10,human:[9,10],hundr:10,hurt:10,hypothesi:4,idea:[1,2,3,5,10,12],ideal:[10,12],ident:[2,9,10,11,12],identifi:[2,5,6,7,8,9,10],identityless:2,identityservic:10,ignor:12,illeg:9,illegalargumentexcept:[1,9,10,12],illegalstateexcept:[1,12],illustr:1,imagin:[1,10,12],immedi:12,immut:[1,2,6,9,12],imper:1,implement:[1,2,5,6],impli:10,implicitli:6,impos:[9,10,12],imposs:9,improv:[2,12,13],inbackground:7,includ:2,incorpor:9,increas:[1,7],independ:9,index:[2,6,12],indic:[6,7,10,12],individu:[7,12],industri:[4,5,8],infer:12,infix:12,influenc:8,info:10,inform:[1,2,10,12],infrastructur:[2,8],inherit:[1,7,12],init:9,initi:[7,10,12],inmemorymessagingtest:7,inoutgroup:12,input:[2,9,10,12,13],insert:[1,7,8,9],insid:[2,7,10,11,12],instal:[0,3],instanc:[1,2],instant:[1,9,10,12],instanti:[2,10],instead:[1,2,5,12],institut:5,institutionrefer:12,instruct:[8,11,12],instrument:6,insufficientbalanceexcept:12,integ:12,integr:[1,5,9,10,13],intellig:1,intend:[1,2,5,8,9,10],intent:[9,12,13],intention:1,interact:[1,2,9,10],interest:5,interestrateswap:5,interfac:5,intern:[5,7,12],internalis:1,interop:[5,12],interpret:[1,2,12],intersect:12,introduc:[1,9,12],introduct:5,intuit:1,invalid:[9,10,12],invari:12,investig:10,invoc:7,invok:[1,2,7,8,10,12],involv:[7,9,10,12],iou:5,ipsa:9,irsexport:6,irstest:6,irsutil:6,isaft:12,isempti:12,isinst:10,isn:[1,10,12],issu:[5,7,9,12,13],issuanc:[10,12,13],issuer:12,item:[3,12],iter:[10,12],itself:[2,6,7,8,9,10,12],jar:[0,2,8],jarinputstream:2,java:[1,5,7,8,10,12],javaclass:10,javacommercialpap:12,javadoc:1,jdk1:3,jdk:[3,10,12],jetbrain:[3,5],jira:5,jmx2graphit:8,jmx:8,jmxtran:8,join:[7,12],joint:12,jolokia:8,json:8,judgement:1,jump:11,junit:[5,12],just:[1,2,3,7,8,10,11,12],justifi:4,jvm:[2,5,8,10],kafka:7,kdoc:1,keep:[2,10,12,13],kei:[1,2,5,7,9,10,11,12],kept:10,key_mismatch_at_issu:12,keymanagementservic:10,keypair:[10,12],keyword:[1,12],kick:10,kind:[2,5,7,9,10,12],know:[5,9,10,11],knowledg:9,known:[2,6],kotin:12,kotlin:[1,3],kryo:[5,7,10],label:[10,12,13],labori:12,land:6,languag:[1,2,3,4,5,12,13],larg:[9,10,12],larger:[1,2],latenc:9,later:[1,2,5,7,9,10,12],latest:[1,3],latter:[1,12],layer:[5,7,10],layout:13,lazili:[],lead:[1,12],leak:10,learn:[4,10,11,12],least:[9,12],leav:[1,10],ledger:[2,4,6,8,9,10,12,13],left:[7,10],leg:[5,6],legal:[2,9,12],legalcontractrefer:12,legallyidentifi:[9,10],legallyidentifiablenod:10,less:[10,12,13],let:[1,2,8,9,10,11,12],letter:1,level:[1,3,6,7,9,10,12],lib:0,liber:1,libor:[6,8,9],librari:[1,5,8,9,10,12],lifecycl:[],lifetim:6,like:[1,2,3,6,7,8,9,10,12],likewis:12,limit:[2,4,12],line:[0,1,3,8,10,11,12],link:[1,2,9,10,12],linux:[8,11],list:[0,2,7,9,10,11,12],listen:[1,5],listenablefutur:10,liter:2,littl:[1,12],live:6,load:[11,12],loan:[6,9],local:[0,2,3,8,9,10],locald:9,localhost:8,locat:[9,11,12],lock:[1,12],log:[10,11],logger:10,logic:[2,5,7,10,12],logo:3,longer:[6,9,10],look:[1,6,7,8,9,10,12],loop:[1,6,12],loquitur:9,loss:9,lot:[1,6],low:10,lower:[1,9],lurch:10,mac:8,machin:[2,9],maco:11,made:[1,4,6,10],mai:[1,2,5,7,8,9,10,12],mail:11,main:[10,12,13],maintain:2,maintan:9,mainten:7,make:[0,1,6,7,9,10,12],makenod:7,maker:5,malici:10,manag:8,mani:[1,2,5,7,9,10,12],manner:10,manual:7,map:[1,6,9,10],mappabl:12,mark:[1,10,12],markdown:1,marker:[10,12],market:4,match:[2,7,9,10,12],matter:12,matur:[6,8,9,12],maturityd:12,maximis:2,maybestx:10,maybetraderequest:10,mbean:8,mean:[1,2,7,9,10],measur:[6,12],mechan:12,meet:12,mega_corp:12,mega_corp_kei:12,mega_corp_pubkei:13,megacorp:[12,13],member:6,memori:[],menlo:1,mention:10,menu:3,mere:[6,12],merg:[5,12],mess:10,messag:[1,2,5],messagehandlerregistr:7,messagerecipi:7,messagerecipientgroup:7,messagingservic:[7,10],method:[1,8],metric:8,middl:[1,7,10],might:[1,6,10,12],mind:[1,9,10,12],mine:2,minim:10,minimum:[2,6],minu:12,minut:[5,9],misc:7,miss:[1,10,12],missingsig:10,mission:8,mix:[1,10,12],mock:7,mode:[5,7],model:1,modif:12,modifi:[3,6,10,12],modul:[7,12],moment:7,monei:[9,12],monetari:12,monitor:1,month:[6,10],more:[1,2,5,6,7,8,9,10,11,12],moreexecutor:1,most:[6,7,8,9,10,12],mostli:12,move:[10,12,13],movement:[10,12],much:[1,2,5,10,12],multi:[1,10,12],multipl:[2,7,12],multipli:6,must:[2,7,8,9,10,12],mutabl:[1,2,12],mutual:10,myfil:8,mykeypair:10,nail:1,name:[1,7,8,9,10,11,12],namespac:10,narrow:1,nativ:10,natur:12,naval:[2,9],navistar:9,necessari:[1,11],necessarili:[],need:[0,1,2,4,6,7,8,10,12],neither:[10,12],nest:10,net:[6,12,13],network:5,neutral:5,never:[1,9,12],newli:10,newown:12,next:[1,3,6,10,12],nio:1,noddi:8,node:[2,5],nodea:11,nodeb:11,nodeinterestr:9,nodeservic:9,non:[1,2,10],none:10,normal:[6,10,12],not_matured_at_redempt:12,notat:10,note:[0,1,2,3,6,10,12],noth:[1,2,12],notic:[1,12],notif:7,notifi:7,notion:[2,5,6,12],notnul:12,now:[3,7,9,10,11,12,13],nugget:12,nullpublickei:12,number:[1,6,7,9,10,11,12],obj:12,object:[1,2,5,6,7,8,9,10,12,13],oblig:6,observ:[6,9,10],observatori:[2,9],obsolet:5,obtain:[1,13],obviou:[1,9],obvious:[6,12],occasion:[],occur:[9,10,12],occurr:9,odd:[10,12],off:[7,10,12,13],offer:10,offlin:7,offset:6,often:[1,2,6,9,10,12],oftenor:9,onc:[0,1,5,6,7,9,10,12],onli:[1,2,5,6,7,8,9,10,11,12,13],onto:[1,10,12,13],opaqu:[5,7],opaquebyt:12,open:[2,3,9,10,11,13],openjdk:3,oper:[6,7,8,9,10,12],opposit:[],optim:1,option:[0,6,7,9,10,12],oracl:[2,3,5,6,8],ordain:6,order:[0,5,6,7,10,12,13],ordinari:[2,5,10,12],org:[0,3,12],orient:[],origin:12,otc:5,other:[1,2,5,6,7,9,10,11,12],othersid:10,otherwis:[10,12],our:[1,2,10,12],ourselv:[10,12],oursignatur:10,out:[1,2,3,5,8,9,10,12],outag:7,outcom:10,outlin:10,outpoint:2,output:[2,9,10,12,13],outsid:[2,7,9,10,12],outstat:12,over:[1,2,6,7,8,9,10,12],overal:7,overflow:1,overload:10,overrid:[10,12],overview:4,own:[1,7,8,9,10,12,13],ownablest:10,owned_bi:12,owner:[10,12],ownership:[10,12],owningkei:[10,12],p2p:[5,10],pack:12,packet:2,page:[9,12],pai:[9,10,12,13],paid:6,pair:[2,10,12],paper:[5,10,11],paper_1:[12,13],parallel:[7,10],paramet:[10,12],parameteris:2,parent:10,pars:9,part:[1,2,9,10,12],parti:[5,6,9],partial:[10,12],partialtx:10,particip:[2,12],particular:[1,8,10],partyrefer:12,pass:[7,10,12,13],past:[9,11,12],patch:1,path:[1,8,12],pattern:[1,2,12],payer:6,payment:[6,9,10,11,12,13],pdf:9,peer:[5,7,9,10],penni:12,peopl:[1,2,5,12],perform:[1,6,9,10,11,12],perhap:12,period:6,perman:[5,12],persist:[5,7,10],perspect:[10,12],phrase:9,physic:9,pick:[7,10,12],piec:[2,7,10,12],ping:7,pip:0,pki:2,place:[0,1,2,5,6,7,9,10,12],plai:[10,11],plan:7,platform:[2,4,5,6,7,9,10,11,12],pleas:[1,2,11,12],plugin:[3,8],point:[1,2,8,9,10,11,12],pointer:10,pointless:1,pong:7,pool:10,poor:2,pop:[3,7],popular:5,posess:10,posit:[1,10],possibl:[2,4,7,9,10,12],potenti:[5,10,12],pound:12,power:[2,4],practic:[2,12],pre:[0,2,6,10,12],preced:12,precis:[5,9],precondit:1,prefer:[1,2],prefix:10,preliminari:7,prepar:12,present:[4,6,9,12],press:12,pretend:8,pretti:[10,12],prevent:12,previous:[6,9],price:[2,9,10],primari:[5,9],primit:12,print:11,priv:10,privaci:[1,2,10,12],privat:[2,10,12],probabl:[3,9,12],problem:[9,10],proce:10,procedur:10,process:[6,7,8,12],process_:8,produc:[0,12,13],product:[1,4,5,12],profit:[12,13],program:[1,2,5,7,8,10,11,12],programref:12,progress:6,progresstrack:10,project:[3,11],proof:[2,4],propag:[4,8,12],properli:10,properti:[8,10,12],propos:10,prose:9,protect:10,protocol:[2,5,8,9],protocollog:10,protocolstatemachin:10,protocoltrack:10,prototyp:[1,2],prove:[2,4,12],provid:[0,1,2,6,7,8,9,10,12],pseudo:9,ptx:10,publickei:[10,12],publicli:[],pull:3,pump:7,punish:9,purchas:[10,11],pure:[2,9],purpos:[5,10,12],put:[1,10,12],python:0,qualiti:4,quantiti:[2,5,12],quasar:10,queri:[6,9],question:[1,9],queue:[1,5,7,10],quick:9,quickli:[7,12],quit:[1,9,10,12],r3prototyp:0,r3repositori:3,random63bitvalu:10,random:[2,10],rang:9,rapid:[1,5],rate:[1,5],ratefixprotocol:9,rather:[1,2,10,12],rational:2,raw:[8,10],reach:[6,9],reachabl:10,read:[1,4,5,8,9,10,12],readabl:[5,10],reader:12,readi:12,real:[1,5,7,9,12],realis:10,realism:7,realiti:6,realli:[1,10,12],reason:[1,6,10,12],reassign:12,recal:6,receiv:[2,6,7,9,10,12,13],receiveandcheckproposedtransact:10,receiveandvalidatetraderequest:10,recipi:[7,12],recognis:[2,9,12],recommend:[1,7],record:7,recov:7,recreat:10,red:[3,6],redeem:[5,12,13],redempt:[12,13],redemptiontim:[12,13],reduc:1,redund:1,ref:[10,12],refer:[2,5,6,9,10,12],refin:5,reflect:12,refus:3,regardless:10,regener:6,regist:[1,7,8,10],registr:7,regular:[5,8,10,12],reissuanc:12,reject:12,rel:[2,7],relabelablestep:10,relat:[6,12],relationship:12,releas:13,relev:2,reli:2,reliabl:7,relianc:2,relic:8,religi:1,remain:[12,13],rememb:[1,10,12],remind:10,remov:[7,10,12],render:[1,10,13],repeat:[1,6,7,10],replac:[6,8,12],replic:2,report:7,repositori:1,repres:[1,2,6,7,9,10,12],represent:6,request:[7,9,10],requir:[1,5,6,8,9,10],requiresinglecommand:12,requirethat:12,resel:9,reserv:10,reset:6,resolut:[2,4,10],resolv:10,resolvetransactionsprotocol:10,resourc:10,respect:[1,10,12],respons:[7,9,10],rest:[2,7,8,10],restart:[3,10,11],restor:10,restructuredtext:0,result:[1,2,6,9,10,12],resultfutur:10,resum:10,resurrect:10,retri:[7,10],retriev:6,reus:[2,10],reusabl:9,reveal:[10,12],revers:10,review:1,revis:6,rewrit:10,right:[1,3,7,8,10],rigid:2,rigidli:1,risk:10,roll:[6,10],rollov:12,root:[11,12,13],roughli:9,rout:10,router:7,rule:[1,9,10,12],run:[1,2,3,5,8,10],runbuy:10,runnetwork:7,runsel:10,runtim:[1,10],safe:[1,2,10,12],safeti:1,sai:[1,12],sale:[11,12],same:[1,2,5,6,7,9,10,12,13],sandbox:[2,5,12],saniti:10,satisfi:12,save:[1,12],scala:[5,12],scalabl:[1,2],scale:6,scene:[10,12],schedul:[6,8],scope:[2,12],scrape:8,screen:[1,3],script:[0,2,11,12],scroll:11,scrub:10,seamless:5,search:[3,10,12],second:[6,10,11,12],secondari:10,secp256r1:5,section:12,secur:[2,7,10],securehash:12,see:[0,1,5,6,7,9,10,11,12],seed:10,seen:[1,6,9,10,12,13],select:[3,12],self:5,sell:[5,10,12],seller:[],sellerownerkei:10,sellersig:10,sellertradeinfo:10,semi:[2,9],send:[1,2,7,8,9,10,12],sendandrec:10,sendsignatur:10,sens:[6,9,10,12],sent:[7,10,12],separ:[8,9,10,12],sequenc:7,sequenti:[7,10],seri:10,serial:[5,7,12],serialis:[1,5,7,10,12],serializablewithkryo:12,serializeablewithkryo:12,server:[8,9],servic:8,servicehub:10,session:[7,10],sessionid:10,set:2,setof:10,setter:12,settim:10,settl:[7,9],settlement:10,sever:[2,10,12],sha256:12,sha256sum:8,sha:[2,8],share:[2,4,6,9,10,12],shasum:8,she:12,shell:11,shortcut:5,shorthand:12,shot:7,should:[1,2,3,5,7,10,11,12],shoulder:1,shouldn:[10,12],show:[2,3,5,11,12,13],shown:[10,12],shutdown:10,side:[9,10],sig:12,sign:[2,5,6,7,9,10,12],signatur:[2,5,7,9,10,12],signatureexcept:10,signaturesfromsel:10,signedtransact:[10,12],signer:[9,12],significantli:6,signoff:9,signwith:[10,12],signwithecdsa:10,signwithourkei:10,silver:1,similar:[1,2,7,9,12],similarli:[],simpl:[1,5,6,7,8,10,12,13],simpler:5,simplest:[10,12],simpli:[1,7,10,12],simplifi:[1,2,5,7,12],simultan:[7,10,12],singl:[1,2,8,9,10,12,13],singlemessagerecipi:[7,10],singleton:[10,12],sit:7,site:1,situat:1,size:[1,6,10,12],skip:10,slight:12,slightli:12,slow:1,small:[2,5,9,10,11,12,13],smart:[5,9],smm:10,smooth:12,snide:0,snippet:[10,12],softwar:[5,10],sold:[10,12,13],solv:[9,10],solvenc:9,some:[1,2,5,7,8,9,10,11,12,13],somed:12,someon:[7,12],someprofit:[12,13],someth:[1,3,6,11,12],sometim:[2,7,8,9,10,12],somewhat:[2,10],somewher:[12,13],sort:[9,10],sound:[10,12,13],sourc:[6,9,10],space:[1,9,12],sparingli:1,special:2,specialis:10,specif:[2,7,8,9,10,12,13],specifi:[0,5,7,9,10,12],speed:10,spend:[2,10,12],sphinx:0,sphinx_rtd_them:0,split:[5,12],spread:[7,10],spreadsheet:9,squar:13,src:[12,13],stack:10,stage:[1,10,12],stai:[2,12],standalon:[5,9],standard:[1,4,5,8,10,12],standardis:[2,12],start:[1,2,6,8,10,11],startup:11,state:[2,5,6,9],stateandref:[10,12],stateless:2,statemachinemanag:10,statement:[1,9,10,12],stateref:2,statesoftyp:10,statist:8,status:2,step:[9,10,12],still:[2,10,12],stock:[2,9],stop:[1,7,10],storag:2,store:[10,12],stori:1,straightforward:[10,12],stream:10,stress:1,strictli:6,string:[7,9,10,12],strong:5,structur:[1,2,3,5,9,10,12],studi:12,stuff:10,stx:10,sub:10,subclass:10,subgroup:2,submenu:3,submiss:9,submit:[1,7,10],subprotocol:10,subscrib:7,subtask:10,subtl:1,success:11,successor:5,sudo:0,suffic:9,suffici:[4,7,9],suffix:12,suggest:[7,12],suitabl:7,sum:12,sumcashbi:[10,12],sumcashornul:12,summaris:2,sun:1,superclass:10,superior:1,supertyp:12,support:[1,5,6,7,9,10,11,12],suppos:[10,12],sure:12,surfac:10,surround:[1,12],surviv:10,suspend:[],swap:5,swapsignatureswithsel:10,symbol:3,synchronis:[1,2,9],syntax:[5,12],syscal:11,system:[2,5,8,9,10,12],tab:[1,3],tag:1,tailor:4,take:[1,5,6,10,12,13],tamper:10,target:[0,1,2,5,8],targetrecipi:7,task:[2,10],technic:[],techniqu:[1,9,12],tell:[0,7,10],tempor:9,temporari:2,temporarili:10,tempt:12,temptat:10,ten:12,tenor:[6,8,9],term:[2,12],termin:[6,8,10,11],terminolog:2,test:[3,5,10,11],test_tx_tim:12,testutil:12,testwithinmemorynetwork:7,text:[1,3,8],than:[1,2,4,8,10,12,13],thei:[1,2,5,6,7,8,9,10,11,12],theirsessionid:10,them:[1,2,5,6,7,8,10,11,12],themselv:[7,9,10,12],theori:9,therefor:[5,10,12],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],thing:[1,2,5,9,10,11,12],think:[1,3,10,12],third:[11,12],those:[7,8,9,10,12],though:[7,8,10,12],thought:[2,5],threadsaf:1,three:[11,12],threshold:12,through:[2,6,8,10,12],throwifsignaturesaremiss:10,thrown:12,thu:[1,8,9,12],tighten:12,tightli:10,time:[1,2,5,6,8,9,10,12,13],timelin:12,timestamp:[1,2,5,9,10,12],timestampauthoritysig:10,timestampcommand:9,timestampercli:12,timestamperservic:9,timestampingauthor:10,timestampingprotocol:10,todo:[10,12],togeth:[2,10,12],told:1,toledgertransact:10,toler:9,too:[1,10,12,13],took:10,tool:[5,8],top:[1,10,12],topic:[7,10],topriv:10,toset:10,tosignedtransact:[10,12],tostr:[1,10,12],total:12,trace:10,track:[],tracker:[5,10],trade1:11,trade:[5,6,9],trade_top:10,tradeoff:[1,9],trader:[],traderequest:10,tradit:12,traffic:10,transact:[2,4,8,9,10,12,13],transactionbuild:[10,12],transactionforverif:12,transactiongroup:12,transactiongroupdsl:13,transactiongroupfor:13,transactiongroupfortest:12,transfer:12,transit:[4,12],treat:12,tree:10,tri:12,tricki:10,trigger:9,trivial:[1,11],trust:10,truth:10,tsa:[2,10],tsasig:10,ture:2,turn:[10,12],tutori:[4,5,9,10,12],twice:5,two:[1,5,6],twopartytradeprotocol:10,txbit:10,txhash:[2,10,12],txt:8,type:[1,2,6,9,10,12],typenam:10,typetobui:10,typic:[7,8,10,12],ubuntu:11,unacceptablepriceexcept:10,under:[0,10,12],underli:[6,10],underscor:12,understand:8,unexecut:12,unexpect:10,unfinish:10,unfortun:[10,12],unguess:10,uniqu:[2,9,10],unit:[3,5,7,10,12,13],unix:8,unknow:9,unless:[1,9,10,12],unlik:12,unnecessari:12,unpack:[10,12],unread:10,unrecognis:12,unrel:12,unserialis:10,unset:6,unspent:2,unstart:10,unsupportedoperationexcept:12,until:[6,7,10],untrustworthydata:10,unus:7,unusu:12,unwieldi:[],updat:[2,3,7,10,12],upgrad:[3,4],upload:[],upon:[6,10,12],url:3,usabl:5,usag:[1,9,10,12],useless:12,user:[0,1,2,5,7,9,10,11],usr:0,util:[5,7,12],utxo:2,vagu:1,val:[7,9,10,12,13],valid:[2,6,9,10,12],valu:[5,6,9,12,13],valuabl:9,valuat:6,vanilla:[5,6],vari:[],variabl:[6,10,12],variant:12,variou:[1,2,5,8,10,12],vendor:[5,8],verbos:12,veri:[1,2,5,9,11,13],verif:[2,5],verifi:[2,5,9,10],verifytransact:10,versa:[6,10],version:[3,5,6,7,10,12],versu:10,vertic:1,via:[0,1,2,6,8,9,10,11],vice:[6,10],view:[1,6],virtual:[2,4],visibl:2,visualis:[],vital:10,wai:[1,2,5,8,9,10,12],wait:[3,7,10,11],wallet:[2,10,12],walletservic:10,want:[1,3,7,8,9,10,12],weak:9,web:[8,9],websit:12,weekend:6,well:[0,1,2,5,6,8,9,10,12],went:1,were:[1,9,10,12],what:[1,2],whatev:[1,10],when:[1,6,7,8,9,10,12],whenev:1,where:[1,2,6,7,8,9,10],wherea:6,wherev:8,whether:[7,9,10],which:[0,1,2,5,6,7,8,9,10,11,12],whilst:[2,9,10,12],who:[1,5,7,10,12],whole:12,whom:7,whose:8,why:[1,2,5,12],wide:[1,7,12],widescreen:1,widespread:1,width:1,wiki:[2,12],wikipedia:12,window:[2,10,11,13],wirecommand:12,wiretransact:[9,10],wish:[7,9,10,12],within:[0,2,8,11],withkei:10,withnewown:10,without:1,withoutown:12,won:[7,9,10,12],word:1,work:[1,2,3,4,5,6,7,8,9,10,11,12],worker:1,world:[2,9,10,12],worn:12,worri:[1,5,10],worth:[1,12],worthless:9,would:[1,5,6,7,8,9,10,12],wouldn:[9,12],wrap:[1,8,10,12],wrapper:10,write:[1,5,8],written:[0,2,5,6,12],wrong:[1,10,11],wtx:[9,10],www:[0,3],year:6,yet:[1,2,6,10,12],yield:[2,10],you:[0,1,2,3,5,7,8,9,10,11,12,13],your:1,your_usernam:3,zero:[2,12],zip:[2,8]},titles:["Building the documentation","Code style guide","Data model","Getting set up","Welcome to the R3 prototyping repository!","What’s included?","The Interest Rate Swap Contract","Networking and messaging","Node administration","Writing oracle services","Protocol state machines","Running the demos","Writing a contract","Using the visualiser"],titleterms:{"class":12,"function":12,about:3,administr:8,api:12,approach:9,assert:[1,9],asset:12,attach:8,base:12,basic:9,bitcoin:2,build:0,buyer:10,check:12,code:1,command:12,comment:1,commerci:12,comparison:2,complain:3,continu:9,contract:[5,6,12],creat:6,data:[2,9],demo:11,descript:2,detail:6,document:0,download:8,error:1,ethereum:2,fix:8,framework:9,fungibl:[],gener:[1,12],get:3,group:12,guid:1,how:12,implement:[7,9,10],includ:5,instanc:6,intellij:3,interest:[6,8],interfac:7,introduct:[9,10],known:9,kotlin:5,lack:3,lifecycl:6,machin:10,manag:10,map:7,memori:7,messag:7,method:10,model:2,monitor:8,network:7,node:8,non:12,occasion:9,oracl:9,orient:12,paper:12,parti:10,progress:10,protocol:10,prototyp:4,publicli:9,rate:[6,8],repositori:4,requir:[0,12],run:11,sdk:3,seller:10,servic:[7,9],set:3,smart:12,start:12,state:[10,12],style:1,suspend:10,swap:6,technic:6,test:12,theori:10,thread:1,track:10,trade:10,trader:11,two:[9,10],understand:[],upload:8,vari:9,verifi:12,visualis:13,welcom:4,what:5,without:3,write:[9,12],your:[8,12]}}) \ No newline at end of file diff --git a/docs/build/html/tutorial.html b/docs/build/html/tutorial.html index 73515b9326..cb738bc372 100644 --- a/docs/build/html/tutorial.html +++ b/docs/build/html/tutorial.html @@ -91,7 +91,7 @@
  • Getting set up
  • Data model
  • Networking and messaging
  • -
  • Running the demos
  • +
  • Running the demos
  • Node administration
  • The Interest Rate Swap Contract
  • @@ -102,7 +102,7 @@
  • States
  • Commands
  • The verify function
  • -
  • Understanding fungibility
  • +
  • Using state groups
  • Checking the requirements
  • How to test your contract
  • Adding a generation API to your contract
  • @@ -116,6 +116,7 @@ @@ -372,44 +373,38 @@ run two contracts one time each: Cash and CommercialPaper.

    override fun verify(tx: TransactionForVerification) {
         // Group by everything except owner: any modification to the CP at all is considered changing it fundamentally.
    -    val groups = tx.groupStates<State>() { it.withoutOwner() }
    +    val groups = tx.groupStates() { it: State -> it.withoutOwner() }
         val command = tx.commands.requireSingleCommand<CommercialPaper.Commands>()
     
    @Override
     public void verify(@NotNull TransactionForVerification tx) {
    -    List<InOutGroup<State>> groups = tx.groupStates(State.class, State::withoutOwner);
    +    List<InOutGroup<State, State>> groups = tx.groupStates(State.class, State::withoutOwner);
         AuthenticatedObject<Command> cmd = requireSingleCommand(tx.getCommands(), Commands.class);
     
    -

    We start by using the groupStates method, which takes a type and a function (in functional programming a function -that takes another function as an argument is called a higher order function). State grouping is a way of handling -fungibility in a contract, which is explained next. The second line does what the code suggests: it searches for +

    We start by using the groupStates method, which takes a type and a function. State grouping is a way of ensuring +your contract can handle multiple unrelated states of the same type in the same transaction, which is needed for +splitting/merging of assets, atomic swaps and so on. The second line does what the code suggests: it searches for a command object that inherits from the CommercialPaper.Commands supertype, and either returns it, or throws an exception if there’s zero or more than one such command.

    -
    -

    Understanding fungibility

    -

    We say states are fungible if they are treated identically to each other by the recipient, despite the fact that they -aren’t quite identical. Dollar bills are fungible because even though one may be worn/a bit dirty and another may -be crisp and new, they are still both worth exactly $1. Likewise, ten $1 bills are almost exactly equivalent to -one $10 bill. On the other hand, $10 and £10 are not fungible: if you tried to pay for something that cost £20 with -$10+£10 notes your trade would not be accepted.

    -

    So whilst our ledger could represent every monetary amount with a collection of states worth one penny, this would become -extremely unwieldy. It’s better to allow states to represent varying amounts and then define rules for merging them -and splitting them. Similarly, we could also have considered modelling cash as a single contract that records the -ownership of all holders of a given currency from a given issuer. Whilst this is possible, and is effectively how -some other platforms work, this prototype favours a design that doesn’t necessarily require state to be shared between -multiple actors if they don’t have a direct relationship with each other (as would implicitly be required if we had a -single state representing multiple people’s ownership). Keeping the states separated also has scalability benefits, as -different parts of the global transaction graph can be updated in parallel.

    +
    +

    Using state groups

    +

    The simplest way to write a smart contract would be to say that each transaction can have a single input state and a +single output state of the kind govered by that contract. This would be easy for the developer, but would prevent many +important use cases.

    +

    The next easiest way to write a contract would be to iterate over each input state and expect it to have an output +state. Now you can build a single transaction that, for instance, moves two different cash states in different currencies +simultaneously. But it gets complicated when you want to issue or exit one state at the same time as moving another.

    +

    Things get harder still once you want to split and merge states. We say states are fungible if they are +treated identically to each other by the recipient, despite the fact that they aren’t quite identical. Dollar bills are +fungible because even though one may be worn/a bit dirty and another may be crisp and new, they are still both worth +exactly $1. Likewise, ten $1 bills are almost exactly equivalent to one $10 bill. On the other hand, $10 and £10 are not +fungible: if you tried to pay for something that cost £20 with $10+£10 notes your trade would not be accepted.

    To make all this easier the contract API provides a notion of groups. A group is a set of input states and output states -that should be checked for validity independently. It solves the following problem: because every contract sees every -input and output state in a transaction, it would easy to accidentally write a contract that disallows useful -combinations of states. For example, our cash contract might end up lazily assuming there’s only one currency involved -in a transaction, whereas in reality we would like the ability to model a currency trade in which two parties contribute -inputs of different currencies, and both parties get outputs of the opposite currency.

    +that should be checked for validity together.

    Consider the following simplified currency trade transaction:

    • Input: $12,000 owned by Alice (A)
    • @@ -426,10 +421,55 @@ be merged together. So we have two groups: A and B.

      given type (as the transaction may include other types of state, such as states representing bond ownership, or a multi-sig state) and then it takes a function that maps a state to a grouping key. All states that share the same key are grouped together. In the case of the cash example above, the grouping key would be the currency.

      -

      In our commercial paper contract, we don’t want CP to be fungible: merging and splitting is (in our example) not allowed. -So we just use a copy of the state minus the owner field as the grouping key. As a result, a single transaction can -trade many different pieces of commercial paper in a single atomic step.

      -

      A group may have zero inputs or zero outputs: this can occur when issuing assets onto the ledger, or removing them.

      +

      In other kinds of contract, we don’t want CP to be fungible: merging and splitting is (in our example) not allowed. +So we just use a copy of the state minus the owner field as the grouping key.

      +

      Here are some code examples:

      +
      +
      // Type of groups is List<InOutGroup<State, Pair<PartyReference, Currency>>>
      +val groups = tx.groupStates() { it: Cash.State -> Pair(it.deposit, it.amount.currency) }
      +for ((inputs, outputs, key) in groups) {
      +    // Either inputs or outputs could be empty.
      +    val (deposit, currency) = key
      +
      +    ...
      +}
      +
      +
      +
      List<InOutGroup<State, Pair<PartyReference, Currency>>> groups = tx.groupStates(Cash.State.class, s -> Pair(s.deposit, s.amount.currency))
      +for (InOutGroup<State, Pair<PartyReference, Currency>> group : groups) {
      +    List<State> inputs = group.getInputs();
      +    List<State> outputs = group.getOutputs();
      +    Pair<PartyReference, Currency> key = group.getKey();
      +
      +    ...
      +}
      +
      +
      +
      +

      The groupStates call uses the provided function to calculate a “grouping key”. All states that have the same +grouping key are placed in the same group. A grouping key can be anything that implements equals/hashCode, but it’s +always an aggregate of the fields that shouldn’t change between input and output. In the above example we picked the +fields we wanted and packed them into a Pair. It returns a list of ``InOutGroup``s, which is just a holder for the +inputs, outputs and the key that was used to define the group. In the Kotlin version we unpack these using destructuring +to get convenient access to the inputs, the outputs, the deposit data and the currency. The Java version is more +verbose, but equivalent.

      +

      The rules can then be applied to the inputs and outputs as if it were a single transaction. A group may have zero +inputs or zero outputs: this can occur when issuing assets onto the ledger, or removing them.

      +

      In this example, we do it differently and use the state class itself as the aggregator. We just +blank out fields that are allowed to change, making the grouping key be “everything that isn’t that”:

      +
      +
      val groups = tx.groupStates() { it: State -> it.withoutOwner() }
      +
      +
      +
      List<InOutGroup<State, State>> groups = tx.groupStates(State.class, State::withoutOwner);
      +
      +
      +
      +

      For large states with many fields that must remain constant and only one or two that are really mutable, it’s often +easier to do things this way than to specifically name each field that must stay the same. The withoutOwner function +here simply returns a copy of the object but with the owner field set to NullPublicKey, which is just a public key +of all zeros. It’s invalid and useless, but that’s OK, because all we’re doing is preventing the field from mattering +in equals and hashCode.

    Checking the requirements